|
@@ -86,6 +86,29 @@ type ChartCollectView struct {
|
|
|
UniqueCode string `description:"图表唯一编码"`
|
|
|
}
|
|
|
|
|
|
+type ChartFromUniqueCodeResp struct {
|
|
|
+ Ret int
|
|
|
+ Msg string
|
|
|
+ ErrMsg string
|
|
|
+ ErrCode string
|
|
|
+ Data *ChartFromUniqueCodeRespItem
|
|
|
+ Success bool `description:"true 执行成功,false 执行失败"`
|
|
|
+ IsSendEmail bool `json:"-" description:"true 发送邮件,false 不发送邮件"`
|
|
|
+ IsAddLog bool `json:"-" description:"true 新增操作日志,false 不新增操作日志" `
|
|
|
+}
|
|
|
+
|
|
|
+type ChartFromUniqueCodeRespItem struct {
|
|
|
+ ChartInfo *data_manage.ChartInfoView
|
|
|
+ EdbInfoList []*data_manage.ChartEdbInfoMapping
|
|
|
+ XEdbIdValue []int `description:"柱方图的x轴数据,指标id"`
|
|
|
+ YDataList []data_manage.YData `description:"柱方图的y轴数据"`
|
|
|
+ XDataList []data_manage.XData `description:"商品价格曲线的X轴数据"`
|
|
|
+ //BarChartInfo BarChartInfoReq `description:"柱方图的配置"`
|
|
|
+ //CorrelationChartInfo *CorrelationInfo `description:"相关性图表信息"`
|
|
|
+ DataResp interface{} `description:"图表数据,根据图的类型而定的,没有确定的数据格式"`
|
|
|
+ WaterMark string `description:"水印"`
|
|
|
+}
|
|
|
+
|
|
|
// GetUserChartList 查询社区中对用户可见的图表列表
|
|
|
func GetUserChartList(businessCode, userMobile, telAreaCode, keyword string) (resp UserChartListRespItem, err error, errMsg string) {
|
|
|
defer func() {
|
|
@@ -166,3 +189,29 @@ func GetUserCollectChartList(businessCode, userMobile, telAreaCode, keyword, col
|
|
|
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GeChartFromUniqueCode 社区中根据唯一编码查询图表
|
|
|
+func GeChartFromUniqueCode(uniqueCode string, isCache bool) (resp ChartFromUniqueCodeRespItem, err error, errMsg string) {
|
|
|
+ defer func() {
|
|
|
+ if err != nil {
|
|
|
+ msg := fmt.Sprintf("查询社区中对用户可见的图表列表 GeChartFromUniqueCode:Err:%v,ErrMsg:%s", err, errMsg)
|
|
|
+ utils.FileLog.Info(msg)
|
|
|
+ go alarm_msg.SendAlarmMsg(msg, 3)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ urlQuery := fmt.Sprintf("UniqueCode=%s&isCache=%v", uniqueCode, isCache)
|
|
|
+ result, err := getChartFromUniqueCodeLib(urlQuery)
|
|
|
+ if err != nil {
|
|
|
+ errMsg = "查询失败"
|
|
|
+ err = fmt.Errorf("查询失败,Err:" + err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if result.Ret != 200 {
|
|
|
+ errMsg = "查询失败"
|
|
|
+ err = fmt.Errorf(result.Msg + result.ErrMsg)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp = *result.Data
|
|
|
+
|
|
|
+ return
|
|
|
+}
|