diff --git a/internal/domains/api/services/processors/qcxg/qcxg9p1c_processor.go b/internal/domains/api/services/processors/qcxg/qcxg9p1c_processor.go index 1223cde..6f615ee 100644 --- a/internal/domains/api/services/processors/qcxg/qcxg9p1c_processor.go +++ b/internal/domains/api/services/processors/qcxg/qcxg9p1c_processor.go @@ -27,18 +27,15 @@ func ProcessQCXG9P1CRequest(ctx context.Context, params []byte, deps *processors null := "" // 构建请求参数 reqData := map[string]interface{}{ - "id_card": paramsDto.IDCard, - "name": null, - "userType": null, - "vehicleType": null, - "encryptionType": null, - "encryptionContent": null, + "idNum": paramsDto.IDCard, + "name": null, + "userType": "1", } // 调用极光API - // apiCode: vehicle-person-vehicles (用于请求头) - // apiPath: vehicle/person-vehicles (用于URL路径) - respBytes, err := deps.JiguangService.CallAPI(ctx, "vehicle-person-vehicles", "vehicle/person-vehicles", reqData) + // apiCode: vehicle-inquiry-under-name (用于请求头) + // apiPath: vehicle/inquiry-under-name (用于URL路径) + respBytes, err := deps.JiguangService.CallAPI(ctx, "vehicle-inquiry-under-name", "vehicle/inquiry-under-name", reqData) if err != nil { // 根据错误类型返回相应的错误 if errors.Is(err, jiguang.ErrNotFound) { @@ -50,6 +47,9 @@ func ProcessQCXG9P1CRequest(ctx context.Context, params []byte, deps *processors } } + // 极光服务已经返回了 data 字段的 JSON,直接返回即可 + return respBytes, nil + // 使用 gjson 检查并转换 vehicleCount 字段 vehicleCountResult := gjson.GetBytes(respBytes, "vehicleCount") if vehicleCountResult.Exists() && vehicleCountResult.Type == gjson.String {