feat: 添加评价微服务,支持密封互评与订单状态联动

This commit is contained in:
zetaloop
2026-04-24 10:43:15 +08:00
parent 3b56910100
commit 6edf15996c
53 changed files with 7891 additions and 39 deletions
@@ -0,0 +1,32 @@
package logic
import (
"context"
"juwan-backend/app/review/rpc/internal/svc"
"juwan-backend/app/review/rpc/pb"
"github.com/zeromicro/go-zero/core/logx"
)
type GetReviewsByIdLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewGetReviewsByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetReviewsByIdLogic {
return &GetReviewsByIdLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *GetReviewsByIdLogic) GetReviewsById(in *pb.GetReviewsByIdReq) (*pb.GetReviewsByIdResp, error) {
r, err := l.svcCtx.ReviewModelRO.Reviews.Get(l.ctx, in.GetId())
if err != nil {
return nil, err
}
return &pb.GetReviewsByIdResp{Reviews: entReviewToPb(r)}, nil
}