diff --git a/internal/domains/api/services/processors/qygl/qygl9t1q_processor.go b/internal/domains/api/services/processors/qygl/qygl9t1q_processor.go index b28d81a..ca4ef36 100644 --- a/internal/domains/api/services/processors/qygl/qygl9t1q_processor.go +++ b/internal/domains/api/services/processors/qygl/qygl9t1q_processor.go @@ -37,8 +37,8 @@ func ProcessQYGL9T1QRequest(ctx context.Context, params []byte, deps *processors respBytes, err := deps.XingweiService.CallAPI(ctx, projectID, reqData) if err != nil { if errors.Is(err, xingwei.ErrNotFound) { - // 查空情况,返回空结果而不是错误 - return []byte("{}"), nil + // 查空情况,返回特定的查空错误 + return nil, errors.Join(processors.ErrNotFound, err) } else if errors.Is(err, xingwei.ErrDatasource) { // 数据源错误 return nil, errors.Join(processors.ErrDatasource, err) diff --git a/internal/infrastructure/external/xingwei/xingwei_service.go b/internal/infrastructure/external/xingwei/xingwei_service.go index 199d1a0..9b5823d 100644 --- a/internal/infrastructure/external/xingwei/xingwei_service.go +++ b/internal/infrastructure/external/xingwei/xingwei_service.go @@ -257,12 +257,11 @@ func (x *XingweiService) CallAPI(ctx context.Context, projectID string, params m return dataBytes, nil case CodeNotFound: - // 未查询到结果,返回查空错误 + // 未查询到结果,返回空数组 if x.logger != nil { - x.logger.LogError(requestID, transactionID, "xingwei_api", - errors.Join(ErrNotFound, fmt.Errorf("未查询到结果")), params) + x.logger.LogResponse(requestID, transactionID, "xingwei_api", httpResp.StatusCode, []byte("[]"), duration) } - return nil, errors.Join(ErrNotFound, fmt.Errorf("未查询到结果")) + return []byte("[]"), nil case CodeSystemError: // 系统内部错误