tag.go 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package controllers
  2. import (
  3. "hongze/hongze_mfyx/models"
  4. "hongze/hongze_mfyx/utils"
  5. )
  6. type TagController struct {
  7. BaseAuthController
  8. }
  9. // @Title 首页标签列表
  10. // @Description 首页标签列表接口
  11. // @Success 200 {object} cygx.CygxTagListLabelResp
  12. // @router /list/label [get]
  13. func (this *TagController) ListLabel() {
  14. br := new(models.BaseResponse).Init()
  15. defer func() {
  16. this.Data["json"] = br
  17. this.ServeJSON()
  18. }()
  19. sysUser := this.User
  20. if sysUser == nil {
  21. br.Msg = "请登录"
  22. br.ErrMsg = "请登录,SysUser Is Empty"
  23. br.Ret = 408
  24. return
  25. }
  26. list1 := []string{utils.LABEL_L1_1, utils.LABEL_L1_2, utils.LABEL_L1_3, utils.LABEL_L1_4}
  27. list2 := []string{utils.LABEL_L2_1, utils.LABEL_L2_2, utils.LABEL_L2_3, utils.LABEL_L2_4}
  28. list3 := []string{utils.LABEL_L3_1, utils.LABEL_L3_2, utils.LABEL_L3_3}
  29. resp := new(models.CygxTagListLabelResp)
  30. resp.List1 = list1
  31. resp.List2 = list2
  32. resp.List3 = list3
  33. br.Ret = 200
  34. br.Success = true
  35. br.Msg = "获取成功"
  36. br.Data = resp
  37. }