feat(mining-wallet): make initialize endpoints public for internal network calls
Changed system-accounts/initialize and pool-accounts/initialize endpoints from @AdminOnly to @Public to allow deploy scripts to call them without authentication. These endpoints are only accessible from internal network. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6ec79a6672
commit
77b682c8a8
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue