feat: 优化项目目录结构
This commit is contained in:
41
apps/backend/src/resource/entity/resource.entity.ts
Normal file
41
apps/backend/src/resource/entity/resource.entity.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
type ResourceTag = {
|
||||
name: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
@Entity()
|
||||
export class Resource {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
@Index()
|
||||
id: string;
|
||||
|
||||
@Column()
|
||||
title: string;
|
||||
|
||||
@Column()
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
imageUrl: string;
|
||||
|
||||
@Column()
|
||||
link: string;
|
||||
|
||||
@Column('jsonb')
|
||||
tags: ResourceTag[];
|
||||
|
||||
@CreateDateColumn({ precision: 3 })
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn({ precision: 3 })
|
||||
updatedAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user