fix(admin-service): admin config 端点也返回 agreementText

planting-service 调用的是 admin 控制器的 getConfig()(非 public 控制器),
因为 public 控制器有双重 api/v1 前缀。确保 admin getConfig 也包含协议文本。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-26 22:01:03 -08:00
parent 5131728835
commit 7c95d1d425
1 changed files with 4 additions and 2 deletions

View File

@ -41,10 +41,12 @@ export class PrePlantingConfigController {
) {} ) {}
@Get('config') @Get('config')
@ApiOperation({ summary: '获取预种计划开关状态' }) @ApiOperation({ summary: '获取预种计划开关状态(含协议文本)' })
@ApiResponse({ status: HttpStatus.OK, description: '开关状态' }) @ApiResponse({ status: HttpStatus.OK, description: '开关状态' })
async getConfig() { async getConfig() {
return this.configService.getConfig(); const config = await this.configService.getConfig();
const agreementText = await this.configService.getAgreement();
return { ...config, agreementText };
} }
@Post('config') @Post('config')