初始版本,目前线上可用

This commit is contained in:
2025-11-19 12:49:16 +08:00
commit cb7f1c45e8
178 changed files with 30336 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
import dayjs from "dayjs";
export abstract class BaseEntity {
@PrimaryGeneratedColumn({ type: "int", name: "id" })
id: number;
@Column({
type: "datetime",
comment: "创建时间",
default: () => "CURRENT_TIMESTAMP",
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
createDate: Date;
@Column({
type: "datetime",
comment: "更新时间",
default: () => "CURRENT_TIMESTAMP",
transformer: {
to(value: Date) {
return value;
},
from(value) {
return dayjs(new Date(value)).format("YYYY-MM-DD HH:mm:ss");
},
},
})
updateDate: Date;
}