2024-11-27 13:53:49 +07:00
|
|
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
|
|
|
|
import { EntityBase } from "./base/Base";
|
|
|
|
|
import { ApiKey } from "./ApiKey";
|
2024-12-04 21:18:10 +07:00
|
|
|
import { ApiName } from "./ApiName";
|
2024-11-27 13:53:49 +07:00
|
|
|
|
|
|
|
|
@Entity("apiHistory")
|
|
|
|
|
export class ApiHistory extends EntityBase {
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "header",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
headerApi: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "token",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
tokenApi: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "request",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
requestApi: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "response",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
responseApi: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "ip",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
ipApi: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
comment: "code",
|
|
|
|
|
length: 255,
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
codeApi: string;
|
|
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 40,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง ApiKey",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
apiKeyId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => ApiKey, (apiKey) => apiKey.apiHistorys)
|
|
|
|
|
@JoinColumn({ name: "apiKeyId" })
|
|
|
|
|
apiKey: ApiKey;
|
2024-12-04 21:18:10 +07:00
|
|
|
|
|
|
|
|
@Column({
|
|
|
|
|
nullable: true,
|
|
|
|
|
length: 40,
|
|
|
|
|
comment: "คีย์นอก(FK)ของตาราง ApiName",
|
|
|
|
|
default: null,
|
|
|
|
|
})
|
|
|
|
|
apiNameId: string;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(() => ApiName, (apiName) => apiName.apiHistorys)
|
|
|
|
|
@JoinColumn({ name: "apiNameId" })
|
|
|
|
|
apiName: ApiName;
|
2024-11-27 13:53:49 +07:00
|
|
|
}
|