ff-admin-server/src/entity/template.ts

31 lines
617 B
TypeScript
Raw Normal View History

2024-12-22 09:29:42 +00:00
import { Column, Entity, PrimaryColumn } from "typeorm";
@Entity()
export class template {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255 })
template: string;
@Column({ type: "varchar", length: 255, nullable: true })
description?: string;
@Column({
type: "text",
default: "{}",
transformer: {
to(value: object) {
return JSON.stringify(value);
},
from(value: string) {
return JSON.parse(value);
},
},
})
design: object;
@Column({ type: "text", default: "" })
2024-12-22 16:29:11 +00:00
html: string;
2024-12-22 09:29:42 +00:00
}