|
@@ -308,6 +308,58 @@ func (this *ReportController) Detail() {
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
|
|
|
+// @Title 研报详情
|
|
|
+// @Description 研报详情接口
|
|
|
+// @Param ReportId query int true "报告id"
|
|
|
+// @Success 200 {object} models.ReportDetailResp
|
|
|
+// @router /detail/noUser [get]
|
|
|
+func (this *ReportController) DetailNoUser() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ reportId, err := this.GetInt("ReportId")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数获取失败"
|
|
|
+ br.ErrMsg = "参数获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if reportId <= 0 {
|
|
|
+ br.Msg = "参数错误"
|
|
|
+ br.ErrMsg = "参数错误,报告id小于等于0"
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ report, err := models.GetReportById(reportId)
|
|
|
+ if err != nil {
|
|
|
+ if err.Error() == utils.ErrNoRow() {
|
|
|
+ br.Ret = 200
|
|
|
+ br.Data = new(response.ReportDetailResp)
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "该报告已删除或不存在"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "该报告已删除"
|
|
|
+ br.ErrMsg = "获取报告详情失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ report.ContentSub = html.UnescapeString(report.ContentSub)
|
|
|
+ report.Content = ""
|
|
|
+ if report == nil {
|
|
|
+ br.Msg = "报告不存在"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(response.ReportDetailResp)
|
|
|
+ resp.Report = report
|
|
|
+ resp.Status = utils.ReportPermissionStatusNoUser
|
|
|
+
|
|
|
+ br.Data = resp
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+}
|
|
|
+
|
|
|
// @Title List
|
|
|
// @Description create users
|
|
|
// @Param body body models.User true "body for user content"
|