2024-08-28 09:09:01 +00:00
|
|
|
// Code generated by goctl. DO NOT EDIT.
|
2024-08-28 14:24:47 +00:00
|
|
|
// Source: tweeting.proto
|
2024-08-28 09:09:01 +00:00
|
|
|
|
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2024-08-28 14:24:47 +00:00
|
|
|
"app-cloudep-feed-service/gen_result/pb/tweeting"
|
2024-08-28 09:09:01 +00:00
|
|
|
"app-cloudep-feed-service/internal/logic/commentservice"
|
|
|
|
"app-cloudep-feed-service/internal/svc"
|
|
|
|
)
|
|
|
|
|
|
|
|
type CommentServiceServer struct {
|
|
|
|
svcCtx *svc.ServiceContext
|
2024-08-28 14:24:47 +00:00
|
|
|
tweeting.UnimplementedCommentServiceServer
|
2024-08-28 09:09:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewCommentServiceServer(svcCtx *svc.ServiceContext) *CommentServiceServer {
|
|
|
|
return &CommentServiceServer{
|
|
|
|
svcCtx: svcCtx,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewComment 發表評論
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) NewComment(ctx context.Context, in *tweeting.CommentPostReq) (*tweeting.OKResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewNewCommentLogic(ctx, s.svcCtx)
|
|
|
|
return l.NewComment(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetComments 查詢評論
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) GetComments(ctx context.Context, in *tweeting.GetCommentsReq) (*tweeting.GetCommentsResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewGetCommentsLogic(ctx, s.svcCtx)
|
|
|
|
return l.GetComments(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteComment 刪除評論
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) DeleteComment(ctx context.Context, in *tweeting.DeleteCommentReq) (*tweeting.OKResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewDeleteCommentLogic(ctx, s.svcCtx)
|
|
|
|
return l.DeleteComment(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateComment 更新評論
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) UpdateComment(ctx context.Context, in *tweeting.UpdateCommentReq) (*tweeting.OKResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewUpdateCommentLogic(ctx, s.svcCtx)
|
|
|
|
return l.UpdateComment(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// LikeComment 點讚/取消讚 評論
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) LikeComment(ctx context.Context, in *tweeting.LikeReq) (*tweeting.OKResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewLikeCommentLogic(ctx, s.svcCtx)
|
|
|
|
return l.LikeComment(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetLikeStatus 取得讚/不讚評論狀態
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) GetLikeStatus(ctx context.Context, in *tweeting.LikeReq) (*tweeting.OKResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewGetLikeStatusLogic(ctx, s.svcCtx)
|
|
|
|
return l.GetLikeStatus(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// LikeList 取得讚/不讚評論列表
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) LikeList(ctx context.Context, in *tweeting.LikeListReq) (*tweeting.LikeListResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewLikeListLogic(ctx, s.svcCtx)
|
|
|
|
return l.LikeList(in)
|
|
|
|
}
|
|
|
|
|
|
|
|
// CountLike 取得讚/不讚評論數量
|
2024-08-28 14:24:47 +00:00
|
|
|
func (s *CommentServiceServer) CountLike(ctx context.Context, in *tweeting.LikeCountReq) (*tweeting.LikeCountResp, error) {
|
2024-08-28 09:09:01 +00:00
|
|
|
l := commentservicelogic.NewCountLikeLogic(ctx, s.svcCtx)
|
|
|
|
return l.CountLike(in)
|
|
|
|
}
|