think/packages/server/src/dtos/auth.dto.ts

29 lines
819 B
TypeScript
Raw Normal View History

2022-06-29 16:03:02 +00:00
import { AuthEnum } from '@think/domains';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
export class AuthDto {
@IsString({ message: '权限类型类型错误正确类型为String' })
@IsNotEmpty({ message: '权限类型不能为空' })
auth: AuthEnum;
@IsString({ message: '组织 Id 类型错误正确类型为String' })
@IsNotEmpty({ message: '组织 Id 不能为空' })
organizationId: string;
@IsString({ message: '知识库 Id 类型错误正确类型为String' })
@IsOptional()
wikiId: string;
@IsString({ message: '文档 Id 类型错误正确类型为String' })
@IsOptional()
documentId: string;
}
export class OperateUserAuthDto {
@IsString()
readonly userAuth: AuthEnum;
@IsString()
readonly userName: string;
}