优化字典模块

This commit is contained in:
2025-11-17 15:33:57 +08:00
parent 4b953d8fa9
commit e98b30edd3
10 changed files with 1014 additions and 204 deletions
+11 -2
View File
@@ -45,7 +45,11 @@ func (c *DictController) GetDictTypes() {
status = &statusVal
}
dictTypes, err := services.GetDictTypes(tenantId, userId, parentId, status)
// 分页参数
page, _ := c.GetInt("page", 1)
pageSize, _ := c.GetInt("pageSize", 20)
dictTypes, total, err := services.GetDictTypes(tenantId, userId, parentId, status, page, pageSize)
if err != nil {
c.Data["json"] = map[string]interface{}{
"success": false,
@@ -57,7 +61,12 @@ func (c *DictController) GetDictTypes() {
c.Data["json"] = map[string]interface{}{
"success": true,
"data": dictTypes,
"data": map[string]interface{}{
"list": dictTypes,
"total": total,
"page": page,
"pageSize": pageSize,
},
}
c.ServeJSON()
}