by Robin at 20240509

This commit is contained in:
Leufolium 2024-05-09 01:55:43 +08:00
parent 56ceb91a45
commit edc907aadb
1 changed files with 30 additions and 2 deletions

View File

@ -151,8 +151,22 @@ func (s *Service) utilGetContactCustomerServiceSessionMap(ctx *gin.Context, sess
func (s *Service) utilThumbsUpMoment(ctx *gin.Context, req *momentproto.OpThumbsUpReq) (ec errcode.ErrCode) { func (s *Service) utilThumbsUpMoment(ctx *gin.Context, req *momentproto.OpThumbsUpReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeMomentSrvOk ec = errcode.ErrCodeMomentSrvOk
thumbsup, err := _DefaultThumbsUp.OpListBySentence(ctx, &thumbsupproto.OpListBySentenceReq{
MomentId: req.MomentId,
Mid: req.Mid,
})
if err != nil {
logger.Error("_DefaultZoneMomentThumbsUp OpListBySentence fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneMomentThumbsUpSrvFail
return
}
if thumbsup != nil {
ec = errcode.ErrCodeZoneMomentThumbsUpDuplicateKey
return
}
//先写入点赞表 //先写入点赞表
err := _DefaultThumbsUp.OpCreate(ctx, &thumbsupproto.OpCreateReq{ err = _DefaultThumbsUp.OpCreate(ctx, &thumbsupproto.OpCreateReq{
ThumbsUp: &dbstruct.ThumbsUp{ ThumbsUp: &dbstruct.ThumbsUp{
MomentId: req.MomentId, MomentId: req.MomentId,
Mid: req.Mid, Mid: req.Mid,
@ -826,8 +840,22 @@ func (s *Service) utilFillIsZoneMomentThumbedUpFillable(ctx *gin.Context, visito
func (s *Service) utilThumbsUpZoneMoment(ctx *gin.Context, req *zonemomentproto.OpZoneMomentThumbsUpReq) (ec errcode.ErrCode) { func (s *Service) utilThumbsUpZoneMoment(ctx *gin.Context, req *zonemomentproto.OpZoneMomentThumbsUpReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeZoneMomentSrvOk ec = errcode.ErrCodeZoneMomentSrvOk
thumbsup, err := _DefaultZoneMomentThumbsUp.OpListBySentence(ctx, &zonemomentthumbsupproto.OpListBySentenceReq{
ZoneMomentId: req.ZoneMomentId,
Mid: req.Mid,
})
if err != nil {
logger.Error("_DefaultZoneMomentThumbsUp OpListBySentence fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneMomentThumbsUpSrvFail
return
}
if thumbsup != nil {
ec = errcode.ErrCodeZoneMomentThumbsUpDuplicateKey
return
}
//先写入点赞表 //先写入点赞表
err := _DefaultZoneMomentThumbsUp.OpCreate(ctx, &zonemomentthumbsupproto.OpCreateReq{ err = _DefaultZoneMomentThumbsUp.OpCreate(ctx, &zonemomentthumbsupproto.OpCreateReq{
ZoneMomentThumbsUp: &dbstruct.ZoneMomentThumbsUp{ ZoneMomentThumbsUp: &dbstruct.ZoneMomentThumbsUp{
ZoneMomentId: req.ZoneMomentId, ZoneMomentId: req.ZoneMomentId,
Mid: req.Mid, Mid: req.Mid,