- backend: NestJS service with exercise/plan data - miniprogram: WeChat mini program client - exclude node_modules, dist, runtime data-store, local env
50 lines
823 B
TypeScript
50 lines
823 B
TypeScript
import { IsOptional, IsString, IsInt, Min, Max, IsIn } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class QueryExercisesDto {
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
page = 1;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(50)
|
|
pageSize = 20;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
bodyPart?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
equipment?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
target?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
muscleGroup?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(['strength', 'cardio', 'flexibility'])
|
|
type?: 'strength' | 'cardio' | 'flexibility';
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
secondary?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
q?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(['default', 'name'])
|
|
sort?: 'default' | 'name' = 'default';
|
|
}
|