remove throttler

This commit is contained in:
SennayT
2026-07-14 10:30:22 +03:00
parent 3aa4451e00
commit 8f45d7ae1f
7 changed files with 1094 additions and 760 deletions

View File

@@ -1,18 +1,47 @@
import { Body, Controller, Get, Param, Post, Delete, UseGuards, SetMetadata, Query } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
import { Throttle } from '@nestjs/throttler';
import { WalletService } from './wallet.service';
import { JwtGuard } from '../../common/jwt.guard';
import {
Body,
Controller,
Get,
Param,
Post,
Delete,
UseGuards,
SetMetadata,
Query,
} from "@nestjs/common";
import { ApiTags, ApiOperation, ApiBearerAuth } from "@nestjs/swagger";
import { Throttle } from "@nestjs/throttler";
import { WalletService } from "./wallet.service";
import { JwtGuard } from "../../common/jwt.guard";
@ApiTags('Wallet')
@Controller('wallet')
@ApiTags("Wallet")
@Controller("wallet")
@UseGuards(JwtGuard)
@ApiBearerAuth('JWT-auth')
@Throttle({ strict: { limit: 20, ttl: 60_000 } })
@ApiBearerAuth("JWT-auth")
// @Throttle({ strict: { limit: 20, ttl: 60_000 } })
export class WalletController {
constructor(private service: WalletService) {}
@Get('accounts') @SetMetadata('isPublic', true) @ApiOperation({ summary: 'List all wallet accounts' }) getAccounts(@Query() q: any) { return this.service.getAccounts(q); }
@Get(':passengerId') @ApiOperation({ summary: 'Get wallet balance and ledger' }) getWallet(@Param('passengerId') id: string) { return this.service.getWallet(id); }
@Post(':passengerId/topup') @ApiOperation({ summary: 'Top up wallet' }) topUp(@Param('passengerId') id: string, @Body('amountMinor') amount: number) { return this.service.topUp(id, amount); }
@Delete('accounts/:id') @SetMetadata('isPublic', true) @ApiOperation({ summary: 'Delete wallet account' }) deleteAccount(@Param('id') id: string) { return this.service.deleteAccount(id); }
@Get("accounts")
@SetMetadata("isPublic", true)
@ApiOperation({ summary: "List all wallet accounts" })
getAccounts(@Query() q: any) {
return this.service.getAccounts(q);
}
@Get(":passengerId")
@ApiOperation({ summary: "Get wallet balance and ledger" })
getWallet(@Param("passengerId") id: string) {
return this.service.getWallet(id);
}
@Post(":passengerId/topup") @ApiOperation({ summary: "Top up wallet" }) topUp(
@Param("passengerId") id: string,
@Body("amountMinor") amount: number,
) {
return this.service.topUp(id, amount);
}
@Delete("accounts/:id")
@SetMetadata("isPublic", true)
@ApiOperation({ summary: "Delete wallet account" })
deleteAccount(@Param("id") id: string) {
return this.service.deleteAccount(id);
}
}