refactor: reorganize modules and add Linux build tooling
This commit is contained in:
30
module/base/cms/internal/logic/post/desc_comment_unlike.go
Normal file
30
module/base/cms/internal/logic/post/desc_comment_unlike.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package post
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
|
||||
"bsm/full/module/base/cms/internal/models"
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
)
|
||||
|
||||
// DescCommentUnlike 减少评论踩
|
||||
func DescCommentUnlike(ctx context.Context, in *pb.CommentOpIdentityRequest) (*pb.StatusReply, error) {
|
||||
_, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if in.GetCommentIdentity() == "" || in.GetOpIdentity() == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
err = models.IncrOrDescCommentField(in.CommentIdentity, "unlike_hits", true)
|
||||
if err != nil {
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return &pb.StatusReply{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user