|
@@ -6,6 +6,7 @@ import (
|
|
|
"eta/eta_mini_ht_api/common/exception"
|
|
|
"eta/eta_mini_ht_api/common/utils/date"
|
|
|
"eta/eta_mini_ht_api/common/utils/page"
|
|
|
+ mediaService "eta/eta_mini_ht_api/domian/media"
|
|
|
reportService "eta/eta_mini_ht_api/domian/report"
|
|
|
userService "eta/eta_mini_ht_api/domian/user"
|
|
|
"sync"
|
|
@@ -294,6 +295,11 @@ func assemblePermissionNode(list []reportService.PermissionDTO, node *Permission
|
|
|
}
|
|
|
}
|
|
|
func convertToHotRankedReport(dto reportService.ReportDTO) (report HotRankedReport) {
|
|
|
+ src, err := mediaService.GetImageSrc(dto.CoverSrc)
|
|
|
+ if err != nil {
|
|
|
+ logger.Error("获取封面图片失败:%v", err)
|
|
|
+ src = ""
|
|
|
+ }
|
|
|
report = HotRankedReport{
|
|
|
Id: dto.ReportID,
|
|
|
OrgId: dto.OrgId,
|
|
@@ -303,13 +309,18 @@ func convertToHotRankedReport(dto reportService.ReportDTO) (report HotRankedRepo
|
|
|
SecondPermissions: dto.SecondPermission,
|
|
|
Permissions: dto.Permissions,
|
|
|
PermissionNames: dto.PermissionNames,
|
|
|
- CoverSrc: dto.CoverSrc,
|
|
|
+ CoverSrc: src,
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
func convertToPublishRankedReportList(dtoList []reportService.ReportDTO) (reports []PublishRankedReport) {
|
|
|
reports = []PublishRankedReport{}
|
|
|
for _, dto := range dtoList {
|
|
|
+ src, err := mediaService.GetImageSrc(dto.CoverSrc)
|
|
|
+ if err != nil {
|
|
|
+ logger.Error("获取封面图片失败:%v", err)
|
|
|
+ src = ""
|
|
|
+ }
|
|
|
report := PublishRankedReport{
|
|
|
Id: dto.ReportID,
|
|
|
OrgId: dto.OrgId,
|
|
@@ -317,7 +328,7 @@ func convertToPublishRankedReportList(dtoList []reportService.ReportDTO) (report
|
|
|
Abstract: dto.Abstract,
|
|
|
Title: dto.Title,
|
|
|
PermissionNames: dto.PermissionNames,
|
|
|
- CoverSrc: dto.CoverSrc,
|
|
|
+ CoverSrc: src,
|
|
|
}
|
|
|
reports = append(reports, report)
|
|
|
}
|