app-cloudep-tweeting-service/internal/server/commentservice/comment_service_server.go

48 lines
1.5 KiB
Go
Raw Normal View History

2024-08-30 06:30:39 +00:00
// Code generated by goctl. DO NOT EDIT.
// Source: tweeting.proto
package server
import (
"context"
"app-cloudep-tweeting-service/gen_result/pb/tweeting"
2024-08-30 07:00:23 +00:00
commentservicelogic "app-cloudep-tweeting-service/internal/logic/commentservice"
2024-08-30 06:30:39 +00:00
"app-cloudep-tweeting-service/internal/svc"
)
type CommentServiceServer struct {
svcCtx *svc.ServiceContext
tweeting.UnimplementedCommentServiceServer
}
func NewCommentServiceServer(svcCtx *svc.ServiceContext) *CommentServiceServer {
return &CommentServiceServer{
svcCtx: svcCtx,
}
}
// NewComment 發表評論
func (s *CommentServiceServer) NewComment(ctx context.Context, in *tweeting.CommentPostReq) (*tweeting.CommentPostResp, error) {
l := commentservicelogic.NewNewCommentLogic(ctx, s.svcCtx)
return l.NewComment(in)
}
// GetComments 查詢評論
func (s *CommentServiceServer) GetComments(ctx context.Context, in *tweeting.GetCommentsReq) (*tweeting.GetCommentsResp, error) {
l := commentservicelogic.NewGetCommentsLogic(ctx, s.svcCtx)
return l.GetComments(in)
}
// DeleteComment 刪除評論
func (s *CommentServiceServer) DeleteComment(ctx context.Context, in *tweeting.DeleteCommentReq) (*tweeting.OKResp, error) {
l := commentservicelogic.NewDeleteCommentLogic(ctx, s.svcCtx)
return l.DeleteComment(in)
}
// UpdateComment 更新評論
func (s *CommentServiceServer) UpdateComment(ctx context.Context, in *tweeting.UpdateCommentReq) (*tweeting.OKResp, error) {
l := commentservicelogic.NewUpdateCommentLogic(ctx, s.svcCtx)
return l.UpdateComment(in)
}