Browse Source

no message

xingzai 1 year ago
parent
commit
4285644be6
4 changed files with 114 additions and 9 deletions
  1. 64 0
      controllers/report.go
  2. 43 7
      controllers/tag.go
  3. 6 1
      models/cygx_tag.go
  4. 1 1
      routers/router.go

+ 64 - 0
controllers/report.go

@@ -0,0 +1,64 @@
+package controllers
+
+import (
+	"hongze/hongze_mfyx/models"
+	"hongze/hongze_mfyx/services"
+	"hongze/hongze_mfyx/utils"
+)
+
+// 报告
+type ReportController struct {
+	BaseAuthController
+}
+
+type ReportCommonController struct {
+	BaseCommonController
+}
+
+// @Title 是否展示绝密内参
+// @Description 获取是否展示绝密内参接口
+// @Param	request	body models.IsShow true "type json string"
+// @Success 200
+// @router /isShow [get]
+func (this *ReportController) IsShow() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	var resp models.IsShow
+	IsShowFreeButton, err := services.GetfreeButtonIsShow(user)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,GetfreeButtonIsShow Err:" + err.Error()
+		return
+	}
+	resp.IsShowChart = true
+	//resp.IsShowResearch = true
+	resp.LinkWxExplain = utils.LINK_WX_EXPLAIN
+	resp.ActivitySpecialExplain = utils.ACTIVITY_SPECIAL_EXPLAIN
+	//resp.YanXuan_Explain = true
+	resp.IsShowFreeButton = IsShowFreeButton
+	resp.IsBelongRai = services.GetBelongingRai(user.Mobile)
+	//resp.IsShowQuestionnaire = services.GetQuestionnaireButtonIsShow() // 获取研选问卷调查按钮是否展示
+	resp.IsShowResearchPoints = true
+	if utils.RunMode == "release" { //是否展示关于我们的视频,测试环境审核做隐藏
+		resp.IsShowAboutVideo = true
+	}
+	resp.IsShowList = true
+	resp.SearchTxtList.SummarySearch = "全局搜索"
+	resp.SearchTxtList.ReportSearch = "全局搜索"
+	resp.SearchTxtList.YanXuanSearch = "全局搜索"
+	resp.SearchTxtList.ActivitySearch = "全局搜索"
+	resp.SearchTxtList.TabSearch = "请输入关键词"
+	resp.IsShow = true
+	br.Ret = 200
+	br.Success = true
+	br.Data = resp
+}

+ 43 - 7
controllers/tag.go

@@ -1,8 +1,8 @@
 package controllers
 
 import (
+	"encoding/json"
 	"hongze/hongze_mfyx/models"
-	"hongze/hongze_mfyx/utils"
 )
 
 type TagController struct {
@@ -26,13 +26,49 @@ func (this *TagController) ListLabel() {
 		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}
-	list3 := []string{utils.LABEL_L3_1, utils.LABEL_L3_2, utils.LABEL_L3_3}
+	//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)
-	resp.List1 = list1
-	resp.List2 = list2
-	resp.List3 = list3
+	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 = "获取成功"

+ 6 - 1
models/cygx_tag.go

@@ -69,8 +69,13 @@ type CygxTagIdReq struct {
 	TagId int `description:"TagId"`
 }
 
+type CygxHashtagReq struct {
+	Hashtag   string   `description:"主题标签"`
+	CheckList []string // ABCD勾选了哪几列
+}
+
 type CygxTagListLabelResp struct {
 	List1 []string
 	List2 []string
-	List3 []string
+	List3 []*CygxHashtagReq
 }

+ 1 - 1
routers/router.go

@@ -67,8 +67,8 @@ func init() {
 
 		web.NSNamespace("/activity",
 			web.NSInclude(
+				&controllers.ActivityCoAntroller{},
 				&controllers.ActivityABaseController{},
-				&controllers.ActivityNoLoginController{},
 			),
 		),
 		web.NSNamespace("/industry",