♻️ refactor(setting): move API info functions to dedicated module

Move validateApiInfo and getApiInfo functions from controller layer to
setting/api_info.go to improve code organization and separation of concerns.

Changes:
- Create setting/api_info.go with ValidateApiInfo() and GetApiInfo() functions
- Remove validateApiInfo function from controller/option.go
- Remove getApiInfo function from controller/misc.go
- Update function calls to use setting package
- Clean up unused imports (net/url, regexp, fmt) in controller/option.go

This refactoring aligns the API info configuration management with the
existing pattern used by other setting modules (chat.go, group_ratio.go,
rate_limit.go, etc.) and improves code reusability and maintainability.
This commit is contained in:
Apple\Apple
2025-06-09 19:14:34 +08:00
parent 845b748ffe
commit cbb6bcc4ac
4 changed files with 127 additions and 118 deletions

View File

@@ -986,7 +986,7 @@ const Detail = (props) => {
<div key={api.id} className="flex p-2 hover:bg-white rounded-lg transition-colors cursor-pointer">
<div className="flex-shrink-0 mr-3">
<Avatar
size="extra-extra-small"
size="extra-small"
color={api.color}
>
{api.route.substring(0, 2)}