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

@@ -10,9 +10,9 @@ import (
// SuccessResponse defines the standard JSON success response structure.
type SuccessResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
Code int `json:"code"`
Message string `json:"message"`
Data any `json:"data,omitempty"`
}
// ErrorResponse defines the standard JSON error response structure.
@@ -22,7 +22,7 @@ type ErrorResponse struct {
}
// Success sends a standardized success response.
func Success(c *gin.Context, data interface{}) {
func Success(c *gin.Context, data any) {
c.JSON(http.StatusOK, SuccessResponse{
Code: 0,
Message: "Success",