This commit is contained in:
2026-01-15 13:26:09 +08:00
parent f6e7d46067
commit 1e2687522b
4 changed files with 18 additions and 13 deletions

View File

@@ -706,11 +706,7 @@ type FLXG8B4DReq struct {
}
type QCXG9P1CReq struct {
VehicleType string `json:"vehicle_type" validate:"omitempty,oneof=0 1 2"`
IDCard string `json:"id_card" validate:"required,validIDCard"`
Name string `json:"name" validate:"omitempty,min=1,validName"`
UserType string `json:"user_type" validate:"omitempty,oneof=1 2 3"`
Authorized string `json:"authorized" validate:"required,oneof=0 1"`
}
type QCXG8A3DReq struct {

View File

@@ -27,7 +27,6 @@ func ProcessQCXG4D2ERequest(ctx context.Context, params []byte, deps *processors
"userType": paramsDto.UserType,
}
// 调用极光API
// apiCode: vehicle-inquiry-under-name (用于请求头)
// apiPath: vehicle/inquiry-under-name (用于URL路径)
@@ -46,4 +45,3 @@ func ProcessQCXG4D2ERequest(ctx context.Context, params []byte, deps *processors
// 极光服务已经返回了 data 字段的 JSON直接返回即可
return respBytes, nil
}

View File

@@ -21,10 +21,15 @@ func ProcessQCXG5F3ARequest(ctx context.Context, params []byte, deps *processors
return nil, errors.Join(processors.ErrInvalidParam, err)
}
null := ""
// 构建请求参数
reqData := map[string]interface{}{
"id_card": paramsDto.IDCard,
"name": paramsDto.Name,
"userType": null,
"vehicleType": null,
"encryptionType": null,
"encryptionContent": null,
}
// 调用极光API

View File

@@ -13,7 +13,7 @@ import (
"github.com/tidwall/gjson"
)
// ProcessQCXG9P1CRequest QCXG9P1C API处理方法
// ProcessQCXG9P1CRequest QCXG9P1C API处理方法 兼容旧版 极光名下车牌查询数量
func ProcessQCXG9P1CRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.QCXG9P1CReq
if err := json.Unmarshal(params, &paramsDto); err != nil {
@@ -24,15 +24,21 @@ func ProcessQCXG9P1CRequest(ctx context.Context, params []byte, deps *processors
return nil, errors.Join(processors.ErrInvalidParam, err)
}
null := ""
// 构建请求参数
reqData := map[string]interface{}{
"id_card": paramsDto.IDCard,
"name": null,
"userType": null,
"vehicleType": null,
"encryptionType": null,
"encryptionContent": null,
}
// 调用极光API
// apiCode: vehicle-person-vehicles (用于请求头)
// apiPath: vehicle/person-vehicles (用于URL路径)
respBytes, err := deps.JiguangService.CallAPI(ctx, "vehicle-person-vehicles", "vehicle/person-vehicles", reqData)
respBytes, err := deps.JiguangService.CallAPI(ctx, "vehicle-person-vehicles", "vehicle-person-vehicles", reqData)
if err != nil {
// 根据错误类型返回相应的错误
if errors.Is(err, jiguang.ErrNotFound) {