From 1cc27731d9067350d8beb45c149cc8759dfd17fa Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 17 Dec 2025 01:10:03 -0800 Subject: [PATCH] =?UTF-8?q?fix(planting):=20=E7=A7=BB=E9=99=A4=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E6=9C=80=E5=A4=A7=E8=AE=A4=E7=A7=8D=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除 MAX_TREES_PER_USER = 1000 的限制和 checkRiskControl 方法 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../services/planting-application.service.ts | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/backend/services/planting-service/src/application/services/planting-application.service.ts b/backend/services/planting-service/src/application/services/planting-application.service.ts index 86ef36d8..f3c8ab1b 100644 --- a/backend/services/planting-service/src/application/services/planting-application.service.ts +++ b/backend/services/planting-service/src/application/services/planting-application.service.ts @@ -24,9 +24,6 @@ import { FailureStage, } from '../../infrastructure/persistence/repositories/payment-compensation.repository'; -// 个人最大认种数量限制 -const MAX_TREES_PER_USER = 1000; - export interface CreateOrderResult { orderNo: string; treeCount: number; @@ -84,9 +81,6 @@ export class PlantingApplicationService { ): Promise { this.logger.log(`Creating order for user ${userId}, treeCount: ${treeCount}`); - // 风控检查 - await this.checkRiskControl(userId, treeCount); - // 检查余额 const balance = await this.walletService.getBalance(userId.toString()); const requiredAmount = treeCount * PRICE_PER_TREE; @@ -464,22 +458,6 @@ export class PlantingApplicationService { return { success: true }; } - /** - * 风控检查 - */ - private async checkRiskControl( - userId: bigint, - treeCount: number, - ): Promise { - // 检查用户限购 - const existingCount = await this.orderRepository.countTreesByUserId(userId); - if (existingCount + treeCount > MAX_TREES_PER_USER) { - throw new Error( - `超过个人最大认种数量限制: 已认种 ${existingCount} 棵, 本次 ${treeCount} 棵, 上限 ${MAX_TREES_PER_USER} 棵`, - ); - } - } - /** * 构建 Outbox 事件数据 *