report_mapping.go 533 B

1234567891011121314151617181920212223242526
  1. package services
  2. import (
  3. "hongze/hongze_cygx/models"
  4. "hongze/hongze_cygx/utils"
  5. )
  6. func GetReportMappingMap() (mapResp map[int]bool, err error) {
  7. defer func() {
  8. if err != nil {
  9. go utils.SendAlarmMsg("GetReportMappingMap, ErrMsg: "+err.Error(), 3)
  10. }
  11. }()
  12. mapResp = make(map[int]bool, 0)
  13. list, err := models.GetReportMappingByPermissionName(utils.CE_LUE_NAME)
  14. if err != nil && err.Error() != utils.ErrNoRow() {
  15. return
  16. }
  17. if len(list) > 0 {
  18. for _, v := range list {
  19. mapResp[v.CategoryId] = true
  20. }
  21. }
  22. return
  23. }