hrms-api-org/src/entities/ApiName.ts

39 lines
783 B
TypeScript
Raw Normal View History

2024-12-04 21:18:10 +07:00
import { Entity, Column, ManyToMany, JoinTable, OneToMany } from "typeorm";
2024-11-27 13:53:49 +07:00
import { EntityBase } from "./base/Base";
import { ApiKey } from "./ApiKey";
2024-12-04 21:18:10 +07:00
import { ApiHistory } from "./ApiHistory";
2024-11-27 13:53:49 +07:00
@Entity("apiName")
export class ApiName extends EntityBase {
@Column({
nullable: true,
comment: "ชื่อ",
length: 255,
default: null,
})
name: string;
@Column({
nullable: true,
comment: "path",
length: 255,
default: null,
})
pathApi: string;
@Column({
nullable: true,
comment: "method",
length: 255,
default: null,
})
methodApi: string;
@ManyToMany(() => ApiKey, (apiKey) => apiKey.apiNames)
@JoinTable()
apiKeys: ApiKey[];
2024-12-04 21:18:10 +07:00
@OneToMany(() => ApiHistory, (v) => v.apiName)
apiHistorys: ApiHistory[];
2024-11-27 13:53:49 +07:00
}