This commit is contained in:
李子铭 2025-03-05 18:02:39 +08:00
parent 6fbd79f3a1
commit 26f3d17ec6
2 changed files with 18 additions and 2 deletions

View File

@ -14,6 +14,7 @@ type Cmb struct {
ProductRepo repo.ProductRepo
WechatCpnRepo wechatrepo.WechatCpnRepo
GenerateMixRepo mixrepos.GenerateMixRepo
CmbMixRepo mixrepos.CmbMixRepo
}
func NewCmb(
@ -23,6 +24,7 @@ func NewCmb(
ProductRepo repo.ProductRepo,
WechatCpnRepo wechatrepo.WechatCpnRepo,
GenerateMixRepo mixrepos.GenerateMixRepo,
CmbMixRepo mixrepos.CmbMixRepo,
) *Cmb {
return &Cmb{
bc: bc,
@ -31,5 +33,6 @@ func NewCmb(
ProductRepo: ProductRepo,
WechatCpnRepo: WechatCpnRepo,
GenerateMixRepo: GenerateMixRepo,
CmbMixRepo: CmbMixRepo,
}
}

View File

@ -2,6 +2,7 @@ package cmb
import (
"context"
"encoding/json"
"fmt"
v1 "voucher/api/v1"
"voucher/internal/biz/bo"
@ -94,14 +95,26 @@ func (v *Cmb) NotifyConsume(ctx context.Context, order *bo.OrderBo, orderOutRequ
return fmt.Errorf("微信订单状态错误,不能通知:%s", order.Status.GetText())
}
request := &v1.CmbNotifyRequest{
req := &v1.CmbNotifyRequest{
Ticket: orderWechat.OrderNo,
Status: "",
TransDate: "",
OrgNo: "",
Ext: "",
}
fmt.Printf("request:%+v", request)
bizJsonBytes, err := json.Marshal(req)
if err != nil {
return err
}
bizJsonStr := string(bizJsonBytes)
request, err := v.CmbMixRepo.BuildRequest(ctx, "updateCodeStatus.json", bizJsonStr)
if err != nil {
return err
}
// todo
fmt.Print(request)
return nil
}