f
This commit is contained in:
@@ -18,11 +18,11 @@ type ApiCallValidationResult struct {
|
|||||||
ErrorMessage string `json:"error_message"`
|
ErrorMessage string `json:"error_message"`
|
||||||
|
|
||||||
// 新增字段
|
// 新增字段
|
||||||
ContractCode string `json:"contract_code"`
|
ContractCode string `json:"contract_code"`
|
||||||
ApiCall *api_entities.ApiCall `json:"api_call"`
|
ApiCall *api_entities.ApiCall `json:"api_call"`
|
||||||
RequestParams map[string]interface{} `json:"request_params"`
|
RequestParams map[string]interface{} `json:"request_params"`
|
||||||
Product *product_entities.Product `json:"product"`
|
Product *product_entities.Product `json:"product"`
|
||||||
Subscription *product_entities.Subscription `json:"subscription"`
|
Subscription *product_entities.Subscription `json:"subscription"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserID 获取用户ID
|
// GetUserID 获取用户ID
|
||||||
@@ -99,6 +99,6 @@ func (r *ApiCallValidationResult) SetContractCode(code string) {
|
|||||||
// SetSubscription 设置订阅信息(包含实际扣费金额)
|
// SetSubscription 设置订阅信息(包含实际扣费金额)
|
||||||
func (r *ApiCallValidationResult) SetSubscription(subscription *product_entities.Subscription) {
|
func (r *ApiCallValidationResult) SetSubscription(subscription *product_entities.Subscription) {
|
||||||
r.SubscriptionID = subscription.ID
|
r.SubscriptionID = subscription.ID
|
||||||
r.Amount = subscription.Price // 使用订阅价格作为扣费金额
|
r.Amount = subscription.Price // 使用订阅价格作为扣费金额
|
||||||
r.Subscription = subscription
|
r.Subscription = subscription
|
||||||
}
|
}
|
||||||
@@ -44,5 +44,13 @@ func ProcessIVYZX5Q2Request(ctx context.Context, params []byte, deps *processors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// result==2 时手动抛出错误(不通过/无记录,不返回正常响应)
|
||||||
|
var ProcessIVYZX5Q2Request struct {
|
||||||
|
Result int `json:"result"`
|
||||||
|
}
|
||||||
|
if err := json.Unmarshal(respBytes, &ProcessIVYZX5Q2Request); err == nil && ProcessIVYZX5Q2Request.Result == 2 {
|
||||||
|
return nil, errors.Join(processors.ErrNotFound, errors.New("活体检测 result=2 无记录或不通过"))
|
||||||
|
}
|
||||||
|
|
||||||
return respBytes, nil
|
return respBytes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user