refactor: reorganize modules and add Linux build tooling
This commit is contained in:
37
module/base/cms/internal/logic/post/modify_comment.go
Normal file
37
module/base/cms/internal/logic/post/modify_comment.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package post
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/base/cms/internal/impl"
|
||||
"bsm/full/module/base/cms/internal/models"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
|
||||
pb "bsm/full/module/base/cms/pb"
|
||||
)
|
||||
|
||||
// 修改评论
|
||||
func ModifyComment(ctx context.Context, in *pb.CommentItem) (*pb.StatusReply, error) {
|
||||
_, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if in.GetIdentity() == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
var data = models.CmsComment{
|
||||
Std_Identity: types.Std_Identity{Identity: in.Identity},
|
||||
PostIdentity: in.PostIdentity,
|
||||
ParentId: uint(in.ParentId),
|
||||
ReplyIdentity: in.ReplyIdentity,
|
||||
Cms: in.Cms,
|
||||
}
|
||||
// err = logic.ModifyComment(&data)
|
||||
if err := impl.DBService.Where("identity = ?", data.Identity).Updates(data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &pb.StatusReply{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user