This commit is contained in:
2025-12-04 16:17:27 +08:00
parent d9c2d9f103
commit 0f5c4f4303
9 changed files with 227 additions and 55 deletions

View File

@@ -110,7 +110,10 @@ func (h *ApiHandler) GetUserWhiteList(c *gin.Context) {
return
}
result, err := h.appService.GetUserWhiteList(c.Request.Context(), userID)
// 获取查询参数
remarkKeyword := c.Query("remark") // 备注模糊查询关键词
result, err := h.appService.GetUserWhiteList(c.Request.Context(), userID, remarkKeyword)
if err != nil {
h.logger.Error("获取用户白名单失败", zap.Error(err))
h.responseBuilder.BadRequest(c, err.Error())
@@ -134,7 +137,7 @@ func (h *ApiHandler) AddWhiteListIP(c *gin.Context) {
return
}
err := h.appService.AddWhiteListIP(c.Request.Context(), userID, req.IPAddress)
err := h.appService.AddWhiteListIP(c.Request.Context(), userID, req.IPAddress, req.Remark)
if err != nil {
h.logger.Error("添加白名单IP失败", zap.Error(err))
h.responseBuilder.BadRequest(c, err.Error())