98 lines
2.9 KiB
Go
98 lines
2.9 KiB
Go
|
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||
|
package server
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"protoc-gen-slc/internal/logic/post"
|
||
|
pb "protoc-gen-slc/pb"
|
||
|
)
|
||
|
|
||
|
type PostServer struct {
|
||
|
pb.UnimplementedPostServer
|
||
|
}
|
||
|
|
||
|
func NewPostServer() *PostServer {
|
||
|
return &PostServer{}
|
||
|
}
|
||
|
|
||
|
// 文章列表
|
||
|
func (s *PostServer) PostList(ctx context.Context, in *pb.PostListRequest) (*pb.PostListReply, error) {
|
||
|
return post.PostList(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 获取文章详情
|
||
|
func (s *PostServer) GetPost(ctx context.Context, in *pb.GetPostRequest) (*pb.PostItem, error) {
|
||
|
return post.GetPost(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 发布文章
|
||
|
func (s *PostServer) AddPost(ctx context.Context, in *pb.PostItem) (*pb.StatusReply, error) {
|
||
|
return post.AddPost(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 修改文章
|
||
|
func (s *PostServer) ModifyPost(ctx context.Context, in *pb.PostItem) (*pb.StatusReply, error) {
|
||
|
return post.ModifyPost(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 删除文章
|
||
|
func (s *PostServer) DeletePost(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||
|
return post.DeletePost(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 文章点赞处理
|
||
|
func (s *PostServer) IncrPostLike(ctx context.Context, in *pb.PostOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.IncrPostLike(ctx, in)
|
||
|
}
|
||
|
|
||
|
func (s *PostServer) DescPostLike(ctx context.Context, in *pb.PostOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.DescPostLike(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 文章点踩处理
|
||
|
func (s *PostServer) IncrPostUnlike(ctx context.Context, in *pb.PostOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.IncrPostUnlike(ctx, in)
|
||
|
}
|
||
|
|
||
|
func (s *PostServer) DescPostUnlike(ctx context.Context, in *pb.PostOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.DescPostUnlike(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 评论列表
|
||
|
func (s *PostServer) CommentList(ctx context.Context, in *pb.CommentListRequest) (*pb.CommentListResponse, error) {
|
||
|
return post.CommentList(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 发布评论
|
||
|
func (s *PostServer) AddComment(ctx context.Context, in *pb.CommentItem) (*pb.StatusReply, error) {
|
||
|
return post.AddComment(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 修改评论
|
||
|
func (s *PostServer) ModifyComment(ctx context.Context, in *pb.CommentItem) (*pb.StatusReply, error) {
|
||
|
return post.ModifyComment(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 删除评论
|
||
|
func (s *PostServer) DeleteComment(ctx context.Context, in *pb.DeleteCommentRequest) (*pb.StatusReply, error) {
|
||
|
return post.DeleteComment(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 评论点赞处理
|
||
|
func (s *PostServer) IncrCommentLike(ctx context.Context, in *pb.CommentOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.IncrCommentLike(ctx, in)
|
||
|
}
|
||
|
|
||
|
func (s *PostServer) DescCommentLike(ctx context.Context, in *pb.CommentOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.DescCommentLike(ctx, in)
|
||
|
}
|
||
|
|
||
|
// 评论点踩处理
|
||
|
func (s *PostServer) IncrCommentUnlike(ctx context.Context, in *pb.CommentOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.IncrCommentUnlike(ctx, in)
|
||
|
}
|
||
|
|
||
|
func (s *PostServer) DescCommentUnlike(ctx context.Context, in *pb.CommentOpIdentityRequest) (*pb.StatusReply, error) {
|
||
|
return post.DescCommentUnlike(ctx, in)
|
||
|
}
|