diff --git a/backend/services/mining-wallet-service/src/api/controllers/pool-account.controller.ts b/backend/services/mining-wallet-service/src/api/controllers/pool-account.controller.ts index 1b9d5775..0d85005b 100644 --- a/backend/services/mining-wallet-service/src/api/controllers/pool-account.controller.ts +++ b/backend/services/mining-wallet-service/src/api/controllers/pool-account.controller.ts @@ -1,7 +1,7 @@ import { Controller, Get, Post, Body, Param, Query } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; import { PoolAccountService } from '../../application/services/pool-account.service'; -import { AdminOnly } from '../../shared/guards/jwt-auth.guard'; +import { AdminOnly, Public } from '../../shared/guards/jwt-auth.guard'; import { PoolAccountType, TransactionType } from '@prisma/client'; import Decimal from 'decimal.js'; @@ -73,8 +73,8 @@ export class PoolAccountController { } @Post('initialize') - @AdminOnly() - @ApiOperation({ summary: '初始化池账户' }) + @Public() + @ApiOperation({ summary: '初始化池账户(仅限内网调用)' }) @ApiResponse({ status: 201, description: '池账户初始化成功' }) async initialize(@Body() dto: InitializePoolsDto) { return this.poolAccountService.initializePools({ diff --git a/backend/services/mining-wallet-service/src/api/controllers/system-account.controller.ts b/backend/services/mining-wallet-service/src/api/controllers/system-account.controller.ts index fa368221..0c4cbffe 100644 --- a/backend/services/mining-wallet-service/src/api/controllers/system-account.controller.ts +++ b/backend/services/mining-wallet-service/src/api/controllers/system-account.controller.ts @@ -1,7 +1,7 @@ import { Controller, Get, Post, Body, Param, Query } from '@nestjs/common'; import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger'; import { SystemAccountService } from '../../application/services/system-account.service'; -import { AdminOnly } from '../../shared/guards/jwt-auth.guard'; +import { AdminOnly, Public } from '../../shared/guards/jwt-auth.guard'; import { SystemAccountType } from '@prisma/client'; class InitializeSystemAccountsDto { @@ -47,8 +47,8 @@ export class SystemAccountController { } @Post('initialize') - @AdminOnly() - @ApiOperation({ summary: '初始化核心系统账户' }) + @Public() + @ApiOperation({ summary: '初始化核心系统账户(仅限内网调用)' }) @ApiResponse({ status: 201, description: '系统账户初始化成功' }) async initialize(@Body() dto: InitializeSystemAccountsDto) { return this.systemAccountService.initializeCoreAccounts(dto);