|
@@ -25,7 +25,7 @@ type PublishRankedReport struct {
|
|
|
Abstract string `json:"abstract"`
|
|
|
PermissionNames interface{} `json:"permissionNames,omitempty"`
|
|
|
PublishedTime string `json:"publishedTime"`
|
|
|
- CoverSrc string `json:"coverSrc"`
|
|
|
+ CoverUrl string `json:"coverUrl"`
|
|
|
}
|
|
|
|
|
|
type HotRankedReport struct {
|
|
@@ -38,7 +38,7 @@ type HotRankedReport struct {
|
|
|
SecondPermissions map[int]string `json:"-"`
|
|
|
Permissions map[int]string `json:"-"`
|
|
|
PermissionNames interface{} `json:"permissionNames,omitempty"`
|
|
|
- CoverSrc string `json:"coverSrc"`
|
|
|
+ CoverUrl string `json:"coverUrl"`
|
|
|
}
|
|
|
|
|
|
type PermissionNode struct {
|
|
@@ -116,6 +116,13 @@ func SearchReportList(key string, pageInfo page.PageInfo) (reports []reportServi
|
|
|
go func(report *reportService.ReportDTO) {
|
|
|
defer wg.Done()
|
|
|
report.PermissionNames = getReportPermissionNames(report.OrgId, report.Source)
|
|
|
+ src, err := mediaService.GetImageSrc(report.CoverSrc)
|
|
|
+ if err != nil {
|
|
|
+ logger.Error("获取图片地址失败:%v", err)
|
|
|
+ src = ""
|
|
|
+ } else {
|
|
|
+ report.CoverUrl = src
|
|
|
+ }
|
|
|
}(&reports[i])
|
|
|
}
|
|
|
wg.Wait()
|
|
@@ -309,7 +316,7 @@ func convertToHotRankedReport(dto reportService.ReportDTO) (report HotRankedRepo
|
|
|
SecondPermissions: dto.SecondPermission,
|
|
|
Permissions: dto.Permissions,
|
|
|
PermissionNames: dto.PermissionNames,
|
|
|
- CoverSrc: src,
|
|
|
+ CoverUrl: src,
|
|
|
}
|
|
|
return
|
|
|
}
|
|
@@ -328,7 +335,7 @@ func convertToPublishRankedReportList(dtoList []reportService.ReportDTO) (report
|
|
|
Abstract: dto.Abstract,
|
|
|
Title: dto.Title,
|
|
|
PermissionNames: dto.PermissionNames,
|
|
|
- CoverSrc: src,
|
|
|
+ CoverUrl: src,
|
|
|
}
|
|
|
reports = append(reports, report)
|
|
|
}
|