This commit is contained in:
vipg
2025-11-19 16:24:43 +08:00
parent d05a4cb7e2
commit 89031f86fe
3 changed files with 28 additions and 17 deletions

View File

@@ -76,19 +76,6 @@ func ReadHandler(c *gin.Context) {
return
}
// 验证查询条件至少有一个不为空
if req.CountryID == "" && req.Name == "" && req.Code == "" {
zap.L().Warn("⚠️ 请求参数验证失败",
zap.String("req_id", reqID),
zap.String("reason", "country_id、name、code不能同时为空"),
)
c.JSON(http.StatusBadRequest, ReadResponse{
Success: false,
Message: "请求参数错误country_id、name、code不能同时为空",
})
return
}
// 处理分页参数默认值
page, err := strconv.Atoi(req.Page)
if err != nil || page < 1 {