mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-03-06 05:00:22 +00:00
Add accuracy leaderboard: players/top/accuracy endpoint
This commit is contained in:
parent
1015e4b8d4
commit
7504d1497c
3 changed files with 192 additions and 0 deletions
43
app/api/src/common/dto/top-players-query.dto.ts
Normal file
43
app/api/src/common/dto/top-players-query.dto.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { IsOptional, IsPositive, IsNotEmpty, IsIn, Max } from 'class-validator';
|
||||
|
||||
const filterableGameTypes = [
|
||||
'CTFGame',
|
||||
'LakRabbitGame'
|
||||
] as const;
|
||||
|
||||
type FilterableGameType = typeof filterableGameTypes[number];
|
||||
|
||||
const hitStats = [
|
||||
'discHitsTG',
|
||||
'discDmgHitsTG',
|
||||
'discMATG',
|
||||
'laserHitsTG',
|
||||
'laserMATG',
|
||||
'cgHitsTG',
|
||||
'shockHitsTG'
|
||||
] as const;
|
||||
|
||||
type Stat = typeof hitStats[number];
|
||||
|
||||
export class TopPlayersQueryDto {
|
||||
@IsNotEmpty()
|
||||
@IsIn(hitStats as any)
|
||||
stat: Stat;
|
||||
|
||||
@IsOptional()
|
||||
@IsIn(filterableGameTypes as any)
|
||||
gameType: FilterableGameType;
|
||||
|
||||
@IsOptional()
|
||||
@IsPositive()
|
||||
minGames: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsPositive()
|
||||
minShots: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsPositive()
|
||||
@Max(100)
|
||||
limit: number;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue