chore: 删除未使用的孤立包

清理以下未导入的包:
- internal/response (未使用的响应结构体)
- pkg/response (未使用的响应封装)
- internal/model (TLSFingerprintProfile, ErrorPassthroughRule)
- internal/models (SocialAccount, domain已有)
- internal/pkg/response (未使用的响应封装)
- internal/security/ratelimit (已迁移到middleware)

验证: go build ./... && go test ./... 通过
This commit is contained in:
2026-04-07 17:46:25 +08:00
parent 5ca3633be4
commit 5dbb530b76
9 changed files with 0 additions and 1508 deletions

View File

@@ -1,50 +0,0 @@
package response
import (
"net/http"
"github.com/gin-gonic/gin"
)
// Response 统一响应结构
type Response struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
// Success 成功响应
func Success(c *gin.Context, data interface{}) {
c.JSON(http.StatusOK, Response{
Code: 0,
Message: "success",
Data: data,
})
}
// Error 错误响应
func Error(c *gin.Context, httpStatus int, message string, err error) {
if err != nil {
// 在开发环境下返回详细错误信息
if gin.Mode() == gin.DebugMode {
c.JSON(httpStatus, Response{
Code: httpStatus,
Message: message,
Data: err.Error(),
})
return
}
}
c.JSON(httpStatus, Response{
Code: httpStatus,
Message: message,
})
}
// ErrorWithCode 错误响应(带自定义错误码)
func ErrorWithCode(c *gin.Context, code int, message string) {
c.JSON(http.StatusOK, Response{
Code: code,
Message: message,
})
}