46 lines
652 B
TypeScript
46 lines
652 B
TypeScript
import { Type } from 'class-transformer';
|
|
import {
|
|
IsInt,
|
|
IsOptional,
|
|
IsString,
|
|
MaxLength,
|
|
Min,
|
|
MinLength,
|
|
} from 'class-validator';
|
|
|
|
export class ListMemoryQueryDto {
|
|
@IsString()
|
|
@MinLength(1)
|
|
personId!: string;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
page?: number;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
limit?: number;
|
|
}
|
|
|
|
export class CreateMemoryItemDto {
|
|
@IsString()
|
|
@MinLength(1)
|
|
personId!: string;
|
|
|
|
@IsString()
|
|
@MinLength(2)
|
|
@MaxLength(500)
|
|
content!: string;
|
|
}
|
|
|
|
export class UpdateMemoryItemDto {
|
|
@IsString()
|
|
@MinLength(2)
|
|
@MaxLength(500)
|
|
content!: string;
|
|
}
|