src/user/dtos/top-users.dto.ts
Properties |
Accessors |
| Readonly Optional limit |
Type : number
|
Default value : 50
|
Decorators :
@ApiPropertyOptional({minimum: 1, maximum: 1000, default: 10, type: 'integer'})
|
|
Defined in src/user/dtos/top-users.dto.ts:36
|
| Readonly Optional page |
Type : number
|
Default value : 1
|
Decorators :
@ApiPropertyOptional({minimum: 1, default: 1, type: 'integer'})
|
|
Defined in src/user/dtos/top-users.dto.ts:15
|
| Readonly Optional userId |
Type : number
|
Default value : 0
|
Decorators :
@ApiPropertyOptional({description: 'User ID to filter followings from the list', type: 'integer'})
|
|
Defined in src/user/dtos/top-users.dto.ts:23
|
| skip |
getskip()
|
|
Defined in src/user/dtos/top-users.dto.ts:38
|
import { ApiPropertyOptional } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsInt, Min, IsOptional, Max } from "class-validator";
export class TopUsersDto {
@ApiPropertyOptional({
minimum: 1,
default: 1,
type: "integer",
})
@Type(() => Number)
@IsInt()
@Min(1)
@IsOptional()
readonly page?: number = 1;
@ApiPropertyOptional({
description: "User ID to filter followings from the list",
type: "integer",
})
@IsOptional()
@Type(() => Number)
readonly userId?: number = 0;
@ApiPropertyOptional({
minimum: 1,
maximum: 1000,
default: 10,
type: "integer",
})
@Type(() => Number)
@IsInt()
@Min(1)
@Max(10000)
@IsOptional()
readonly limit?: number = 50;
get skip(): number {
return ((this.page ?? 1) - 1) * (this.limit ?? 50);
}
}