F
This commit is contained in:
@@ -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"`
|
||||
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
||||
}
|
||||
|
||||
type QCXG8A3DReq struct {
|
||||
|
||||
@@ -23,11 +23,10 @@ func ProcessQCXG4D2ERequest(ctx context.Context, params []byte, deps *processors
|
||||
|
||||
// 构建请求参数
|
||||
reqData := map[string]interface{}{
|
||||
"idNum": paramsDto.IDCard,
|
||||
"idNum": paramsDto.IDCard,
|
||||
"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
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
"id_card": paramsDto.IDCard,
|
||||
"name": paramsDto.Name,
|
||||
"userType": null,
|
||||
"vehicleType": null,
|
||||
"encryptionType": null,
|
||||
"encryptionContent": null,
|
||||
}
|
||||
|
||||
// 调用极光API
|
||||
|
||||
@@ -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, ¶msDto); 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,
|
||||
"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) {
|
||||
|
||||
Reference in New Issue
Block a user