|
@@ -11,6 +11,7 @@ import (
|
|
|
"hongze/hongze_yb/services/company"
|
|
|
"hongze/hongze_yb/services/user"
|
|
|
"hongze/hongze_yb/utils"
|
|
|
+ "sort"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
@@ -265,7 +266,7 @@ func GetClassifySecondSimpleList(user user.UserInfo, classifyIdFirst int) (list
|
|
|
|
|
|
|
|
|
// GetClassifyFirstList 获取一级分类列表
|
|
|
-func GetClassifyFirstList(user user.UserInfo) (list []*response.ClassifyFirstListItem, err error) {
|
|
|
+func GetClassifyFirstList(user user.UserInfo) (list response.ClassifyFirstList, err error) {
|
|
|
var errMsg string
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -293,12 +294,50 @@ func GetClassifyFirstList(user user.UserInfo) (list []*response.ClassifyFirstLis
|
|
|
classifyMap["碳市场价格周报"] = true
|
|
|
classifyMap["海外视角"] = true
|
|
|
classifyMap["百家谈"] = true
|
|
|
+
|
|
|
+ classifyIconMap := map[string]string{
|
|
|
+ "晨报": utils.ALIYUN_YBIMG_HOST + "purchase_icon_day.png",
|
|
|
+ "周报": utils.ALIYUN_YBIMG_HOST + "purchase_icon_week.png",
|
|
|
+ "双周报": utils.ALIYUN_YBIMG_HOST + "purchase_icon_two_week.png",
|
|
|
+ "月报": utils.ALIYUN_YBIMG_HOST + "purchase_icon_month.png",
|
|
|
+ "草根调研": utils.ALIYUN_YBIMG_HOST + "purchase_icon_grassroots.png",
|
|
|
+ "需求报告": utils.ALIYUN_YBIMG_HOST + "purchase_icon_need_report.png",
|
|
|
+ "宏观报告": utils.ALIYUN_YBIMG_HOST + "purchase_icon_hongguan.png",
|
|
|
+ "日度点评": utils.ALIYUN_YBIMG_HOST + "purchase_icon_daily_comment.png",
|
|
|
+ "数据点评": utils.ALIYUN_YBIMG_HOST + "purchase_icon_data_comment.png",
|
|
|
+ "碳市场价格周报": utils.ALIYUN_YBIMG_HOST + "purchase_icon_carbon.png",
|
|
|
+ "行业调研": utils.ALIYUN_YBIMG_HOST + "purchase_icon_hy_research.png",
|
|
|
+ "海外视角": utils.ALIYUN_YBIMG_HOST + "purchase_icon_overseas.png",
|
|
|
+ "百家谈": utils.ALIYUN_YBIMG_HOST + "purchase_icon_family.png",
|
|
|
+ "会议纪要": utils.ALIYUN_YBIMG_HOST + "purchase_bg_big_comment.png",
|
|
|
+ "大事点评": utils.ALIYUN_YBIMG_HOST + "purchase_icon_big_thing.png",
|
|
|
+ "年报合集": utils.ALIYUN_YBIMG_HOST + "purchase_bg_big_comment.png",
|
|
|
+ }
|
|
|
+
|
|
|
+ classifySortMap := map[string]int{
|
|
|
+ "晨报": 1,
|
|
|
+ "周报": 2,
|
|
|
+ "双周报": 3,
|
|
|
+ "月报": 4,
|
|
|
+ "草根调研": 5,
|
|
|
+ "需求报告": 6,
|
|
|
+ "宏观报告": 7,
|
|
|
+ "日度点评": 8,
|
|
|
+ "数据点评": 9,
|
|
|
+ "碳市场价格周报": 10,
|
|
|
+ "行业调研": 11,
|
|
|
+ "海外视角": 12,
|
|
|
+ "百家谈": 13,
|
|
|
+ "会议纪要": 14,
|
|
|
+ "大事点评": 15,
|
|
|
+ "年报合集": 16,
|
|
|
+ }
|
|
|
for _, item := range classifyParents {
|
|
|
temp := new(response.ClassifyFirstListItem)
|
|
|
temp.ClassifyIdFirst = item.Id
|
|
|
temp.ClassifyNameFirst = item.ClassifyName
|
|
|
- // TODO ficc菜单图标
|
|
|
- temp.IconImgUrl = ""
|
|
|
+ temp.IconImgUrl = classifyIconMap[item.ClassifyName]
|
|
|
+ temp.Sort = classifySortMap[item.ClassifyName]
|
|
|
if _, ok := classifyMap[item.ClassifyName]; ok {
|
|
|
if item.ClassifyName == "需求报告" || item.ClassifyName == "宏观报告" {
|
|
|
classifySecond, tErr := classify.GetFirstByPid(item.Id)
|
|
@@ -313,9 +352,11 @@ func GetClassifyFirstList(user user.UserInfo) (list []*response.ClassifyFirstLis
|
|
|
}else{
|
|
|
temp.RedirectType = 2
|
|
|
}
|
|
|
-
|
|
|
list = append(list, temp)
|
|
|
}
|
|
|
+ if len(list) > 0 {
|
|
|
+ sort.Sort(list)
|
|
|
+ }
|
|
|
|
|
|
return
|
|
|
}
|