import { ApiProperty } from '@midwayjs/swagger'; import { Rule, RuleType } from '@midwayjs/validate'; export class LoginResDTO { @ApiProperty({ type: String }) token: string; @ApiProperty({ type: Number }) userId: number; @ApiProperty({ type: String }) username: string; @ApiProperty({ type: String, isArray: true }) permissions: string[]; } export class LoginDTO { @ApiProperty({ type: String }) @Rule(RuleType.string()) username: string; @ApiProperty({ type: String }) @Rule(RuleType.string()) password: string; }