package controllers import ( "hongze/hongze_api/models" "html" ) //报告分享 type ReportShareController struct { BaseCommonController } // @Title 日评详情 // @Description 日评详情接口 // @Param ReportCode query string true "报告唯一编码" // @Success 200 {object} models.ReportShareDetailResp // @router /share/detail [get] func (this *ReportShareController) Detail() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() reportCode:= this.GetString("ReportCode") if reportCode =="" { br.Msg = "参数错误" br.ErrMsg = "参数错误,reportCode 为空" return } report, err := models.GetReportByCode(reportCode) if err != nil { br.Msg = "获取报告详情失败" br.ErrMsg = "获取报告详情失败,Err:" + err.Error() return } report.ContentSub = html.UnescapeString(report.ContentSub) report.Content = html.UnescapeString(report.Content) resp := new(models.ReportShareDetailResp) resp.Report = report br.Ret = 200 br.Success = true br.Msg = "获取成功" br.Data = resp }