123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701 |
- package controllers
- import (
- "encoding/json"
- "github.com/rdlucklib/rdluck_tools/paging"
- "hongze/hongze_mfyx/models"
- "hongze/hongze_mfyx/services"
- "hongze/hongze_mfyx/utils"
- "time"
- )
- type YanxuanSpecialMessageController struct {
- BaseAuthController
- }
- // @Title 添加留言
- // @Description 添加留言接口
- // @Param request body models.AddCygxYanxuanSpecialMessageReq true "type json string"
- // @Success Ret=200 {object}
- // @router /message/add [post]
- func (this *YanxuanSpecialMessageController) MessageAdd() {
- 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
- }
- var req models.AddCygxYanxuanSpecialMessageReq
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
- if err != nil {
- br.Msg = "参数解析异常!"
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
- return
- }
- yanxuanSpecialId := req.YanxuanSpecialId
- content := req.Content
- parentId := req.ParentId
- if content == "" {
- br.Msg = "请输入留言内容!"
- return
- }
- if yanxuanSpecialId == 0 {
- br.Msg = "留言失败!"
- br.ErrMsg = "专栏信息不能为空"
- return
- }
- // 研选专栏
- yanxuanSpecialBySpeciaDetail, err := models.GetYanxuanSpecialBySpecialId(yanxuanSpecialId)
- if err != nil {
- br.Msg = "获取信息失败"
- br.ErrMsg = "获取信息失败,Err:" + err.Error()
- return
- }
- item := new(models.CygxYanxuanSpecialMessage)
- item.UserId = user.UserId
- item.Mobile = user.Mobile
- item.Email = user.Email
- item.CompanyId = user.CompanyId
- item.CompanyName = user.CompanyName
- item.RealName = user.RealName
- item.SellerName, _ = services.GetSellerName(user) // 销售姓名
- item.YanxuanSpecialId = yanxuanSpecialId
- item.Content = content
- item.ParentId = parentId
- item.YanxuanSpecialUserId = yanxuanSpecialBySpeciaDetail.UserId
- item.SourceTitle = yanxuanSpecialBySpeciaDetail.Title
- item.CreateTime = time.Now()
- item.ModifyTime = time.Now()
- item.RegisterPlatform = utils.REGISTER_PLATFORM
- messageId, err := models.AddCygxYanxuanSpecialMessage(item)
- if err != nil {
- br.Msg = "留言失败!"
- br.ErrMsg = "留言失败,Err:" + err.Error()
- return
- }
- var msgText string
- if parentId == 0 {
- msgText = "留言成功"
- go services.SendWxCategoryMsgByYanxuanSpecialMassageByAuthor(content, yanxuanSpecialBySpeciaDetail)
- } else {
- msgText = "回复成功"
- go services.SendWxCategoryMsgByYanxuanSpecialMassage(parentId, int(messageId), content, yanxuanSpecialBySpeciaDetail)
- }
- br.Ret = 200
- br.Success = true
- br.Msg = msgText
- }
- // @Title 留言管理列表
- // @Description 留言管理列表接口
- // @Param PageSize query int true "每页数据条数"
- // @Param CurrentIndex query int true "当前页页码,从1开始"
- // @Param MessageType query int false "留言类型1:普通留言、2:公开留言"
- // @Param WxMessageId query int false "留言ID"
- // @Success 200 {object} models.SpecialListResp
- // @router /message/manage/list [get]
- func (this *YanxuanSpecialMessageController) MessageManageList() {
- 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
- }
- pageSize, _ := this.GetInt("PageSize")
- currentIndex, _ := this.GetInt("CurrentIndex")
- messageType, _ := this.GetInt("MessageType", 1)
- messageId, _ := this.GetInt("WxMessageId") // 前端做区分
- resp := new(models.YanxuanSpecialMessageManageRespListResp)
- if messageId > 0 {
- messagerDetail, err := models.GetCygxYanxuanSpecialMessagerDetailById(messageId)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- if messagerDetail.Status == -1 {
- resp.IsDelete = true
- }
- }
- var startSize int
- if pageSize <= 0 {
- pageSize = utils.PageSize20
- }
- if currentIndex <= 0 {
- currentIndex = 1
- }
- startSize = utils.StartIndex(currentIndex, pageSize)
- var condition string
- var pars []interface{}
- userId := user.UserId
- if messageType == 1 {
- condition += ` AND status = 0 `
- } else {
- condition += ` AND status = 1 `
- }
- condition += ` AND yanxuan_special_user_id = ? `
- pars = append(pars, userId)
- conditionChildren := condition // 子集留言筛选条件
- condition += ` AND parent_id = 0 `
- total, err := models.GetCygxYanxuanSpecialMessagerCount(condition, pars)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- condition += ` ORDER BY message_id DESC `
- list, err := models.GetCygxYanxuanSpecialMessageList(condition, pars, startSize, pageSize)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- if len(list) > 0 {
- var messageIds []int
- var userIds []int
- for _, v := range list {
- messageIds = append(messageIds, v.MessageId)
- userIds = append(userIds, v.UserId)
- }
- //获取子集评论
- conditionChildren += ` AND parent_id IN (` + utils.GetOrmInReplace(len(messageIds)) + `) ORDER BY message_id ASC `
- pars = append(pars, messageIds)
- listChild, err := models.GetCygxYanxuanSpecialMessageList(conditionChildren, pars, 0, 999)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- itemChildMap := make(map[int][]*models.CygxYanxuanSpecialMessageManageChildResp)
- for _, v := range listChild {
- userIds = append(userIds, v.UserId)
- itemChild := new(models.CygxYanxuanSpecialMessageManageChildResp)
- itemChild.UserId = v.UserId
- itemChild.MessageId = v.MessageId
- itemChild.Content = v.Content
- itemChild.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
- itemChildMap[v.ParentId] = append(itemChildMap[v.ParentId], itemChild)
- }
- //用户头像
- listUser, err := models.GetWxUserListByUserIdsArr(userIds)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- mapUserImg := make(map[int]string)
- for _, v := range listUser {
- if v.Headimgurl != "" {
- mapUserImg[v.UserId] = v.Headimgurl
- } else {
- mapUserImg[v.UserId] = utils.DefaultHeadimgurl
- }
- }
- for _, v := range userIds {
- if mapUserImg[v] == "" {
- mapUserImg[v] = utils.DefaultHeadimgurl
- }
- }
- for _, v := range list {
- item := new(models.CygxYanxuanSpecialMessageManageResp)
- item.MessageId = v.MessageId
- item.RealName = v.RealName
- item.Headimgurl = mapUserImg[v.UserId]
- item.YanxuanSpecialId = v.YanxuanSpecialId
- item.Content = v.Content
- item.TopTime = v.TopTime
- item.SourceTitle = v.SourceTitle
- item.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
- if len(itemChildMap[v.MessageId]) > 0 {
- for _, vm := range itemChildMap[v.MessageId] {
- vm.Headimgurl = mapUserImg[vm.UserId]
- }
- item.ChildList = itemChildMap[v.MessageId]
- } else {
- item.ChildList = make([]*models.CygxYanxuanSpecialMessageManageChildResp, 0)
- }
- item.CheckIds = make([]int, 0)
- resp.List = append(resp.List, item)
- }
- } else {
- resp.List = make([]*models.CygxYanxuanSpecialMessageManageResp, 0)
- }
- page := paging.GetPaging(currentIndex, pageSize, total)
- resp.Paging = page
- br.Data = resp
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- }
- // @Title 删除留言
- // @Description 删除留言接口
- // @Param request body models.DeleteCygxYanxuanSpecialMessageReq true "type json string"
- // @Success Ret=200 {object}
- // @router /message/delete [post]
- func (this *YanxuanSpecialMessageController) MessageDelete() {
- 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
- }
- var req models.DeleteCygxYanxuanSpecialMessageReq
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
- if err != nil {
- br.Msg = "参数解析异常!"
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
- return
- }
- messageId := req.MessageId
- err = models.DeleteCygxYanxuanSpecialMessage(messageId)
- if err != nil {
- br.Msg = "删除失败!"
- br.ErrMsg = "删除失败,Err:" + err.Error()
- return
- }
- br.Ret = 200
- br.Success = true
- br.Msg = "删除成功"
- }
- // @Title 置顶/取消置顶留言
- // @Description 置顶/取消置顶留言接口
- // @Param request body models.TopCygxYanxuanSpecialMessageReq true "type json string"
- // @Success Ret=200 {object}
- // @router /message/top [post]
- func (this *YanxuanSpecialMessageController) MessageTop() {
- 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
- }
- var req models.TopCygxYanxuanSpecialMessageReq
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
- if err != nil {
- br.Msg = "参数解析异常!"
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
- return
- }
- messageId := req.MessageId
- doType := req.DoType
- messagerDetail, err := models.GetCygxYanxuanSpecialMessagerDetailById(messageId)
- if err != nil {
- br.Msg = "操作失败!"
- br.ErrMsg = "操作失败,Err:" + err.Error()
- }
- yanxuanSpecialId := messagerDetail.YanxuanSpecialId
- var topTime int
- var msgContent string
- if doType == 1 {
- countTop, err := models.GetCygxYanxuanSpecialMessagerCountTop(yanxuanSpecialId)
- if err != nil {
- br.Msg = "操作失败!"
- br.ErrMsg = "操作失败,Err:" + err.Error()
- return
- }
- if countTop > 0 {
- br.Msg = "此文章已有置顶留言"
- return
- }
- topTime = int(time.Now().Unix())
- msgContent = "已置顶"
- } else {
- msgContent = "已取消置顶"
- }
- err = models.UpdateCygxYanxuanSpecialMessageTopTime(topTime, messageId)
- if err != nil {
- br.Msg = "操作失败!"
- br.ErrMsg = "操作失败,Err:" + err.Error()
- return
- }
- br.Ret = 200
- br.Success = true
- br.Msg = msgContent
- }
- // @Title 公开/取消公开留言
- // @Description 公开/取消公开留言接口
- // @Param request body models.TopCygxYanxuanSpecialMessageReq true "type json string"
- // @Success Ret=200 {object}
- // @router /message/public [post]
- func (this *YanxuanSpecialMessageController) MessagePublic() {
- 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
- }
- var req models.PubliceCygxYanxuanSpecialMessageReq
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
- if err != nil {
- br.Msg = "参数解析异常!"
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
- return
- }
- messageIds := req.MessageIds
- doType := req.DoType
- var status int
- var publicTime string
- var msgContent string
- if doType == 1 {
- status = 1
- publicTime = time.Now().Format(utils.FormatDateTime)
- msgContent = "已公开"
- } else {
- msgContent = "已取消公开"
- }
- err = models.UpdateCygxYanxuanSpecialMessageStatus(status, publicTime, messageIds)
- if err != nil {
- br.Msg = "操作失败!"
- br.ErrMsg = "操作失败,Err:" + err.Error()
- return
- }
- br.Ret = 200
- br.Success = true
- br.Msg = msgContent
- }
- // @Title 点赞/取消点赞
- // @Description 点赞/取消点赞接口
- // @Param request body models.TopCygxYanxuanSpecialMessageReq true "type json string"
- // @Success Ret=200 {object}
- // @router /message/like [post]
- func (this *YanxuanSpecialMessageController) MessageLike() {
- 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
- }
- var req models.TopCygxYanxuanSpecialMessageReq
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
- if err != nil {
- br.Msg = "参数解析异常!"
- br.ErrMsg = "参数解析失败,Err:" + err.Error()
- return
- }
- messageId := req.MessageId
- doType := req.DoType
- userId := user.UserId
- total, err := models.GetCygxYanxuanSpecialMessageLikeCountByUidMid(userId, messageId)
- if err != nil {
- br.Msg = "操作失败!"
- br.ErrMsg = "操作失败,Err:" + err.Error()
- return
- }
- var msgContent string
- if doType == 1 {
- if total == 0 {
- item := new(models.CygxYanxuanSpecialMessageLike)
- item.UserId = userId
- item.Mobile = user.Mobile
- item.Email = user.Email
- item.CompanyId = user.CompanyId
- item.CompanyName = user.CompanyName
- item.RealName = user.RealName
- item.MessageId = messageId
- item.CreateTime = time.Now()
- item.ModifyTime = time.Now()
- item.RegisterPlatform = utils.REGISTER_PLATFORM
- err = models.AddCygxYanxuanSpecialMessageLike(item)
- if err != nil {
- br.Msg = "点赞失败!"
- br.ErrMsg = "点赞失败,Err:" + err.Error()
- return
- }
- }
- msgContent = "已点赞"
- } else {
- if total > 0 {
- err = models.DeleteCygxYanxuanSpecialMessageLike(userId, messageId)
- if err != nil {
- br.Msg = "点赞失败!"
- br.ErrMsg = "点赞失败,Err:" + err.Error()
- return
- }
- }
- msgContent = "已取消点赞"
- }
- br.Ret = 200
- br.Success = true
- br.Msg = msgContent
- }
- // @Title 专栏文章留言列表
- // @Description 专栏文章留言列表接口
- // @Param PageSize query int true "每页数据条数"
- // @Param CurrentIndex query int true "当前页页码,从1开始"
- // @Param YanxuanSpecialId query int false "研选专栏文章ID"
- // @Success 200 {object} models.SpecialListResp
- // @router /message/special/list [get]
- func (this *YanxuanSpecialMessageController) MessageSpecialList() {
- 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
- }
- pageSize, _ := this.GetInt("PageSize")
- currentIndex, _ := this.GetInt("CurrentIndex")
- yanxuanSpecialId, _ := this.GetInt("YanxuanSpecialId")
- var startSize int
- if pageSize <= 0 {
- pageSize = utils.PageSize20
- }
- if currentIndex <= 0 {
- currentIndex = 1
- }
- startSize = utils.StartIndex(currentIndex, pageSize)
- userId := user.UserId
- resp := new(models.YanxuanSpecialMessageManageRespListResp)
- publiccTotal, err := models.GetCygxYanxuanSpecialMessagerPublicCount(yanxuanSpecialId)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- resp.PublicMessageTotal = publiccTotal
- var condition string
- var pars []interface{}
- var conditionMyself string
- var parsMyself []interface{}
- conditionMyself += ` AND status = 0 AND parent_id = 0 AND user_id = ? AND yanxuan_special_id = ? ORDER BY message_id DESC `
- parsMyself = append(parsMyself, userId, yanxuanSpecialId)
- var listMyself []*models.CygxYanxuanSpecialMessage
- if currentIndex == 1 {
- //获取自己未公开的留言
- listMyself, err = models.GetCygxYanxuanSpecialMessageList(conditionMyself, parsMyself, 0, 999)
- if err != nil && err.Error() != utils.ErrNoRow() {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- }
- condition += ` AND status = 1 `
- condition += ` AND yanxuan_special_id = ? `
- pars = append(pars, yanxuanSpecialId)
- conditionChildren := condition // 子集留言筛选条件
- condition += ` AND parent_id = 0 `
- total, err := models.GetCygxYanxuanSpecialMessagerCount(condition, pars)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- condition += ` ORDER BY top_time DESC , message_id DESC `
- list, err := models.GetCygxYanxuanSpecialMessageList(condition, pars, startSize, pageSize)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- for _, v := range list {
- listMyself = append(listMyself, v)
- }
- if len(listMyself) > 0 {
- var messageIds []int
- var messageIdsAll []int // 所有的留言消息
- var userIds []int
- for _, v := range list {
- messageIds = append(messageIds, v.MessageId)
- }
- for _, v := range listMyself {
- userIds = append(userIds, v.UserId)
- }
- itemChildMap := make(map[int][]*models.CygxYanxuanSpecialMessageManageChildResp)
- if len(messageIds) > 0 {
- //获取子集评论
- conditionChildren += ` AND parent_id IN (` + utils.GetOrmInReplace(len(messageIds)) + `) ORDER BY message_id ASC `
- pars = append(pars, messageIds)
- listChild, err := models.GetCygxYanxuanSpecialMessageList(conditionChildren, pars, 0, 999)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- for _, v := range listChild {
- userIds = append(userIds, v.UserId)
- messageIdsAll = append(messageIdsAll, v.MessageId)
- itemChild := new(models.CygxYanxuanSpecialMessageManageChildResp)
- itemChild.UserId = v.UserId
- itemChild.MessageId = v.MessageId
- itemChild.Content = v.Content
- itemChild.LikeCount = v.LikeCount
- itemChild.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
- itemChildMap[v.ParentId] = append(itemChildMap[v.ParentId], itemChild)
- }
- }
- likeMap := services.GetYanxuanSpecialMessageLikeMap(userId)
- //用户头像
- listUser, err := models.GetWxUserListByUserIdsArr(userIds)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- mapUserImg := make(map[int]string)
- for _, v := range listUser {
- if v.Headimgurl != "" {
- mapUserImg[v.UserId] = v.Headimgurl
- } else {
- mapUserImg[v.UserId] = utils.DefaultHeadimgurl
- }
- }
- for _, v := range listMyself {
- item := new(models.CygxYanxuanSpecialMessageManageResp)
- item.MessageId = v.MessageId
- item.RealName = v.RealName
- item.Headimgurl = mapUserImg[v.UserId]
- item.YanxuanSpecialId = v.YanxuanSpecialId
- item.Content = v.Content
- item.TopTime = v.TopTime
- item.SourceTitle = v.SourceTitle
- item.LikeCount = v.LikeCount
- item.IsLikeCount = likeMap[v.MessageId]
- item.Status = v.Status
- if v.UserId == userId {
- item.IsMySelf = true
- }
- item.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
- if len(itemChildMap[v.MessageId]) > 0 {
- for _, vm := range itemChildMap[v.MessageId] {
- vm.IsLikeCount = likeMap[vm.MessageId]
- vm.Headimgurl = mapUserImg[vm.UserId]
- }
- item.ChildList = itemChildMap[v.MessageId]
- } else {
- item.ChildList = make([]*models.CygxYanxuanSpecialMessageManageChildResp, 0)
- }
- item.CheckIds = make([]int, 0)
- resp.List = append(resp.List, item)
- }
- } else {
- resp.List = make([]*models.CygxYanxuanSpecialMessageManageResp, 0)
- }
- page := paging.GetPaging(currentIndex, pageSize, total)
- resp.Paging = page
- br.Data = resp
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- }
- // @Title 通过模版消息查看留言详情
- // @Description 通过模版消息查看留言详情接口
- // @Param MessageId query int true "留言ID"
- // @Success 200 {object} models.SpecialListResp
- // @router /message/detail/wxtmp [get]
- func (this *YanxuanSpecialMessageController) MessageDetailWxtmp() {
- 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
- }
- messageId, _ := this.GetInt("MessageId")
- messagerDetail, err := models.GetCygxYanxuanSpecialMessagerDetailById(messageId)
- if err != nil {
- br.Msg = "获取失败"
- br.ErrMsg = "获取失败, Err:" + err.Error()
- return
- }
- resp := new(models.MessageDetailWxtmpResp)
- if messagerDetail.Status == -1 {
- resp.IsDelete = true
- } else {
- resp.Content = messagerDetail.Content
- }
- resp.YanxuanSpecialId = messagerDetail.YanxuanSpecialId
- br.Data = resp
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- }
|