add QCXG7K2N
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package qcxg
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"hyapi-server/internal/domains/api/dto"
|
||||
"hyapi-server/internal/domains/api/services/processors"
|
||||
)
|
||||
|
||||
// ProcessQCXG7K2NRequest QCXG7K2N 人车核验加强版:
|
||||
// 优先经天远调用 QCXG3M7Z(人车关系核验 ETC),查无结果时降级调用本地 QCXGX2X6(行驶证信息核验V2)。
|
||||
func ProcessQCXG7K2NRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
var paramsDto dto.QCXG7K2NReq
|
||||
if err := json.Unmarshal(params, ¶msDto); err != nil {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
|
||||
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||
}
|
||||
|
||||
reqParams, err := json.Marshal(paramsDto)
|
||||
if err != nil {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
respBytes, err := processors.CallTianyuanByProduct(ctx, deps, "QCXG3M7Z", reqParams)
|
||||
if err == nil {
|
||||
return respBytes, nil
|
||||
}
|
||||
if !errors.Is(err, processors.ErrNotFound) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ProcessQCXGX2X6Request(ctx, reqParams, deps)
|
||||
}
|
||||
Reference in New Issue
Block a user