feat: 创建宠物接口
This commit is contained in:
1 parent
5939e959d9
commit
7c34f8b986
7 files changed
+190
-2
No files matched your search
@@ -0,0 +1,73 @@
|
||||
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 } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class CreatePetRequest {
|
||||
@IsNotEmpty({
|
||||
message: '宠物名称不能为空',
|
||||
})
|
||||
@ApiProperty()
|
||||
name: string;
|
||||
|
||||
@IsNotEmpty({
|
||||
message: '请选择宠物类型',
|
||||
})
|
||||
@ApiProperty()
|
||||
type: PetType;
|
||||
|
||||
@IsNotEmpty({
|
||||
message: '请选择性别',
|
||||
})
|
||||
@ApiProperty()
|
||||
gender: Gender;
|
||||
|
||||
@IsNotEmpty({
|
||||
message: '生日不能为空',
|
||||
})
|
||||
@ApiProperty()
|
||||
birthday: string;
|
||||
|
||||
@IsNotEmpty({
|
||||
message: '体重不能为空',
|
||||
})
|
||||
@ApiProperty()
|
||||
weight: number;
|
||||
|
||||
@IsNotEmpty({
|
||||
message: '照片不能为空',
|
||||
})
|
||||
@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;
|
||||
}
|
||||
Reference in new issue
Block a user