adminApply.go 727 B

123456789101112131415161718192021222324252627
  1. package admin
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "project_management/app/e"
  5. "project_management/app/model"
  6. "project_management/unity"
  7. )
  8. // AdminApplyList 管理员获取所有应用列表
  9. func AdminApplyList(c *gin.Context) {
  10. var params unity.QueryPageParams
  11. if err := c.ShouldBindJSON(&params); err != nil {
  12. e.ResponseWithMsg(c, e.JSONParsingFailed, e.JSONParsingFailed.GetMsg())
  13. return
  14. }
  15. queryCond := "app_name like ?"
  16. params.Query = "%" + params.Query + "%"
  17. result, total, err := unity.PaginateWithCondition(params, model.Apply{}, queryCond)
  18. if err != nil {
  19. e.ResponseWithMsg(c, e.PaginationFailed, e.PaginationFailed.GetMsg())
  20. return
  21. } else {
  22. e.ResPonsePage(c, result, total, params)
  23. return
  24. }
  25. }