This commit is contained in:
2025-07-13 20:37:12 +08:00
parent 418b89c1ae
commit c81208e3c8
17 changed files with 6603 additions and 93 deletions

View File

@@ -3,11 +3,13 @@ package YYSY
import (
"context"
"encoding/hex"
"fmt"
"tianyuan-api/apps/api/internal/common"
"tianyuan-api/apps/api/internal/validator"
"tianyuan-api/apps/api/internal/westmodel"
"tianyuan-api/pkg/crypto"
"tianyuan-api/pkg/errs"
"time"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
@@ -88,9 +90,10 @@ func (l *YYSYBE08Logic) YYSYBE08(req *types.Request) (resp string, err *errs.App
// 4、发送请求到西部
logx.Infof("交易号:%s", transactionID)
apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.YYSYBE08FieldMapping, "data")
westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("G17BJ02", apiRequest, l.svcCtx.Config.WestConfig.SecretId)
apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.YYSYBE08FieldMapping, "")
apiRequest["customerNumber"] = l.svcCtx.Config.WestConfig.SecretId
apiRequest["timeStamp"] = fmt.Sprintf("%d", time.Now().UnixNano()/int64(time.Millisecond))
westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("layoutIdcard", apiRequest, l.svcCtx.Config.WestConfig.SecretId)
if callAPIErr != nil {
if callAPIErr.Code == errs.ErrDataSource.Code {
encryptData, aesEncrypt := crypto.AesEncrypt(westResp, key)