Commit 6f3e1a26 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Refactor response structure in GetBlackWhiteLists method

- Update the response format in the GetBlackWhiteLists method to utilize a new ListRespData structure, enhancing clarity and consistency in the returned data.
- Maintain existing functionality while improving the organization of response data, including items and total count.
parent 7aeb7fbb
...@@ -488,9 +488,11 @@ func (c *WafController) GetBlackWhiteLists(ctx *gin.Context) { ...@@ -488,9 +488,11 @@ func (c *WafController) GetBlackWhiteLists(ctx *gin.Context) {
utils.AssembleResponse(ctx, nil, err) utils.AssembleResponse(ctx, nil, err)
return return
} }
type resp struct {
Items []service.MatcherExpr `json:"items"` respData := utils.ListRespData{
Total int `json:"totalItems"` Items: lists,
TotalItems: total,
ItemsPerPage: limit,
} }
utils.AssembleResponse(ctx, resp{Items: lists, Total: total}, nil) utils.AssembleResponse(ctx, respData, nil)
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment