assessaddlogic.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/public/entity"
  6. "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/rpc/internal/svc"
  7. "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/rpc/pb"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type AssessAddLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewAssessAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AssessAddLogic {
  16. return &AssessAddLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 提交评价
  23. func (l *AssessAddLogic) AssessAdd(in *pb.AssessAddReq) (*pb.Resp, error) {
  24. // todo: add your logic here and delete this line
  25. resp := &pb.Resp{}
  26. tripartite_goods_assess := &entity.Tripartite_goods_assess_struct{
  27. Appid: in.Appid,
  28. User_id: in.BaseUserId,
  29. Goods_code: in.GoodsCode,
  30. Score: in.Score,
  31. Service_attitude: in.ServiceAttitude,
  32. Work_progress: in.WorkProgress,
  33. Completion_quality: in.CompletionQuality,
  34. Impression: in.Impression,
  35. Content: in.Describe,
  36. }
  37. status, err := tripartite_goods_assess.Add()
  38. if err != nil {
  39. l.Error(fmt.Sprintf("%+v", in), err.Error())
  40. resp.ErrorMsg = err.Error()
  41. resp.ErrorCode = -1
  42. }
  43. resp.Status = status
  44. return resp, nil
  45. }