|
@@ -4,6 +4,7 @@ import (
|
|
"eta/eta_mini_ht_api/common/component/cache"
|
|
"eta/eta_mini_ht_api/common/component/cache"
|
|
"eta/eta_mini_ht_api/common/exception"
|
|
"eta/eta_mini_ht_api/common/exception"
|
|
"eta/eta_mini_ht_api/controllers"
|
|
"eta/eta_mini_ht_api/controllers"
|
|
|
|
+ chartService "eta/eta_mini_ht_api/service/media"
|
|
"eta/eta_mini_ht_api/service/user"
|
|
"eta/eta_mini_ht_api/service/user"
|
|
userService "eta/eta_mini_ht_api/service/user"
|
|
userService "eta/eta_mini_ht_api/service/user"
|
|
)
|
|
)
|
|
@@ -14,6 +15,11 @@ type BookMarkController struct {
|
|
redis *cache.RedisCache
|
|
redis *cache.RedisCache
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const (
|
|
|
|
+ Chart = "chart"
|
|
|
|
+ Report = "report"
|
|
|
|
+)
|
|
|
|
+
|
|
func (u *BookMarkController) Prepare() {
|
|
func (u *BookMarkController) Prepare() {
|
|
u.redis = cache.GetInstance()
|
|
u.redis = cache.GetInstance()
|
|
}
|
|
}
|
|
@@ -24,6 +30,7 @@ type BookMarkReq struct {
|
|
ChartImage string `json:"chartImage"`
|
|
ChartImage string `json:"chartImage"`
|
|
ChartInfoId int `json:"chartInfoId"`
|
|
ChartInfoId int `json:"chartInfoId"`
|
|
ChartName string `json:"chartName"`
|
|
ChartName string `json:"chartName"`
|
|
|
|
+ UniqueCode string `json:"uniqueCode"`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -54,6 +61,15 @@ func (u *BookMarkController) BookMark() {
|
|
u.FailedResult("收藏失败", result)
|
|
u.FailedResult("收藏失败", result)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if bookMark.SourceType == Chart {
|
|
|
|
+ chartService.AddChartToEs(chartService.ChartInfo{
|
|
|
|
+ ChartImage: bookMark.ChartImage,
|
|
|
|
+ ChartInfoId: bookMark.ChartInfoId,
|
|
|
|
+ ChartName: bookMark.ChartName,
|
|
|
|
+ UniqueCode: bookMark.UniqueCode,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
u.SuccessResult("收藏成功", nil, result)
|
|
u.SuccessResult("收藏成功", nil, result)
|
|
return
|
|
return
|
|
})
|
|
})
|