This commit is contained in:
2026-07-23 15:32:41 +08:00
parent fdde1f4421
commit 9756cf6ba8
9 changed files with 193 additions and 0 deletions

View File

@@ -80,6 +80,18 @@ func requestParamsForLog(params map[string]interface{}) map[string]interface{} {
return out
}
// queryBillingProductCodes 查询计费产品:查空(code=1000)仍按成功返回空数据,由平台侧计费
// 与 hyapi 侧 jiyi.queryBillingAPIKeys 对齐洞侦1.0、借贷意向验证3.0 查空计费全景雷达BH(JRZQP8D2) 查空不计费
var queryBillingProductCodes = map[string]struct{}{
"JRZQK9P2": {}, // 洞侦1.0hyapi jy000022
"JRZQR4N7": {}, // 借贷意向验证3.0hyapi jy000042
}
func isQueryBillingProduct(productCode string) bool {
_, ok := queryBillingProductCodes[productCode]
return ok
}
// CallAPI 调用海宇平台指定产品(产品编号与处理器 ApiCode 一致)
func (s *HaiyuapiService) CallAPI(ctx context.Context, productCode string, params map[string]interface{}) ([]byte, error) {
startTime := time.Now()
@@ -176,6 +188,10 @@ func (s *HaiyuapiService) CallAPI(ctx context.Context, productCode string, param
}
if outer.Code != CodeSuccess {
// 查询计费产品:查空仍返回空数据,由平台计费(对齐 hyapi
if outer.Code == CodeQueryEmpty && isQueryBillingProduct(productCode) {
return []byte("{}"), nil
}
mappedErr := mapBusinessError(outer.Code, outer.Message)
if s.logger != nil {
s.logger.LogError(requestID, transactionID, productCode, mappedErr, map[string]interface{}{