feat: 创建产品接口
This commit is contained in:
1 parent
7c34f8b986
commit
8d72401f74
13 files changed
+217
-11
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { BaseEntity } from '@/core/entity/base.entity';
|
||||
import { Column, Entity, OneToMany } from 'typeorm';
|
||||
import { FeedingPlanProduct } from '@/pet-feeder/entity/feeding-plan-product.entity';
|
||||
|
||||
@Entity()
|
||||
export class Product extends BaseEntity {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
photo: string;
|
||||
|
||||
@Column({
|
||||
type: 'json',
|
||||
})
|
||||
tags: string[];
|
||||
|
||||
@Column()
|
||||
totalCalories: number;
|
||||
|
||||
@Column()
|
||||
totalWeight: number;
|
||||
|
||||
@OneToMany(
|
||||
() => FeedingPlanProduct,
|
||||
(feedingPlanProduct) => feedingPlanProduct.feedingPlan,
|
||||
{ cascade: true },
|
||||
)
|
||||
feedingPlanProducts: FeedingPlanProduct[];
|
||||
}
|
||||
Reference in new issue
Block a user