|
@@ -2,6 +2,7 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"eta/eta_mini_api/models"
|
|
|
+ "eta/eta_mini_api/models/response"
|
|
|
"eta/eta_mini_api/services"
|
|
|
"eta/eta_mini_api/utils"
|
|
|
)
|
|
@@ -165,8 +166,37 @@ func (this *ReportController) Search() {
|
|
|
br.ErrMsg = "研报列表查询失败,系统异常,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- br.Data = reports.Data
|
|
|
+ if reports.Ret != 200 {
|
|
|
+ br.Msg = reports.Msg
|
|
|
+ br.ErrMsg = reports.ErrMsg
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(response.ReportSearchViewResp)
|
|
|
+ list := make([]*response.ReportSearchListView, 0)
|
|
|
+ for _, v := range reports.Data.List {
|
|
|
+ tmpReport := &response.ReportSearchListView{
|
|
|
+ ReportId: v.ReportId,
|
|
|
+ ReportChapterId: v.ReportChapterId,
|
|
|
+ ClassifyIdFirst: v.ClassifyIdFirst,
|
|
|
+ ClassifyNameFirst: v.ClassifyNameFirst,
|
|
|
+ ClassifyIdSecond: v.ClassifyIdSecond,
|
|
|
+ ClassifyNameSecond: v.ClassifyNameSecond,
|
|
|
+ ReportChapterTypeId: v.ReportChapterTypeId,
|
|
|
+ PublishTime: v.PublishTime.Format(utils.FormatDate),
|
|
|
+ Title: v.Title,
|
|
|
+ ContentSub: v.ContentSub,
|
|
|
+ Abstract: v.Abstract,
|
|
|
+ Stage: v.Stage,
|
|
|
+ Author: v.Author,
|
|
|
+ }
|
|
|
+ if v.PublishTime.IsZero() {
|
|
|
+ tmpReport.PublishTime = ""
|
|
|
+ }
|
|
|
+ list = append(list, tmpReport)
|
|
|
+ }
|
|
|
+ resp.List = list
|
|
|
+ resp.Paging = reports.Data.Paging
|
|
|
+ br.Data = resp
|
|
|
br.Msg = "查询成功"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|