f
This commit is contained in:
@@ -128,7 +128,7 @@ func (x *XingweiService) CallAPI(ctx context.Context, projectID string, params m
|
||||
|
||||
// 记录请求日志
|
||||
if x.logger != nil {
|
||||
x.logger.LogRequest(requestID, transactionID, "xingwei_api", x.config.URL, params)
|
||||
x.logger.LogRequest(requestID, transactionID, "xingwei_api", x.config.URL)
|
||||
}
|
||||
|
||||
// 将请求参数转换为JSON
|
||||
@@ -212,9 +212,9 @@ func (x *XingweiService) CallAPI(ctx context.Context, projectID string, params m
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 记录响应日志
|
||||
// 记录响应日志(不记录具体响应数据)
|
||||
if x.logger != nil {
|
||||
x.logger.LogResponse(requestID, transactionID, "xingwei_api", httpResp.StatusCode, bodyBytes, duration)
|
||||
x.logger.LogResponse(requestID, transactionID, "xingwei_api", httpResp.StatusCode, duration)
|
||||
}
|
||||
|
||||
// 检查HTTP状态码
|
||||
@@ -259,7 +259,8 @@ func (x *XingweiService) CallAPI(ctx context.Context, projectID string, params m
|
||||
case CodeNotFound:
|
||||
// 未查询到结果,返回空数组
|
||||
if x.logger != nil {
|
||||
x.logger.LogResponse(requestID, transactionID, "xingwei_api", httpResp.StatusCode, []byte("[]"), duration)
|
||||
// 这里只记录有响应,不记录具体返回内容
|
||||
x.logger.LogResponse(requestID, transactionID, "xingwei_api", httpResp.StatusCode, duration)
|
||||
}
|
||||
return []byte("[]"), nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user