增加api optional Json
This commit is contained in:
@@ -94,7 +94,17 @@ func (l *FLXG0V4BLogic) FLXG0V4B(req *types.Request) (resp string, err *errs.App
|
||||
westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("G22SC01", apiRequest, l.svcCtx.Config.WestConfig.SecretId)
|
||||
if callAPIErr != nil {
|
||||
if callAPIErr.Code == errs.ErrDataSource.Code {
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(westResp, key)
|
||||
var resultResp []byte
|
||||
if req.Options.Json {
|
||||
var parseErr *errs.AppError
|
||||
resultResp, parseErr = common.ParseWestResponse(westResp)
|
||||
if parseErr != nil {
|
||||
return "", parseErr
|
||||
}
|
||||
} else {
|
||||
resultResp = westResp
|
||||
}
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(resultResp, key)
|
||||
if aesEncrypt != nil {
|
||||
return "", errs.ErrSystem
|
||||
}
|
||||
@@ -103,7 +113,18 @@ func (l *FLXG0V4BLogic) FLXG0V4B(req *types.Request) (resp string, err *errs.App
|
||||
return "", callAPIErr
|
||||
}
|
||||
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(westResp, key)
|
||||
var resultResp []byte
|
||||
if req.Options.Json {
|
||||
var parseErr *errs.AppError
|
||||
resultResp, parseErr = common.ParseJsonResponse(westResp)
|
||||
if parseErr != nil {
|
||||
return "", parseErr
|
||||
}
|
||||
} else {
|
||||
resultResp = westResp
|
||||
}
|
||||
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(resultResp, key)
|
||||
if aesEncrypt != nil {
|
||||
return "", errs.ErrSystem
|
||||
}
|
||||
|
||||
@@ -94,7 +94,17 @@ func (l *QYGL8271Logic) QYGL8271(req *types.Request) (resp string, err *errs.App
|
||||
westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("Q03SC01", apiRequest, l.svcCtx.Config.WestConfig.SecretId)
|
||||
if callAPIErr != nil {
|
||||
if callAPIErr.Code == errs.ErrDataSource.Code {
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(westResp, key)
|
||||
var resultResp []byte
|
||||
if req.Options.Json {
|
||||
var parseErr *errs.AppError
|
||||
resultResp, parseErr = common.ParseJsonResponse(westResp)
|
||||
if parseErr != nil {
|
||||
return "", parseErr
|
||||
}
|
||||
} else {
|
||||
resultResp = westResp
|
||||
}
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(resultResp, key)
|
||||
if aesEncrypt != nil {
|
||||
return "", errs.ErrSystem
|
||||
}
|
||||
@@ -103,7 +113,18 @@ func (l *QYGL8271Logic) QYGL8271(req *types.Request) (resp string, err *errs.App
|
||||
return "", callAPIErr
|
||||
}
|
||||
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(westResp, key)
|
||||
var resultResp []byte
|
||||
if req.Options.Json {
|
||||
var parseErr *errs.AppError
|
||||
resultResp, parseErr = common.ParseJsonResponse(westResp)
|
||||
if parseErr != nil {
|
||||
return "", parseErr
|
||||
}
|
||||
} else {
|
||||
resultResp = westResp
|
||||
}
|
||||
|
||||
encryptData, aesEncrypt := crypto.AesEncrypt(resultResp, key)
|
||||
if aesEncrypt != nil {
|
||||
return "", errs.ErrSystem
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user