1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package controllers
- import (
- "hongze/hongze_clpt/models"
- "hongze/hongze_clpt/services"
- )
- type FiccYbController struct {
- BaseAuthController
- }
- // @Title 获取报告详情
- // @Description 获取报告详情接口
- // @Param ReportId query int true "报告ID"
- // @Success 200 {object} models.ArticleDetailResp
- // @router /detail [get]
- func (this *FiccYbController) Detail() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- user := this.User
- if user == nil {
- br.Msg = "请登录"
- br.ErrMsg = "请登录,用户信息为空"
- br.Ret = 408
- return
- }
- //uid := user.UserId
- reportId, err := this.GetInt("ReportId")
- if err != nil {
- br.Msg = "文章不存在"
- br.ErrMsg = "文章不存在,文章ID错误" + err.Error()
- return
- }
- if reportId <= 0 {
- br.Msg = "文章不存在"
- br.ErrMsg = "文章不存在,文章ID错误"
- return
- }
- detail, err := services.GetReportDetail(user, reportId)
- if err != nil {
- br.Msg = "文章不存在"
- br.ErrMsg = "获取研报信息失败" + err.Error()
- return
- }
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- br.Data = detail
- }
|