Browse Source

图表来源

hsun 2 years ago
parent
commit
6529bd8a3b

+ 2 - 3
controller/chart/chart_info.go

@@ -163,7 +163,6 @@ func GetChartInfoDetail(c *gin.Context)  {
 	}
 
 	// 指标列表
-	chartSource := ""
 	sourceArr := make([]string, 0)
 	edbList := make([]*chartEdbMappingModel.ChartEdbInfoMappingList, 0)
 	for _, v := range mappingList {
@@ -335,7 +334,8 @@ func GetChartInfoDetail(c *gin.Context)  {
 		}
 		edbList = append(edbList, item)
 	}
-	chartSource = strings.Join(sourceArr, ",")
+	sourceArr = append(sourceArr, "弘则研究")
+	chartInfo.ChartSource = strings.Join(sourceArr, ",")
 
 	// 访问记录-仅普通用户记录
 	userInfo := user.GetInfoByClaims(c)
@@ -349,7 +349,6 @@ func GetChartInfoDetail(c *gin.Context)  {
 	resp := new(chart_info.ChartInfoDetailResp)
 	resp.ChartInfo = chartInfo
 	resp.EdbInfoList = edbList
-	resp.ChartSource = chartSource
 	response.OkData("获取成功", resp, c)
 }
 

+ 0 - 1
models/response/chart_info/chart_info.go

@@ -8,5 +8,4 @@ import (
 type ChartInfoDetailResp struct {
 	ChartInfo   *chart_info.ChartInfoView
 	EdbInfoList []*chart_edb_mapping.ChartEdbInfoMappingList
-	ChartSource string
 }

+ 12 - 11
models/tables/chart_info/query.go

@@ -34,6 +34,7 @@ type ChartInfoView struct {
 	LeftMax           string `description:"图表左侧最大值"`
 	RightMin          string `description:"图表右侧最小值"`
 	RightMax          string `description:"图表右侧最大值"`
+	ChartSource       string `description:"图表来源str"`
 	//ChartClassify     []*chart_classify.ChartClassifyView
 }
 
@@ -67,23 +68,23 @@ type ChartSaveItem struct {
 }
 
 type ChartSortInfo struct {
-	ChartInfoId			int		`description:"图表ID"`
-	MyChartId			int		`description:"我的图表ID"`
-	MyChartClassifyId	int		`description:"我的图表分类ID"`
-	MyChartClassifyName	string	`description:"我的图表分类名称"`
-	UniqueCode			string	`description:"图表唯一编码"`
-	Sort				int		`description:"排序"`
-	Switch				int		`description:"是否切换 0-未切换 1-已切换"`
+	ChartInfoId         int    `description:"图表ID"`
+	MyChartId           int    `description:"我的图表ID"`
+	MyChartClassifyId   int    `description:"我的图表分类ID"`
+	MyChartClassifyName string `description:"我的图表分类名称"`
+	UniqueCode          string `description:"图表唯一编码"`
+	Sort                int    `description:"排序"`
+	Switch              int    `description:"是否切换 0-未切换 1-已切换"`
 	//SwitchTips			string	`description:"切换分类提示信息"`
 }
 
 type ChartBeforeNext struct {
-	PrevChart	ChartSortInfo
-	NextChart	ChartSortInfo
+	PrevChart ChartSortInfo
+	NextChart ChartSortInfo
 }
 
 type RefreshChartInfoReq struct {
-	ChartInfoId	int
+	ChartInfoId int
 }
 
 // GetChartInfoViewById 通过Id获取图表展示信息
@@ -98,4 +99,4 @@ func GetChartInfoViewById(chartInfoId int) (item *ChartInfoView, err error) {
 func GetChartInfoById(chartInfoId int) (item *ChartInfo, err error) {
 	err = global.MYSQL["data"].Model(ChartInfo{}).Where("chart_info_id = ?", chartInfoId).First(&item).Error
 	return
-}
+}