ผูก menu กับ redis

This commit is contained in:
Kittapath 2024-07-25 09:54:44 +07:00
parent 1e3699b049
commit 73ae3210dc
8 changed files with 164 additions and 119 deletions

View file

@ -26,10 +26,10 @@ export class AuthRole extends EntityBase {
authRoles: AuthRoleAttr[];
@OneToMany(() => PosMaster, (posMaster) => posMaster.authRole)
posMaster: PosMaster[];
posMasters: PosMaster[];
@OneToMany(() => EmployeePosMaster, (posMasters) => posMasters.authRole)
posMasterEmp: EmployeePosMaster[];
posMasterEmps: EmployeePosMaster[];
}
export class CreateAuthRole {
@ -48,4 +48,4 @@ export class CreateAddAuthRole {
@Column()
posMasterId: string;
}
}

View file

@ -75,9 +75,9 @@ export class AuthRoleAttr extends EntityBase {
})
parentNode?: string;
// @ManyToOne(() => AuthSys, (authSys) => authSys)
// @JoinColumn({ name: "authSysId" })
// authRoleAttrForSys: AuthSys;
@ManyToOne(() => AuthSys, (authSys) => authSys.authRoleAttrs)
@JoinColumn({ name: "authSysId" })
authRoleAttrForSys: AuthSys;
@ManyToOne(() => AuthRole, (authRole) => authRole.authRoles)
@JoinColumn({ name: "authRoleId" })

View file

@ -1,4 +1,12 @@
import { Entity, Column, CreateDateColumn, UpdateDateColumn, PrimaryColumn } from "typeorm";
import {
Entity,
Column,
CreateDateColumn,
UpdateDateColumn,
PrimaryColumn,
OneToMany,
} from "typeorm";
import { AuthRoleAttr } from "./AuthRoleAttr";
@Entity("authSys")
export class AuthSys {
@ -80,8 +88,8 @@ export class AuthSys {
})
sysDescription: string;
// @OneToMany(() => AuthRoleAttr, (authRoleAttr) => authRoleAttr.authRoleAttrForSys)
// authSys: AuthRoleAttr[];
@OneToMany(() => AuthRoleAttr, (authRoleAttr) => authRoleAttr.authRoleAttrForSys)
authRoleAttrs: AuthRoleAttr[];
}
export class CreateAuthSys {

View file

@ -180,7 +180,7 @@ export class EmployeePosMaster extends EntityBase {
})
authRoleId: string;
@ManyToOne(() => AuthRole, (authRole) => authRole.posMasterEmp)
@ManyToOne(() => AuthRole, (authRole) => authRole.posMasterEmps)
@JoinColumn({ name: "authRoleId" })
authRole: AuthRole;

View file

@ -180,7 +180,7 @@ export class PosMaster extends EntityBase {
})
authRoleId: string;
@ManyToOne(() => AuthRole, (authRole) => authRole.posMaster)
@ManyToOne(() => AuthRole, (authRole) => authRole.posMasters)
@JoinColumn({ name: "authRoleId" })
authRole: AuthRole;