add 全国企业司法模型服务查询_V1

This commit is contained in:
2026-01-05 14:26:26 +08:00
parent fe44b452e3
commit c262894372
10 changed files with 70 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ func ProcessFLXG0V4BRequest(ctx context.Context, params []byte, deps *processors
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
return nil, errors.Join(processors.ErrInvalidParam, err)
}
if paramsDto.IDCard == "350681198611130611" || paramsDto.IDCard == "622301200006250550" {
if paramsDto.IDCard == "350681198611130611" || paramsDto.IDCard == "622301200006250550" {
return nil, errors.Join(processors.ErrNotFound, errors.New("查询为空"))
}
encryptedName, err := deps.WestDexService.Encrypt(paramsDto.Name)

View File

@@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
"tyapi-server/internal/infrastructure/external/westdex"

View File

@@ -23,8 +23,8 @@ func ProcessIVYZ9H2MRequest(ctx context.Context, params []byte, deps *processors
// 构建请求参数
reqData := map[string]interface{}{
"idNo": paramsDto.IDNo,
"name": paramsDto.Name,
"idCard": paramsDto.IDCard,
"name": paramsDto.Name,
}
// 调用极光APIapiCode为 marriage-single-v2

View File

@@ -0,0 +1,53 @@
package qygl
import (
"context"
"encoding/json"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
"tyapi-server/internal/infrastructure/external/xingwei"
)
// Processqygl66slRequest QYGL66SL API处理方法 - 全国企业司法模型服务查询_V1
func ProcessQYGL66SLRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.QYGL66SLReq
if err := json.Unmarshal(params, &paramsDto); err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
return nil, errors.Join(processors.ErrInvalidParam, err)
}
// 构建请求数据,
reqData := map[string]interface{}{
"orgName": paramsDto.EntName,
"inquiredAuth": "authed:" + paramsDto.AuthDate,
"uscc": paramsDto.EntCode,
"authAuthorizeFileCode": paramsDto.AuthAuthorizeFileCode,
}
// 调用行为数据API使用指定的project_id
projectID := "CDJ-1068350101956521984"
respBytes, err := deps.XingweiService.CallAPI(ctx, projectID, reqData)
if err != nil {
if errors.Is(err, xingwei.ErrNotFound) {
// 查空情况,返回特定的查空错误
return nil, errors.Join(processors.ErrNotFound, err)
} else if errors.Is(err, xingwei.ErrDatasource) {
// 数据源错误
return nil, errors.Join(processors.ErrDatasource, err)
} else if errors.Is(err, xingwei.ErrSystem) {
// 系统错误
return nil, errors.Join(processors.ErrSystem, err)
} else {
// 其他未知错误
return nil, errors.Join(processors.ErrSystem, err)
}
}
return respBytes, nil
}

View File

@@ -42,4 +42,4 @@ func ProcessYYSY4B21Request(ctx context.Context, params []byte, deps *processors
}
return respBytes, nil
}
}

View File

@@ -27,7 +27,7 @@ func ProcessYYSY6D9ARequest(ctx context.Context, params []byte, deps *processors
}
reqData := map[string]interface{}{
"phone": encryptedMobileNo,
"phone": encryptedMobileNo,
}
respData, err := deps.ZhichaService.CallAPI(ctx, "ZCI030", reqData)