mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-02-22 15:43:35 +00:00
Add API endpoint for top win-loss CTF records
This commit is contained in:
parent
c8402074b4
commit
1949494098
5 changed files with 271 additions and 58 deletions
|
|
@ -1,9 +1,6 @@
|
|||
import { IsOptional, IsPositive, IsNotEmpty, IsIn, Max } from 'class-validator';
|
||||
|
||||
const filterableGameTypes = [
|
||||
'CTFGame',
|
||||
'LakRabbitGame'
|
||||
] as const;
|
||||
const filterableGameTypes = ['CTFGame', 'LakRabbitGame'] as const;
|
||||
|
||||
type FilterableGameType = typeof filterableGameTypes[number];
|
||||
|
||||
|
|
@ -14,12 +11,12 @@ const hitStats = [
|
|||
'laserHitsTG',
|
||||
'laserMATG',
|
||||
'cgHitsTG',
|
||||
'shockHitsTG'
|
||||
'shockHitsTG',
|
||||
] as const;
|
||||
|
||||
type Stat = typeof hitStats[number];
|
||||
|
||||
export class TopPlayersQueryDto {
|
||||
export class TopAccuracyQueryDto {
|
||||
@IsNotEmpty()
|
||||
@IsIn(hitStats as any)
|
||||
stat: Stat;
|
||||
|
|
@ -41,3 +38,14 @@ export class TopPlayersQueryDto {
|
|||
@Max(100)
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export class TopWinsQueryDto {
|
||||
@IsOptional()
|
||||
@IsPositive()
|
||||
minGames: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsPositive()
|
||||
@Max(100)
|
||||
limit: number;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue