feat: 将interface{}替换为any以提高代码一致性

This commit is contained in:
tbphp
2025-07-04 21:22:25 +08:00
parent 01b86f7e30
commit 13adf2ef8b
6 changed files with 27 additions and 27 deletions

View File

@@ -137,7 +137,7 @@ func (ps *ProxyServer) logRequest(c *gin.Context, group *models.Group, key *mode
// updateKeyStats atomically updates the request and failure counts for a key
func (ps *ProxyServer) updateKeyStats(keyID uint, success bool) {
// Always increment the request count
updates := map[string]interface{}{
updates := map[string]any{
"request_count": gorm.Expr("request_count + 1"),
}
@@ -178,7 +178,7 @@ func (ps *ProxyServer) applyParamOverrides(c *gin.Context, group *models.Group)
originalContentType := c.GetHeader("Content-Type")
// Unmarshal the body into a map
var requestData map[string]interface{}
var requestData map[string]any
if err := json.Unmarshal(bodyBytes, &requestData); err != nil {
// If not a valid JSON, just pass it through
c.Request.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))