Merge branch 'main' of http://1.117.67.95:3000/team/tyapi-server
This commit is contained in:
@@ -609,8 +609,6 @@ func (s *ApiApplicationServiceImpl) GetUserApiCalls(ctx context.Context, userID
|
|||||||
// 转换为响应DTO
|
// 转换为响应DTO
|
||||||
var items []dto.ApiCallRecordResponse
|
var items []dto.ApiCallRecordResponse
|
||||||
for _, call := range calls {
|
for _, call := range calls {
|
||||||
// 出于安全考虑,不再在数据库中存储或解密真实请求参数
|
|
||||||
// 这里只保留数据库中的原始占位值(通常为空字符串)
|
|
||||||
requestParamsStr := call.RequestParams
|
requestParamsStr := call.RequestParams
|
||||||
|
|
||||||
item := dto.ApiCallRecordResponse{
|
item := dto.ApiCallRecordResponse{
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ func NewApiCall(accessId, requestParams, clientIp string) (*ApiCall, error) {
|
|||||||
AccessId: accessId,
|
AccessId: accessId,
|
||||||
TransactionId: GenerateTransactionID(),
|
TransactionId: GenerateTransactionID(),
|
||||||
ClientIp: clientIp,
|
ClientIp: clientIp,
|
||||||
RequestParams: "",
|
RequestParams: requestParams,
|
||||||
Status: ApiCallStatusPending,
|
Status: ApiCallStatusPending,
|
||||||
StartAt: time.Now(),
|
StartAt: time.Now(),
|
||||||
}, nil
|
}, nil
|
||||||
|
|||||||
@@ -39,6 +39,14 @@ func ProcessYYSY9E4ARequest(ctx context.Context, params []byte, deps *processors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 兼容上游有时返回 JSON 字符串的情况:如果是字符串则尝试再反序列化一次
|
||||||
|
if str, ok := respData.(string); ok && str != "" {
|
||||||
|
var parsed interface{}
|
||||||
|
if err := json.Unmarshal([]byte(str), &parsed); err == nil {
|
||||||
|
respData = parsed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 将响应数据转换为JSON字节
|
// 将响应数据转换为JSON字节
|
||||||
respBytes, err := json.Marshal(respData)
|
respBytes, err := json.Marshal(respData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user