78 lines
1.4 KiB
TypeScript
78 lines
1.4 KiB
TypeScript
import { PetType } from '@/pet-feeder/enum/pet-type';
|
|
import { Gender } from '@/core/enum/Gender';
|
|
import { PetBodyType } from '@/pet-feeder/enum/pet-body-type';
|
|
import { IsNotEmpty, IsOptional } from 'class-validator';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
export class CreatePetRequest {
|
|
@IsNotEmpty({
|
|
message: '宠物名称不能为空',
|
|
})
|
|
@ApiProperty()
|
|
name: string;
|
|
|
|
@IsNotEmpty({
|
|
message: '请选择宠物类型',
|
|
})
|
|
@ApiProperty()
|
|
type: PetType;
|
|
|
|
@IsNotEmpty({
|
|
message: '请选择品种',
|
|
})
|
|
@ApiProperty()
|
|
varietyName: string;
|
|
|
|
@IsNotEmpty({
|
|
message: '请选择性别',
|
|
})
|
|
@ApiProperty()
|
|
gender: Gender;
|
|
|
|
@IsNotEmpty({
|
|
message: '生日不能为空',
|
|
})
|
|
@ApiProperty()
|
|
birthday: string;
|
|
|
|
@IsNotEmpty({
|
|
message: '体重不能为空',
|
|
})
|
|
@ApiProperty()
|
|
weight: number;
|
|
|
|
@IsOptional()
|
|
@ApiProperty()
|
|
photo: string;
|
|
|
|
@IsNotEmpty({
|
|
message: '是否活跃不能为空',
|
|
})
|
|
@ApiProperty()
|
|
isActive: boolean;
|
|
|
|
@IsNotEmpty({
|
|
message: '是否怀孕不能为空',
|
|
})
|
|
@ApiProperty()
|
|
isPregnant: boolean;
|
|
|
|
@IsNotEmpty({
|
|
message: '是否绝育不能为空',
|
|
})
|
|
@ApiProperty()
|
|
isSterilization: boolean;
|
|
|
|
@IsNotEmpty({
|
|
message: '是否在哺乳不能为空',
|
|
})
|
|
@ApiProperty()
|
|
isLactation: boolean;
|
|
|
|
@IsNotEmpty({
|
|
message: '请选择体型',
|
|
})
|
|
@ApiProperty()
|
|
bodyType: PetBodyType;
|
|
}
|