mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
refactor: standardize constant naming and improve file-based auth handling
- Renamed constants from uppercase to CamelCase for consistency. - Replaced redundant file-based auth handling logic with the new `util.CountAuthFiles` helper. - Fixed various error-handling inconsistencies and enhanced robustness in file operations. - Streamlined auth client reload logic in server and watcher components. - Applied minor code readability improvements across multiple packages.
This commit is contained in:
@@ -289,9 +289,6 @@ func sanitizeTypeFields(jsonStr string) string {
|
||||
break
|
||||
} else if typeStr == "number" || typeStr == "integer" {
|
||||
preferredType = typeStr
|
||||
if preferredType == "" {
|
||||
preferredType = typeStr
|
||||
}
|
||||
} else if preferredType == "" {
|
||||
preferredType = typeStr
|
||||
}
|
||||
@@ -323,6 +320,8 @@ func walkForTypeFields(value gjson.Result, path string, paths *[]string) {
|
||||
walkForTypeFields(val, childPath, paths)
|
||||
return true
|
||||
})
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,5 +366,7 @@ func findNestedSchemaPaths(value gjson.Result, path string, fieldsToFind []strin
|
||||
findNestedSchemaPaths(val, childPath, fieldsToFind, paths)
|
||||
return true
|
||||
})
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user