37 lines
749 B
TypeScript
37 lines
749 B
TypeScript
|
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: "" })
|
||
|
headerHTML: string;
|
||
|
|
||
|
@Column({ type: "text", default: "" })
|
||
|
bodyHTML: string;
|
||
|
|
||
|
@Column({ type: "text", default: "" })
|
||
|
footerHTML: string;
|
||
|
}
|