server: update length

This commit is contained in:
fantasticit 2022-07-02 07:48:08 +08:00
parent 7be1b6cb9b
commit b068b4ef06
4 changed files with 5 additions and 7 deletions

View File

@ -1,10 +1,9 @@
import { IsEmail, IsNotEmpty, IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
import { IsEmail, IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator';
/**
*
*/
export class RegisterUserDto {
@MaxLength(20, { message: '用户账号最多20个字符' })
@MinLength(5, { message: '用户账号至少5个字符' })
@IsString({ message: '用户名称类型错误正确类型为String' })
@IsNotEmpty({ message: '用户账号不能为空' })

View File

@ -1,10 +1,9 @@
import { IsNotEmpty, IsString, MaxLength, MinLength } from 'class-validator';
import { IsNotEmpty, IsString, MinLength } from 'class-validator';
export class LoginUserDto {
@IsString({ message: '用户名称类型错误正确类型为String' })
@IsNotEmpty({ message: '用户账号不能为空' })
@MinLength(5, { message: '用户账号至少5个字符' })
@MaxLength(20, { message: '用户账号最多20个字符' })
readonly name: string;
@IsString({ message: '用户密码类型错误正确类型为String' })

View File

@ -4,7 +4,7 @@ export class TemplateDto {
@IsString({ message: '名称类型错误正确类型为String' })
@IsNotEmpty({ message: '名称不能为空' })
@MinLength(1, { message: '名称至少1个字符' })
@MaxLength(50, { message: '名称最多50个字符' })
@MaxLength(100, { message: '名称最多100个字符' })
readonly title: string;
@IsOptional()

View File

@ -21,11 +21,11 @@ export class UserEntity {
@PrimaryGeneratedColumn('uuid')
public id: string;
@Column({ type: 'varchar', length: 200, comment: '用户名称' })
@Column({ type: 'varchar', length: 500, comment: '用户名称' })
public name: string;
@Exclude({ toPlainOnly: true })
@Column({ type: 'varchar', length: 200, comment: '用户加密密码' })
@Column({ type: 'varchar', length: 500, comment: '用户加密密码' })
public password: string;
@Column({ type: 'varchar', length: 500, comment: '头像地址', default: '' })