From 6b8e7eada68f3f02619c995be89403161e877365 Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Mon, 2 Mar 2026 16:51:05 +0800 Subject: [PATCH] f --- .../internal/logic/query/queryservicelogic.go | 16 ++++++++++++++++ .../api/internal/service/apirequestService.go | 18 ++++++++++++++++++ app/main/api/internal/types/query.go | 6 ++++++ 3 files changed, 40 insertions(+) diff --git a/app/main/api/internal/logic/query/queryservicelogic.go b/app/main/api/internal/logic/query/queryservicelogic.go index 8dea389..198209c 100644 --- a/app/main/api/internal/logic/query/queryservicelogic.go +++ b/app/main/api/internal/logic/query/queryservicelogic.go @@ -62,6 +62,7 @@ var productHandlers = map[string]queryHandlerFunc{ "preloanbackgroundcheck": runMarriageReq, "backgroundcheck": runMarriageReq, "personalData": runMarriageReq, + "toc_PersonalBadRecord": runPersonalBadRecordReq, "toc_PersonalLawsuit": runMarriageReq, "toc_EnterpriseLawsuit": runEntLawsuitReq, // 人企关系加强版:仅身份证号 @@ -276,6 +277,21 @@ func runLimitHighExecutedReq(l *QueryServiceLogic, decryptData []byte, product s }, nil } +// 本人不良 FLXGDEA9:姓名 + 身份证(授权由 ApiRequest 默认传 1) +func runPersonalBadRecordReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) { + var data types.PersonalBadRecordReq + if unmarshalErr := json.Unmarshal(decryptData, &data); unmarshalErr != nil { + return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "查询服务, 解密后的数据格式不正确: %+v", unmarshalErr) + } + if validatorErr := validator.Validate(data); validatorErr != nil { + return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.PARAM_VERIFICATION_ERROR, validatorErr.Error()), "查询服务, 参数不正确: %+v", validatorErr) + } + return map[string]interface{}{ + "name": data.Name, + "id_card": data.IDCard, + }, nil +} + // 失信被执行人 QYGL2S0W func runDishonestExecutedReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) { var data types.DishonestExecutedReq diff --git a/app/main/api/internal/service/apirequestService.go b/app/main/api/internal/service/apirequestService.go index 81b34c1..bce55a1 100644 --- a/app/main/api/internal/service/apirequestService.go +++ b/app/main/api/internal/service/apirequestService.go @@ -269,6 +269,7 @@ var requestProcessors = map[string]func(*ApiRequestService, []byte) ([]byte, err "QYGL66SL": (*ApiRequestService).ProcessQYGL66SLRequest, "FLXG3A9B": (*ApiRequestService).ProcessFLXG3A9BRequest, "QYGL2S0W": (*ApiRequestService).ProcessQYGL2S0WRequest, + "FLXGDEA9": (*ApiRequestService).ProcessFLXGDEA9Request, } // PreprocessRequestApi 调用指定的请求处理函数 @@ -1505,6 +1506,23 @@ func (a *ApiRequestService) ProcessQYGL2S0WRequest(params []byte) ([]byte, error return a.processVerifyPassThrough(params, "QYGL2S0W") } +// FLXGDEA9 本人不良 +func (a *ApiRequestService) ProcessFLXGDEA9Request(params []byte) ([]byte, error) { + var m map[string]interface{} + if err := json.Unmarshal(params, &m); err != nil { + return nil, fmt.Errorf("api请求, FLXGDEA9, 解析参数失败: %w", err) + } + // 授权由后端默认传 1,前端与查询服务不再感知 authorized + if v, ok := m["authorized"]; !ok || v == "" { + m["authorized"] = "1" + } + resp, err := a.tianyuanapi.CallInterface("FLXGDEA9", m) + if err != nil { + return nil, err + } + return convertTianyuanResponse(resp) +} + // buildVehicleBody 从 params 中取 required 与 optional 键,仅非空才写入 body func buildVehicleBody(params []byte, required, optional []string) map[string]interface{} { body := make(map[string]interface{}) diff --git a/app/main/api/internal/types/query.go b/app/main/api/internal/types/query.go index 78c90e0..2ffd461 100644 --- a/app/main/api/internal/types/query.go +++ b/app/main/api/internal/types/query.go @@ -85,6 +85,12 @@ type DishonestExecutedReq struct { IDCard string `json:"id_card" validate:"required,idCard"` } +// PersonalBadRecord 本人不良(FLXGDEA9):姓名 + 身份证(授权由 ApiRequest 默认传 1) +type PersonalBadRecordReq struct { + Name string `json:"name" validate:"required,name"` + IDCard string `json:"id_card" validate:"required,idCard"` +} + // TocPersonEnterprisePro 人企关系加强版预查询:仅身份证号 type TocPersonEnterpriseProReq struct { IDCard string `json:"id_card" validate:"required,idCard"`