This commit is contained in:
2024-10-13 20:52:47 +08:00
parent 534500eb32
commit c35864c47b
39 changed files with 2243 additions and 291 deletions

View File

@@ -30,6 +30,9 @@ func NewFLXGDEC7Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXGDEC7
}
func (l *FLXGDEC7Logic) FLXGDEC7(req *types.Request) (resp *types.Response, err *errs.AppError) {
var status string
var charges bool
var remark = ""
secretKey, ok := l.ctx.Value("secretKey").(string)
if !ok {
return &types.Response{}, errs.ErrSystem
@@ -38,6 +41,27 @@ func (l *FLXGDEC7Logic) FLXGDEC7(req *types.Request) (resp *types.Response, err
if !ok {
return &types.Response{}, errs.ErrSystem
}
userId, userIdOk := l.ctx.Value("userId").(int64)
if !userIdOk {
return &types.Response{}, errs.ErrSystem
}
productCode, productCodeOk := l.ctx.Value("productCode").(string)
if !productCodeOk || productCode == "" {
return &types.Response{}, errs.ErrSystem
}
defer func() {
if err != nil {
status = "failed"
charges = false
} else {
status = "success"
charges = true
}
sendApiRequestMessageErr := l.svcCtx.ApiRequestMqsService.SendApiRequestMessage(l.ctx, transactionID, userId, productCode, status, charges, remark)
if sendApiRequestMessageErr != nil {
logx.Errorf("发送 API 请求消息失败: %v", err)
}
}()
// 1、解密
key, decodeErr := hex.DecodeString(secretKey)
if decodeErr != nil {