|
@@ -95,7 +95,7 @@ func GetGetReportById(reportId int) (ReportDTO ReportDTO, err error) {
|
|
|
report.Author = strings.Join(names, ",")
|
|
|
}
|
|
|
//report.PublishedTime = report.PublishedTime
|
|
|
- ReportDTO = convertReportDTO(report)
|
|
|
+ ReportDTO = convertReportDTO(report, true)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -173,7 +173,7 @@ func GetReportPageByAnalyst(pageInfo page.PageInfo, analyst string) (list []Repo
|
|
|
list = make([]ReportDTO, 0)
|
|
|
if reports != nil {
|
|
|
for _, report := range reports {
|
|
|
- dto := convertReportDTO(report)
|
|
|
+ dto := convertReportDTO(report, false)
|
|
|
list = append(list, dto)
|
|
|
}
|
|
|
}
|
|
@@ -189,7 +189,7 @@ func GetReportPageByOrgIds(pageInfo page.PageInfo, orgIds map[string][]int) (lis
|
|
|
list = make([]ReportDTO, 0)
|
|
|
if reports != nil {
|
|
|
for _, report := range reports {
|
|
|
- dto := convertReportDTO(report)
|
|
|
+ dto := convertReportDTO(report, false)
|
|
|
list = append(list, dto)
|
|
|
}
|
|
|
}
|
|
@@ -200,7 +200,7 @@ func GetNewReportByPublishTime(time time.Time) (reports []ReportDTO) {
|
|
|
list := reportDao.GetNewReportByPublishTime(time)
|
|
|
if list != nil {
|
|
|
for _, report := range list {
|
|
|
- dto := convertReportDTO(report)
|
|
|
+ dto := convertReportDTO(report, false)
|
|
|
reports = append(reports, dto)
|
|
|
}
|
|
|
}
|
|
@@ -216,7 +216,7 @@ func GetReportPage(pageInfo page.PageInfo) (list []ReportDTO, err error) {
|
|
|
list = make([]ReportDTO, 0)
|
|
|
if reports != nil {
|
|
|
for _, report := range reports {
|
|
|
- dto := convertReportDTO(report)
|
|
|
+ dto := convertReportDTO(report, false)
|
|
|
list = append(list, dto)
|
|
|
}
|
|
|
}
|
|
@@ -532,7 +532,7 @@ func GetListOrderByConditionWeekly(week bool, column string, limit int, order mo
|
|
|
return
|
|
|
}
|
|
|
for _, reportItem := range reports {
|
|
|
- dto := convertReportDTO(reportItem)
|
|
|
+ dto := convertReportDTO(reportItem, false)
|
|
|
dtoList = append(dtoList, dto)
|
|
|
}
|
|
|
return
|
|
@@ -549,7 +549,7 @@ func GetListByCondition[T any](column string, ids []T) (dtoList []ReportDTO, err
|
|
|
return
|
|
|
}
|
|
|
for _, reportItem := range reports {
|
|
|
- dto := convertReportDTO(reportItem)
|
|
|
+ dto := convertReportDTO(reportItem, false)
|
|
|
dtoList = append(dtoList, dto)
|
|
|
}
|
|
|
return
|
|
@@ -622,7 +622,7 @@ func convertEsReport(report reportDao.Report) ESReport {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func convertReportDTO(report reportDao.Report) (reportDTO ReportDTO) {
|
|
|
+func convertReportDTO(report reportDao.Report, fullTime bool) (reportDTO ReportDTO) {
|
|
|
reportDTO = ReportDTO{
|
|
|
ReportID: report.ID,
|
|
|
Title: report.Title,
|
|
@@ -634,7 +634,7 @@ func convertReportDTO(report reportDao.Report) (reportDTO ReportDTO) {
|
|
|
PublishedTime: report.PublishedTime,
|
|
|
}
|
|
|
publishDate, err := time.Parse(time.DateTime, reportDTO.PublishedTime)
|
|
|
- if err == nil {
|
|
|
+ if err == nil && fullTime {
|
|
|
reportDTO.PublishedTime = publishDate.Format(time.DateOnly)
|
|
|
}
|
|
|
return
|