12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package controllers
- import (
- "encoding/json"
- "hongze/hongze_mfyx/models"
- )
- type TagController struct {
- BaseAuthController
- }
- // @Title 首页标签列表
- // @Description 首页标签列表接口
- // @Success 200 {object} cygx.CygxTagListLabelResp
- // @router /list/label [get]
- func (this *TagController) ListLabel() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- sysUser := this.User
- if sysUser == nil {
- br.Msg = "请登录"
- br.ErrMsg = "请登录,SysUser Is Empty"
- br.Ret = 408
- return
- }
- //list1 := []string{utils.LABEL_L1_1, utils.LABEL_L1_2, utils.LABEL_L1_3, utils.LABEL_L1_4}
- //list2 := []string{utils.LABEL_L2_1, utils.LABEL_L2_2, utils.LABEL_L2_3, utils.LABEL_L2_4}
- //
- //var list3 = []*models.CygxHashtagReq{}
- //item := new(models.CygxHashtagReq)
- //item.CheckList = append(item.CheckList, "A")
- //item.Hashtag = utils.LABEL_L3_1
- //list3 = append(list3, item)
- //
- //item.Hashtag = utils.LABEL_L3_2
- //list3 = append(list3, item)
- //
- //item.Hashtag = utils.LABEL_L3_3
- //list3 = append(list3, item)
- resp := new(models.CygxTagListLabelResp)
- key := "mfyx_tag_list"
- conf, e := models.GetConfigByCode(key)
- if e != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取首页头部导航失败, Err: " + e.Error()
- return
- }
- if conf.ConfigValue == "" {
- br.Msg = "获取失败"
- br.ErrMsg = "首页头部导航配置值有误"
- return
- }
- //list := new(models.HomeHeaderTabList)
- if e = json.Unmarshal([]byte(conf.ConfigValue), &resp); e != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "首页头部导航配置值解析失败, Err: " + e.Error()
- return
- }
- //resp := list.Home
- //if searchPage == 1 {
- // resp = list.SearchPage
- //}
- //resp.List1 = list1
- //resp.List2 = list2
- //resp.List3 = list3
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- br.Data = resp
- }
|