refactor: localize protobuf definitions
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"bsm/full/module/social/feed/internal/logic/post"
|
||||
pb "bsm/full/module/social/feed/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type PostServer struct {
|
||||
@@ -16,22 +16,22 @@ func NewPostServer() *PostServer {
|
||||
}
|
||||
|
||||
// 推文列表
|
||||
func (s *PostServer) Fetch(ctx context.Context, in *pb.FetchRequest) (*pb.PostListReply, error) {
|
||||
func (s *PostServer) Fetch(ctx context.Context, in *pb.FetchRequest) (*pb.FeedPostListReply, error) {
|
||||
return post.Fetch(ctx, in)
|
||||
}
|
||||
|
||||
// 新建推文
|
||||
func (s *PostServer) Create(ctx context.Context, in *pb.PostItem) (*pb.StatusReply, error) {
|
||||
func (s *PostServer) Create(ctx context.Context, in *pb.FeedPostItem) (*pb.DataStatusReply, error) {
|
||||
return post.Create(ctx, in)
|
||||
}
|
||||
|
||||
// 修改推文
|
||||
func (s *PostServer) Change(ctx context.Context, in *pb.PostItem) (*pb.StatusReply, error) {
|
||||
func (s *PostServer) Change(ctx context.Context, in *pb.FeedPostItem) (*pb.DataStatusReply, error) {
|
||||
return post.Change(ctx, in)
|
||||
}
|
||||
|
||||
// 删除推文
|
||||
func (s *PostServer) Remove(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
func (s *PostServer) Remove(ctx context.Context, in *pb.IdentRequest) (*pb.DataStatusReply, error) {
|
||||
return post.Remove(ctx, in)
|
||||
}
|
||||
|
||||
@@ -41,16 +41,16 @@ func (s *PostServer) CommentList(ctx context.Context, in *pb.FetchRequest) (*pb.
|
||||
}
|
||||
|
||||
// 新建评论
|
||||
func (s *PostServer) AddComment(ctx context.Context, in *pb.CommentItem) (*pb.StatusReply, error) {
|
||||
func (s *PostServer) AddComment(ctx context.Context, in *pb.CommentItem) (*pb.DataStatusReply, error) {
|
||||
return post.AddComment(ctx, in)
|
||||
}
|
||||
|
||||
// 删除评论
|
||||
func (s *PostServer) DeleteComment(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
func (s *PostServer) DeleteComment(ctx context.Context, in *pb.IdentRequest) (*pb.DataStatusReply, error) {
|
||||
return post.DeleteComment(ctx, in)
|
||||
}
|
||||
|
||||
// 计数操作
|
||||
func (s *PostServer) Action(ctx context.Context, in *pb.PostActionRequest) (*pb.StatusReply, error) {
|
||||
func (s *PostServer) Action(ctx context.Context, in *pb.PostActionRequest) (*pb.DataStatusReply, error) {
|
||||
return post.Action(ctx, in)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user