|
@@ -6,7 +6,7 @@ import (
|
|
|
"eta/eta_mini_ht_api/common/exception"
|
|
|
"eta/eta_mini_ht_api/common/utils/page"
|
|
|
"eta/eta_mini_ht_api/controllers"
|
|
|
- reportService "eta/eta_mini_ht_api/domian/report"
|
|
|
+ reportDomian "eta/eta_mini_ht_api/domian/report"
|
|
|
"eta/eta_mini_ht_api/service/report"
|
|
|
"eta/eta_mini_ht_api/service/user"
|
|
|
)
|
|
@@ -46,7 +46,7 @@ func (r *ReportController) Search(key string) {
|
|
|
}
|
|
|
if len(reportIds) == 0 {
|
|
|
reports := new(page.PageResult)
|
|
|
- reports.Data = []reportService.ReportDTO{}
|
|
|
+ reports.Data = []reportDomian.ReportDTO{}
|
|
|
reports.Page = pageRes
|
|
|
logger.Info("没有可以查询的报告列表")
|
|
|
r.SuccessResult("分页搜索报告列表成功", reports, result)
|
|
@@ -62,7 +62,7 @@ func (r *ReportController) Search(key string) {
|
|
|
pageRes.Total = r.PageInfo.Total
|
|
|
}
|
|
|
pageRes.TotalPage = page.TotalPages(pageRes.Total, pageRes.PageSize)
|
|
|
- list := make([]reportService.ReportDTO, 0)
|
|
|
+ list := make([]reportDomian.ReportDTO, 0)
|
|
|
if pageRes.LatestId > 0 {
|
|
|
list, err = report.SearchReportList(key, reportIds, r.PageInfo, isLogin(detailType), userInfo.Id, mappingRiskLevel, userRiskStatus)
|
|
|
if err != nil {
|
|
@@ -105,7 +105,7 @@ func (r *ReportController) List(permissionIds string) {
|
|
|
pageRes.Total, pageRes.LatestId, reportOrgIds, discardIds, mappingRiskLevel, UserRiskStatus = report.GetTotalPageCountByPermissionIds(permissionIdList, isLogin(detailType), userInfo.Id)
|
|
|
if pageRes.Total == 0 {
|
|
|
reports := new(page.PageResult)
|
|
|
- reports.Data = []reportService.ReportDTO{}
|
|
|
+ reports.Data = []reportDomian.ReportDTO{}
|
|
|
reports.Page = pageRes
|
|
|
r.SuccessResult("查询报告列表成功", reports, result)
|
|
|
}
|
|
@@ -119,7 +119,7 @@ func (r *ReportController) List(permissionIds string) {
|
|
|
if len(reportOrgIds) == 0 {
|
|
|
logger.Info("没有搜索到相关品种的报告,返回空列表")
|
|
|
reports := new(page.PageResult)
|
|
|
- reports.Data = []reportService.ReportDTO{}
|
|
|
+ reports.Data = []reportDomian.ReportDTO{}
|
|
|
reports.Page = pageRes
|
|
|
r.SuccessResult("查询报告列表成功", reports, result)
|
|
|
return
|
|
@@ -358,7 +358,7 @@ func (r *ReportController) Count() {
|
|
|
// @Description 获取研报详情
|
|
|
// @Success 200 {object}
|
|
|
// @router /report [get]
|
|
|
-func (r *ReportController) GetReport(reportId int) {
|
|
|
+func (r *ReportController) GetReport(reportId int, productId int) {
|
|
|
controllers.Wrap(&r.BaseController, func() (result *controllers.WrapData, err error) {
|
|
|
result = r.InitWrapData("获取研报详情失败")
|
|
|
userInfo := r.Data["user"].(user.User)
|
|
@@ -366,12 +366,21 @@ func (r *ReportController) GetReport(reportId int) {
|
|
|
if !isLogin(detailType) {
|
|
|
logger.Info("当前用户未登录,展示部分详情")
|
|
|
}
|
|
|
+ var subscribeStatus string
|
|
|
+ if productId > 0 {
|
|
|
+ go func() {
|
|
|
+ subscribeStatus = user.GetUserScribeStatus(productId, userInfo.Id)
|
|
|
+ }()
|
|
|
+ } else {
|
|
|
+ subscribeStatus = user.UnSubscribe
|
|
|
+ }
|
|
|
reportDetail, err := report.GetReportById(reportId, isLogin(detailType), userInfo.Id)
|
|
|
if err != nil {
|
|
|
r.FailedResult("获取研报详情失败", result)
|
|
|
err = exception.New(exception.GetReportFailed)
|
|
|
return
|
|
|
}
|
|
|
+ reportDetail.SubscribeStatus = subscribeStatus
|
|
|
r.SuccessResult("获取研报详情成功", reportDetail, result)
|
|
|
return
|
|
|
})
|