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

19 lines
505 B
TypeScript
Raw Normal View History

2024-09-01 12:55:05 +00:00
import { Column, Entity, ManyToMany, OneToMany, PrimaryColumn } from "typeorm";
2024-08-27 15:54:59 +00:00
import { user } from "./user";
2024-09-01 12:55:05 +00:00
import { rolePermission } from "./role_permission";
2024-08-27 15:54:59 +00:00
@Entity()
export class role {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255 })
role: string;
@ManyToMany(() => user, (user) => user.roles)
users: user[];
2024-09-01 12:55:05 +00:00
@OneToMany(() => rolePermission, (rolePermission) => rolePermission.role)
permissions: rolePermission[];
2024-08-27 15:54:59 +00:00
}