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

29 lines
819 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}