2024-06-11 11:22:59 +07:00
|
|
|
import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm";
|
|
|
|
|
import { EntityBase } from "./base/Base";
|
|
|
|
|
import { AuthSys } from "./AuthSys";
|
|
|
|
|
import { AuthRole } from "./AuthRole";
|
|
|
|
|
|
2024-06-11 13:19:38 +07:00
|
|
|
@Entity("authRoleAttr")
|
2024-06-11 11:22:59 +07:00
|
|
|
export class AuthRoleAttr extends EntityBase {
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
attrOwnership: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
comment: "",
|
|
|
|
|
default: false,
|
|
|
|
|
})
|
|
|
|
|
attrIsCreate: boolean;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
comment: "",
|
|
|
|
|
default: false,
|
|
|
|
|
})
|
|
|
|
|
attrIsList: boolean;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
comment: "",
|
|
|
|
|
default: false,
|
|
|
|
|
})
|
|
|
|
|
attrIsGet: boolean;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
comment: "",
|
|
|
|
|
default: false,
|
|
|
|
|
})
|
|
|
|
|
attrIsUpdate: boolean;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
comment: "",
|
|
|
|
|
default: false,
|
|
|
|
|
})
|
|
|
|
|
attrIsDelete: boolean;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
attrPrivilege: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 40,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง AuthRole",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
authRoleId: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 255,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง AuthSys",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
authSysId: string;
|
|
|
|
|
|
2024-06-12 10:11:13 +07:00
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 255,
|
|
|
|
|
comment: "Root",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
2024-06-12 10:45:30 +07:00
|
|
|
parentNode?: string;
|
2024-06-12 10:11:13 +07:00
|
|
|
|
2024-06-12 10:50:07 +07:00
|
|
|
// @ManyToOne(() => AuthSys, (authSys) => authSys.authSys)
|
|
|
|
|
// @JoinColumn({ name: "authSysId" })
|
|
|
|
|
// authRoleAttrForSys: AuthSys;
|
2024-06-11 11:22:59 +07:00
|
|
|
|
|
|
|
|
@ManyToOne(() => AuthRole, (authRole) => authRole.authRoles)
|
|
|
|
|
@JoinColumn({ name: "authRoleId" })
|
|
|
|
|
authRoleAttrForRole: AuthRole;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class CreateAuthRoleAttr {
|
|
|
|
|
@Column()
|
|
|
|
|
attrOwnership: string;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
attrIsCreate: boolean;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
attrIsList: boolean;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
attrIsGet: boolean;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
attrIsUpdate: boolean;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
attrIsDelete: boolean;
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
attrPrivilege: string;
|
2024-06-11 15:03:53 +07:00
|
|
|
|
|
|
|
|
@Column("uuid")
|
|
|
|
|
authRoleId: string;
|
|
|
|
|
|
|
|
|
|
@Column("uuid")
|
|
|
|
|
authSysId: string;
|
2024-06-12 10:11:13 +07:00
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
|
parentNode?: string | null;
|
2024-06-11 11:22:59 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type UpdateAuthRoleAttr = Partial<CreateAuthRoleAttr>;
|