109 lines
2.4 KiB
TypeScript
109 lines
2.4 KiB
TypeScript
import {
|
|
Entity,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
PrimaryColumn,
|
|
OneToMany,
|
|
} from "typeorm";
|
|
import { AuthRoleAttr } from "./AuthRoleAttr";
|
|
|
|
@Entity("authSys")
|
|
export class AuthSys {
|
|
@PrimaryColumn({
|
|
comment: "ไอดีหลักของตาราง",
|
|
length: 255,
|
|
})
|
|
id: string;
|
|
|
|
@Column({
|
|
comment: "Id ของเมนูหลักถ้าเป็นเมนูหลักจะเป็นค่า null",
|
|
nullable: true,
|
|
default: null,
|
|
length: 255,
|
|
})
|
|
parentId!: string;
|
|
|
|
@Column({
|
|
comment: "ชื่อ icon",
|
|
nullable: true,
|
|
default: null,
|
|
length: 100,
|
|
})
|
|
icon!: string;
|
|
|
|
@Column({
|
|
comment: "path url ของระบบ",
|
|
nullable: true,
|
|
default: null,
|
|
length: 255,
|
|
})
|
|
path!: string;
|
|
|
|
@Column({
|
|
comment: "ลำดับการแสดงผล",
|
|
default: 0,
|
|
})
|
|
order: number;
|
|
|
|
@CreateDateColumn({ comment: "สร้างข้อมูลเมื่อ" })
|
|
createdAt!: Date;
|
|
|
|
@Column({
|
|
comment: "User Id ที่สร้างข้อมูล",
|
|
length: 40,
|
|
default: "00000000-0000-0000-0000-000000000000",
|
|
})
|
|
createdUserId!: String;
|
|
|
|
@UpdateDateColumn({ comment: "แก้ไขข้อมูลล่าสุดเมื่อ" })
|
|
lastUpdatedAt!: Date;
|
|
|
|
@Column({
|
|
comment: "User Id ที่แก้ไขข้อมูล",
|
|
length: 40,
|
|
default: "00000000-0000-0000-0000-000000000000",
|
|
})
|
|
lastUpdateUserId!: String;
|
|
|
|
@Column({ comment: "ชื่อ User ที่สร้างข้อมูล", length: 200, default: "string" })
|
|
createdFullName!: String;
|
|
|
|
@Column({ comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด", length: 200, default: "string" })
|
|
lastUpdateFullName!: String;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "ชื่อระบบ",
|
|
length: 255,
|
|
default: null,
|
|
})
|
|
sysName: string;
|
|
|
|
@Column({
|
|
nullable: true,
|
|
comment: "รายละเอียด",
|
|
length: 255,
|
|
default: null,
|
|
})
|
|
sysDescription: string;
|
|
|
|
@OneToMany(() => AuthRoleAttr, (authRoleAttr) => authRoleAttr.authRoleAttrForSys)
|
|
authRoleAttrs: AuthRoleAttr[];
|
|
}
|
|
|
|
export class CreateAuthSys {
|
|
@PrimaryColumn()
|
|
id: string;
|
|
|
|
@Column()
|
|
parentId: string;
|
|
|
|
@Column()
|
|
sysName: string;
|
|
|
|
@Column()
|
|
sysDescription: string;
|
|
}
|
|
|
|
export type UpdateAuthSys = Partial<CreateAuthSys>;
|