|
@@ -779,3 +779,61 @@ func (this *MicroRoadShowController) Mycollect() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+// @Title 模版消息留言详情
|
|
|
+// @Description 模版消息留言详情接口
|
|
|
+// @Param SourceId query int true "资源ID"
|
|
|
+// @Param SourceType query int true "留言类型,1:文章、2:活动、3:微路演视频、4:活动视频、5:活动音频"
|
|
|
+// @Success Ret=200 {object} models.CygxArticleCommentWxResp
|
|
|
+// @router /comment/detail [get]
|
|
|
+func (this *MicroRoadShowController) CommentDetail() {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ sourceId, _ := this.GetInt("SourceId")
|
|
|
+ sourceType, _ := this.GetInt("SourceType")
|
|
|
+ resp := new(models.CygxArticleCommentWxResp)
|
|
|
+ if sourceType == 1 || sourceType == 3 || sourceType == 4 || sourceType == 5 {
|
|
|
+ detail, err := models.GetArticleCommentById(sourceId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取用户权限失败, Err: " + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.Content = detail.Content
|
|
|
+ if sourceType == 1 {
|
|
|
+ resp.SourceId = detail.ArticleId
|
|
|
+ resp.RedirectType = 1
|
|
|
+ } else if sourceType == 3 {
|
|
|
+ resp.SourceId = detail.IndustryId
|
|
|
+ resp.RedirectType = 3
|
|
|
+ } else {
|
|
|
+ resp.SourceId = detail.ActivityId
|
|
|
+ resp.RedirectType = 2
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ detail, err := models.GetCygxActivityHelpAskById(sourceId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取用户权限失败, Err: " + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.Content = detail.Content
|
|
|
+ resp.SourceId = detail.ActivityId
|
|
|
+ resp.RedirectType = 2
|
|
|
+ }
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Data = resp
|
|
|
+ br.Msg = "操作成功"
|
|
|
+ return
|
|
|
+}
|