Files
tonePage/apps/backend/src/admin/dto/admin-web/create-blog.dto.ts

23 lines
537 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 { IsEnum, IsString } from 'class-validator';
import { BlogPermission } from 'src/blog/blog.permission.enum';
export class CreateBlogDto {
@IsString()
title: string;
@IsString()
slug: string;// 允许空串但如果为空则需要手动设置为null防止数据库唯一键冲突
@IsString()
description: string;
@IsString()
contentUrl: string;
@IsEnum(BlogPermission, { each: true, message: '请求类型错误' })
permissions: BlogPermission[];
@IsString()
password: string; // 允许空串
}