diff --git a/backend/services/planting-service/src/pre-planting/api/controllers/pre-planting.controller.ts b/backend/services/planting-service/src/pre-planting/api/controllers/pre-planting.controller.ts index 2399ead1..e4afff0d 100644 --- a/backend/services/planting-service/src/pre-planting/api/controllers/pre-planting.controller.ts +++ b/backend/services/planting-service/src/pre-planting/api/controllers/pre-planting.controller.ts @@ -66,6 +66,13 @@ export class PrePlantingController { return { success: true }; } + @Get('eligibility') + @ApiOperation({ summary: '查询当前用户预种购买资格' }) + @ApiResponse({ status: HttpStatus.OK, description: '资格信息' }) + async getEligibility(@Req() req: AuthenticatedRequest) { + return this.prePlantingService.getEligibility(req.user.accountSequence); + } + @Get('position') @ApiOperation({ summary: '获取预种持仓信息' }) @ApiResponse({ status: HttpStatus.OK, description: '持仓信息' }) diff --git a/frontend/mobile-app/lib/core/services/pre_planting_service.dart b/frontend/mobile-app/lib/core/services/pre_planting_service.dart index 008eec84..2cfe440a 100644 --- a/frontend/mobile-app/lib/core/services/pre_planting_service.dart +++ b/frontend/mobile-app/lib/core/services/pre_planting_service.dart @@ -10,14 +10,14 @@ import '../network/api_client.dart'; // // === API 端点 === // 所有端点走 planting-service 的 PrePlantingModule: +// - GET /pre-planting/config 获取预种开关状态(public controller) +// - GET /pre-planting/eligibility 检查购买资格 // - GET /pre-planting/position 获取预种持仓 -// - GET /pre-planting/config 获取预种开关状态 -// - POST /pre-planting/orders 创建预种订单 -// - POST /pre-planting/orders/:no/pay 支付预种订单 // - GET /pre-planting/orders 获取预种订单列表 // - GET /pre-planting/merges 获取合并记录列表 -// - GET /pre-planting/merges/:id 获取合并详情 -// - POST /pre-planting/merges/:id/sign 签署合并合同 +// - GET /pre-planting/merges/:no 获取合并详情 +// - POST /pre-planting/purchase 创建预种订单(购买) +// - POST /pre-planting/sign-contract 签署合并合同 // // === 与现有 PlantingService 的关系 === // 完全独立。PlantingService 处理整棵树认种(15831 USDT/棵), @@ -386,7 +386,7 @@ class PrePlantingService { if (cityName != null) data['cityName'] = cityName; final response = await _apiClient.post( - '/pre-planting/orders', + '/pre-planting/purchase', data: data, ); @@ -496,7 +496,8 @@ class PrePlantingService { try { debugPrint('[PrePlantingService] 签署合并合同: mergeNo=$mergeNo'); final response = await _apiClient.post( - '/pre-planting/merges/$mergeNo/sign', + '/pre-planting/sign-contract', + data: {'mergeNo': mergeNo}, ); if (response.statusCode == 200) {