mirror of https://github.com/fantasticit/think.git
server: update length
This commit is contained in:
parent
7be1b6cb9b
commit
b068b4ef06
|
@ -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: '用户账号不能为空' })
|
||||
|
|
|
@ -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)' })
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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: '' })
|
||||
|
|
Loading…
Reference in New Issue