fix(withdrawal): validate callback boundaries

This commit is contained in:
hy001 2026-07-20 16:38:15 +08:00
parent c09787831c
commit 474daa7070

View File

@ -51,7 +51,10 @@ public class WithdrawalReviewIntegrationController {
ResponseAssert.isTrue(ResponseErrorCode.REQUEST_PARAMETER_ERROR,
"withdrawal approval credential is required",
!"PASS".equals(request.getDecision())
|| (request.getCredentialUrls() != null && !request.getCredentialUrls().isEmpty()));
|| (request.getCredentialUrls() != null
&& !request.getCredentialUrls().isEmpty()
&& request.getCredentialUrls().stream()
.allMatch(url -> url != null && !url.isBlank())));
long sourceApplicationId;
try {
@ -62,6 +65,9 @@ public class WithdrawalReviewIntegrationController {
// failure 必然抛出 ResponseException赋值只为满足 Java 的确定赋值检查
sourceApplicationId = 0L;
}
// 来源申请号来自跨系统字符串契约数值可解析不等于合法主键必须在拿锁和查库前拦截非正数
ResponseAssert.isTrue(ResponseErrorCode.REQUEST_PARAMETER_ERROR,
"invalid source withdrawal application id", sourceApplicationId > 0L);
userBankBalanceBackService.approvalMoneyApply(new ApprovalMoneyApplyCmd()
.setId(sourceApplicationId)
.setCredential(request.getCredentialUrls())