assessaddlogic.go 1.5 KB

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