cmb
This commit is contained in:
parent
26f3d17ec6
commit
9b8823cc29
|
|
@ -109,7 +109,7 @@ func (v *Cmb) NotifyConsume(ctx context.Context, order *bo.OrderBo, orderOutRequ
|
|||
|
||||
bizJsonStr := string(bizJsonBytes)
|
||||
|
||||
request, err := v.CmbMixRepo.BuildRequest(ctx, "updateCodeStatus.json", bizJsonStr)
|
||||
request, err := v.CmbMixRepo.GetRequestData(ctx, "updateCodeStatus.json", bizJsonStr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ import (
|
|||
)
|
||||
|
||||
type CmbMixRepo interface {
|
||||
BuildRequest(ctx context.Context, funcName, bizJsonStr string) (*v1.CmbRequest, error)
|
||||
GetRequestData(ctx context.Context, funcName, bizJsonStr string) (*v1.CmbRequest, error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func NewCmbMixRepoImpl(bc *conf.Bootstrap) mixrepos.CmbMixRepo {
|
|||
return &CmbMixRepoImpl{bc: bc}
|
||||
}
|
||||
|
||||
func (s *CmbMixRepoImpl) BuildRequest(_ context.Context, funcName, bizJsonStr string) (*v1.CmbRequest, error) {
|
||||
func (s *CmbMixRepoImpl) GetRequestData(_ context.Context, funcName, bizJsonStr string) (*v1.CmbRequest, error) {
|
||||
// 我们的sm2 公钥加密
|
||||
// 请求到我们这边 使用 我们的私钥解密
|
||||
encryptBody, err := cmb.Encrypt(s.bc.Cmb.Sm2Puk, bizJsonStr)
|
||||
|
|
@ -64,3 +64,13 @@ func (s *CmbMixRepoImpl) BuildRequest(_ context.Context, funcName, bizJsonStr st
|
|||
|
||||
return reply, nil
|
||||
}
|
||||
|
||||
func (s *CmbMixRepoImpl) Request(ctx context.Context, funcName, bizJsonStr string) (*v1.CmbRequest, error) {
|
||||
data, err := s.GetRequestData(ctx, funcName, bizJsonStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Print(data)
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ func (s *VoucherService) CmbOrderMock(ctx http.Context) error {
|
|||
|
||||
bizJsonStr := string(bizJsonBytes)
|
||||
|
||||
reply, err := s.CmbMixRepo.BuildRequest(ctx, "/voucher/cmb/v1/order", bizJsonStr)
|
||||
reply, err := s.CmbMixRepo.GetRequestData(ctx, "/voucher/cmb/v1/order", bizJsonStr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ func (s *VoucherService) CmbProductQueryMock(ctx http.Context) error {
|
|||
|
||||
bizJsonStr := string(bizJsonBytes)
|
||||
|
||||
reply, err := s.CmbMixRepo.BuildRequest(ctx, "/voucher/cmb/v1/productQuery", bizJsonStr)
|
||||
reply, err := s.CmbMixRepo.GetRequestData(ctx, "/voucher/cmb/v1/productQuery", bizJsonStr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue