This commit is contained in:
2025-08-18 18:56:00 +08:00
parent 0b0548d495
commit 13074b4ac2

View File

@@ -99,6 +99,9 @@ func (a *ApiRequestService) ProcessRequests(params []byte, productID int64) ([]b
go func(i int, feature *model.Feature) {
defer wg.Done()
// 错开并发请求时间每个请求之间固定延迟50毫秒
time.Sleep(50 * time.Millisecond)
select {
case <-ctx.Done():
return
@@ -388,6 +391,10 @@ func (a *ApiRequestService) ProcessPersonEnterpriseProRequest(params []byte) ([]
wg.Add(1)
go func(origIndex int, companyInfo gjson.Result) {
defer wg.Done()
// 错开并发请求时间每个请求之间固定延迟50毫秒
time.Sleep(50 * time.Millisecond)
logx.Infof("开始处理企业[%d],企业名称: %s统一社会信用代码: %s", origIndex, companyInfo.Get("basicInfo.name").String(), companyInfo.Get("basicInfo.creditCode").String())
// 提取企业名称和统一社会信用代码
orgName := companyInfo.Get("basicInfo.name")
@@ -415,8 +422,9 @@ func (a *ApiRequestService) ProcessPersonEnterpriseProRequest(params []byte) ([]
// 调用QYGL8271接口获取企业涉诉信息
lawsuitResp, err := a.tianyuanapi.CallInterface("QYGL8271", map[string]interface{}{
"ent_name": orgName.String(),
"ent_code": creditCode.String(),
"ent_name": orgName.String(),
"ent_code": creditCode.String(),
"auth_date": generateAuthDateRange(),
})
// 无论是否有错误,都继续处理
if err != nil {
@@ -540,8 +548,8 @@ func (a *ApiRequestService) ProcessPersonEnterpriseProRequest(params []byte) ([]
func (a *ApiRequestService) ProcesFLXG0V4BRequest(params []byte) ([]byte, error) {
name := gjson.GetBytes(params, "name")
idCard := gjson.GetBytes(params, "id_card")
if !name.Exists() || !idCard.Exists(){
return nil, errors.New("api请求, BehaviorRiskScan, 获取相关参数失败")
if !name.Exists() || !idCard.Exists() {
return nil, errors.New("api请求, FLXG0V4B, 获取相关参数失败")
}
resp, err := a.tianyuanapi.CallInterface("FLXG0V4B", map[string]interface{}{
@@ -558,6 +566,7 @@ func (a *ApiRequestService) ProcesFLXG0V4BRequest(params []byte) ([]byte, error)
}
return respBytes, nil
}
// ProcessFLXG0687Request 反诈反赌核验
func (a *ApiRequestService) ProcessFLXG0687Request(params []byte) ([]byte, error) {
idCard := gjson.GetBytes(params, "id_card")