|
@@ -16,6 +16,7 @@ import (
|
|
future_goodServ "eta/eta_chart_lib/services/data/future_good"
|
|
future_goodServ "eta/eta_chart_lib/services/data/future_good"
|
|
"eta/eta_chart_lib/services/data/line_equation"
|
|
"eta/eta_chart_lib/services/data/line_equation"
|
|
lineFeatureServ "eta/eta_chart_lib/services/data/line_feature"
|
|
lineFeatureServ "eta/eta_chart_lib/services/data/line_feature"
|
|
|
|
+ dwmini "eta/eta_chart_lib/services/dw_mini"
|
|
"eta/eta_chart_lib/utils"
|
|
"eta/eta_chart_lib/utils"
|
|
"fmt"
|
|
"fmt"
|
|
"strconv"
|
|
"strconv"
|
|
@@ -28,6 +29,8 @@ import (
|
|
// @Description 根据编码获取图表详情接口
|
|
// @Description 根据编码获取图表详情接口
|
|
// @Param UniqueCode query int true "图表唯一编码,如果是管理后台访问,传固定字符串:7c69b590249049942070ae9dcd5bf6dc"
|
|
// @Param UniqueCode query int true "图表唯一编码,如果是管理后台访问,传固定字符串:7c69b590249049942070ae9dcd5bf6dc"
|
|
// @Param IsCache query bool true "是否走缓存,默认false"
|
|
// @Param IsCache query bool true "是否走缓存,默认false"
|
|
|
|
+// @Param Token query string true "东吴小程序token"
|
|
|
|
+// @Param Source query int true "查询来源 1:东吴"
|
|
// @Success 200 {object} data_manage.ChartInfoDetailFromUniqueCodeResp
|
|
// @Success 200 {object} data_manage.ChartInfoDetailFromUniqueCodeResp
|
|
// @router /common/detail [get]
|
|
// @router /common/detail [get]
|
|
func (this *ChartController) CommonChartInfoDetailFromUniqueCode() {
|
|
func (this *ChartController) CommonChartInfoDetailFromUniqueCode() {
|
|
@@ -38,6 +41,8 @@ func (this *ChartController) CommonChartInfoDetailFromUniqueCode() {
|
|
}()
|
|
}()
|
|
|
|
|
|
uniqueCode := this.GetString("UniqueCode")
|
|
uniqueCode := this.GetString("UniqueCode")
|
|
|
|
+ token := this.GetString("Token")
|
|
|
|
+ source, _ := this.GetInt("Source")
|
|
if uniqueCode == "" {
|
|
if uniqueCode == "" {
|
|
br.Msg = "参数错误"
|
|
br.Msg = "参数错误"
|
|
br.ErrMsg = "参数错误,uniqueCode is empty"
|
|
br.ErrMsg = "参数错误,uniqueCode is empty"
|
|
@@ -53,7 +58,16 @@ func (this *ChartController) CommonChartInfoDetailFromUniqueCode() {
|
|
br.ErrMsg = "获取配置信息失败, Err: " + e.Error()
|
|
br.ErrMsg = "获取配置信息失败, Err: " + e.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ var isCollect bool
|
|
|
|
+ if source == utils.CHART_SOURCE_DW && token != "" {
|
|
|
|
+ tmpIsCollect, err := dwmini.GetMyChartIsCollect(token, uniqueCode)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取失败"
|
|
|
|
+ br.ErrMsg = "获取收藏状态失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ isCollect = tmpIsCollect
|
|
|
|
+ }
|
|
//判断是否有缓存
|
|
//判断是否有缓存
|
|
if utils.Re == nil {
|
|
if utils.Re == nil {
|
|
if utils.Re == nil && utils.Rc.IsExist(key) {
|
|
if utils.Re == nil && utils.Rc.IsExist(key) {
|
|
@@ -63,6 +77,9 @@ func (this *ChartController) CommonChartInfoDetailFromUniqueCode() {
|
|
if conf[models.BusinessConfWatermarkChart] == "true" && conf[models.BusinessConfCompanyWatermark] != "" {
|
|
if conf[models.BusinessConfWatermarkChart] == "true" && conf[models.BusinessConfCompanyWatermark] != "" {
|
|
resp.WaterMark = conf[models.BusinessConfCompanyWatermark]
|
|
resp.WaterMark = conf[models.BusinessConfCompanyWatermark]
|
|
}
|
|
}
|
|
|
|
+ if isCollect {
|
|
|
|
+ resp.IsCollect = isCollect
|
|
|
|
+ }
|
|
br.Ret = 200
|
|
br.Ret = 200
|
|
br.Success = true
|
|
br.Success = true
|
|
br.Msg = "获取成功"
|
|
br.Msg = "获取成功"
|
|
@@ -115,6 +132,10 @@ func (this *ChartController) CommonChartInfoDetailFromUniqueCode() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if isCollect {
|
|
|
|
+ resp.IsCollect = isCollect
|
|
|
|
+ }
|
|
|
|
+
|
|
if conf[models.BusinessConfWatermarkChart] == "true" && conf[models.BusinessConfCompanyWatermark] != "" {
|
|
if conf[models.BusinessConfWatermarkChart] == "true" && conf[models.BusinessConfCompanyWatermark] != "" {
|
|
resp.WaterMark = conf[models.BusinessConfCompanyWatermark]
|
|
resp.WaterMark = conf[models.BusinessConfCompanyWatermark]
|
|
}
|
|
}
|