Quellcode durchsuchen

🧹 refactor: drop obsolete ValidateApiInfo API & update callers

Backend
• Removed the exported function `ValidateApiInfo` from `setting/console_setting/validation.go`; it was only a legacy wrapper and is no longer required.
• Updated `controller/option.go` to call `ValidateConsoleSettings(value, "ApiInfo")` directly when validating `console_setting.api_info`.
• Confirmed there are no remaining references to `ValidateApiInfo` in the codebase.

This commit eliminates the last piece of compatibility code related to the old validation interface, keeping the API surface clean and consistent.
Apple\Apple vor 11 Monaten
Ursprung
Commit
66403275b7
2 geänderte Dateien mit 1 neuen und 6 gelöschten Zeilen
  1. 1 1
      controller/option.go
  2. 0 5
      setting/console_setting/validation.go

+ 1 - 1
controller/option.go

@@ -121,7 +121,7 @@ func UpdateOption(c *gin.Context) {
 			return
 			return
 		}
 		}
 	case "console_setting.api_info":
 	case "console_setting.api_info":
-		err = console_setting.ValidateApiInfo(option.Value)
+		err = console_setting.ValidateConsoleSettings(option.Value, "ApiInfo")
 		if err != nil {
 		if err != nil {
 			c.JSON(http.StatusOK, gin.H{
 			c.JSON(http.StatusOK, gin.H{
 				"success": false,
 				"success": false,

+ 0 - 5
setting/console_setting/validation.go

@@ -96,11 +96,6 @@ func validateApiInfo(apiInfoStr string) error {
     return nil
     return nil
 }
 }
 
 
-// ValidateApiInfo 保持向后兼容
-func ValidateApiInfo(apiInfoStr string) error {
-    return validateApiInfo(apiInfoStr)
-}
-
 // GetApiInfo 获取 API 信息列表
 // GetApiInfo 获取 API 信息列表
 func GetApiInfo() []map[string]interface{} {
 func GetApiInfo() []map[string]interface{} {
     apiInfoStr := GetConsoleSetting().ApiInfo
     apiInfoStr := GetConsoleSetting().ApiInfo