123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- package logic
- import (
- "fmt"
- "hongze/hongze_yb/models/tables/rddp/chart_permission"
- "hongze/hongze_yb/utils"
- )
- type ApplyVariety struct {
- PermissionName string `json:"permission_name" description:"权限名称"`
- Name string `json:"name" description:"品种名称"`
- PicUrl string `json:"pic_url" description:"品种图片"`
- }
- func GetApplyVarietyList() (list []ApplyVariety, err error) {
-
- permissionImgMap := make(map[string]string, 0)
- permissionImgMap["宏观经济"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/宏观经济.png"
- permissionImgMap["资产配置"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/资产配置.png"
- permissionImgMap["贵金属"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/贵金属.png"
- permissionImgMap["汇率"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/汇率.png"
- permissionImgMap["利率债"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/利率债.png"
- permissionImgMap["原油"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/原油.png"
- permissionImgMap["成品油"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/成品油.png"
- permissionImgMap["LPG"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/LPG.png"
- permissionImgMap["PTA"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/PTA.png"
- permissionImgMap["MEG"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/MEG.png"
- permissionImgMap["纺服"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/纺服.png"
- permissionImgMap["甲醇"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/甲醇.png"
- permissionImgMap["聚烯烃"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/聚烯烃.png"
- permissionImgMap["尿素"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/尿素.png"
- permissionImgMap["沥青"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/沥青.png"
- permissionImgMap["苯乙烯"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/苯乙烯.png"
- permissionImgMap["PVC"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/PVC.png"
- permissionImgMap["聚酯"] = "https://hzstatic.hzinsights.com/static/yb_variety/聚酯.png"
- permissionImgMap["钢材"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/钢材.png"
- permissionImgMap["铁矿"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/铁矿.png"
- permissionImgMap["玻璃纯碱"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/玻璃纯碱.png"
- permissionImgMap["烧碱"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/烧碱.png"
- permissionImgMap["双焦"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/双焦.png"
- permissionImgMap["铜"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/铜.png"
- permissionImgMap["铝"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/铝.png"
- permissionImgMap["镍/不锈钢"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/镍不锈钢.png"
- permissionImgMap["锌"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/锌.png"
- permissionImgMap["钴锂"] = "https://hzstatic.hzinsights.com/static/yb_variety/钴锂.png"
- permissionImgMap["碳酸锂"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/碳酸锂.png"
- permissionImgMap["工业硅"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/工业硅.png"
- permissionImgMap["策略"] = "https://hzstatic.hzinsights.com/static/yb_variety/v2/策略.png"
- allFiccPermissions, e := chart_permission.GetListByProductIdAndPermissionType(1)
- if e != nil {
- err = fmt.Errorf("获取品种权限失败 Err:%s", e.Error())
- return
- }
- for _, v := range allFiccPermissions {
- if v.ParentId > 0 {
- tmp := ApplyVariety{PermissionName: v.PermissionName, Name: v.PermissionName, PicUrl: utils.APPLY_VARIETY_IMG_DEFAULT}
- img, ok := permissionImgMap[v.PermissionName]
- if ok {
- tmp.PicUrl = img
- }
- list = append(list, tmp)
- }
- }
-
-
-
-
- return
- }
|