feat: UDM数据操作调整

This commit is contained in:
TsMask
2024-11-12 10:17:45 +08:00
parent 1a9e5735a4
commit 729f03d2fe
6 changed files with 75 additions and 275 deletions

View File

@@ -55,8 +55,8 @@ func (s *UDMAuthController) ResetData(c *gin.Context) {
// GET /list
func (s *UDMAuthController) List(c *gin.Context) {
querys := ctx.QueryMap(c)
data := s.udmAuthService.SelectPage(querys)
c.JSON(200, result.Ok(data))
total, rows := s.udmAuthService.SelectPage(querys)
c.JSON(200, result.Ok(map[string]any{"total": total, "rows": rows}))
}
// UDM鉴权用户信息
@@ -364,13 +364,12 @@ func (s *UDMAuthController) Export(c *gin.Context) {
querys["pageNum"] = 1
querys["pageSize"] = 10000
data := s.udmAuthService.SelectPage(querys)
if parse.Number(data["total"]) == 0 {
total, rows := s.udmAuthService.SelectPage(querys)
if total == 0 {
// 导出数据记录为空
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.exportEmpty")))
return
}
rows := data["rows"].([]model.UDMAuthUser)
// rows := s.udmAuthService.SelectList(model.UDMAuthUser{NeId: neId})
if len(rows) <= 0 {