修正婚姻接口
This commit is contained in:
parent
7dea8159cd
commit
2dd86de9b3
@ -41,6 +41,7 @@ func (l *FLXG54F5Logic) FLXG54F5(req *types.Request) (resp string, err *errs.App
|
|||||||
if !ok {
|
if !ok {
|
||||||
return "", errs.ErrSystem
|
return "", errs.ErrSystem
|
||||||
}
|
}
|
||||||
|
|
||||||
userId, userIdOk := l.ctx.Value("userId").(int64)
|
userId, userIdOk := l.ctx.Value("userId").(int64)
|
||||||
if !userIdOk {
|
if !userIdOk {
|
||||||
return "", errs.ErrSystem
|
return "", errs.ErrSystem
|
||||||
|
@ -3,6 +3,7 @@ package IVYZ
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
"tianyuan-api/apps/api/internal/common"
|
"tianyuan-api/apps/api/internal/common"
|
||||||
"tianyuan-api/apps/api/internal/svc"
|
"tianyuan-api/apps/api/internal/svc"
|
||||||
"tianyuan-api/apps/api/internal/types"
|
"tianyuan-api/apps/api/internal/types"
|
||||||
@ -96,6 +97,25 @@ func (l *IVYZ5733Logic) IVYZ5733(req *types.Request) (resp string, err *errs.App
|
|||||||
if aesEncrypt != nil {
|
if aesEncrypt != nil {
|
||||||
return "", errs.ErrSystem
|
return "", errs.ErrSystem
|
||||||
}
|
}
|
||||||
|
// 解析加密后的数据
|
||||||
|
var response map[string]interface{}
|
||||||
|
unmarshalErr := json.Unmarshal([]byte(encryptData), &response)
|
||||||
|
if unmarshalErr != nil {
|
||||||
|
return "", errs.ErrSystem
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断是否包含 "data" 字段
|
||||||
|
responseData, dataOk := response["data"].([]interface{})
|
||||||
|
if !dataOk || len(responseData) == 0 {
|
||||||
|
return "", errs.ErrSystem
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断 "data" 中是否包含 "maritalStatus"
|
||||||
|
maritalStatus := responseData[0].(map[string]interface{})["maritalStatus"]
|
||||||
|
if maritalStatus == nil {
|
||||||
|
return "", errs.ErrSystem
|
||||||
|
}
|
||||||
|
|
||||||
return encryptData, callAPIErr
|
return encryptData, callAPIErr
|
||||||
}
|
}
|
||||||
return "", callAPIErr
|
return "", callAPIErr
|
||||||
|
Loading…
Reference in New Issue
Block a user