confirmreceiptlogic.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/rpc/pb"
  5. "fmt"
  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 ConfirmReceiptLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. }
  16. func NewConfirmReceiptLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConfirmReceiptLogic {
  17. return &ConfirmReceiptLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. }
  22. }
  23. func (l *ConfirmReceiptLogic) ConfirmReceipt(req *types.ConfirmReceiptReq) (resp *types.Reply, err error) {
  24. // todo: add your logic here and delete this line
  25. resp = &types.Reply{}
  26. threeMarketResp, err := ThreemarketRpc.ConfirmReceipt(l.ctx, &pb.ConfirmReceiptReq{
  27. Appid: req.AppId,
  28. BaseUserId: req.Base_user_id,
  29. GoodsCode: req.Goods_code,
  30. ServiceId: req.Service_id,
  31. })
  32. if threeMarketResp.ErrorMsg != "" {
  33. resp.Error_msg = threeMarketResp.ErrorMsg
  34. resp.Error_code = -1
  35. l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
  36. }
  37. resp.Data = map[string]interface{}{
  38. "status": threeMarketResp.Status,
  39. }
  40. return
  41. }