1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package logic
- import (
- "context"
- "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/rpc/pb"
- "fmt"
- "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/api/internal/svc"
- "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/api/internal/types"
- . "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/public/service"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type ConfirmReceiptLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewConfirmReceiptLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConfirmReceiptLogic {
- return &ConfirmReceiptLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *ConfirmReceiptLogic) ConfirmReceipt(req *types.ConfirmReceiptReq) (resp *types.Reply, err error) {
- // todo: add your logic here and delete this line
- resp = &types.Reply{}
- threeMarketResp, err := ThreemarketRpc.ConfirmReceipt(l.ctx, &pb.ConfirmReceiptReq{
- Appid: req.AppId,
- BaseUserId: req.Base_user_id,
- GoodsCode: req.Goods_code,
- ServiceId: req.Service_id,
- })
- if threeMarketResp.ErrorMsg != "" {
- resp.Error_msg = threeMarketResp.ErrorMsg
- resp.Error_code = -1
- l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
- }
- resp.Data = map[string]interface{}{
- "status": threeMarketResp.Status,
- }
- return
- }
|