add api web service
This commit is contained in:
parent
dab30e6325
commit
89d22b0274
4 changed files with 779 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { ApiAttribute } from "./ApiAttribute";
|
||||
import { Entity, Column, ManyToMany, JoinTable, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { ApiKey } from "./ApiKey";
|
||||
|
|
@ -29,10 +30,61 @@ export class ApiName extends EntityBase {
|
|||
})
|
||||
methodApi: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
comment: "code สำหรับการเรียก API",
|
||||
length: 8,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
comment: "code ระบบสำหรับการเรียก API",
|
||||
length: 50,
|
||||
default: "registry",
|
||||
})
|
||||
system: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
comment: "สถานะการใช้งาน",
|
||||
type: "boolean",
|
||||
default: false,
|
||||
})
|
||||
isActive: boolean;
|
||||
|
||||
@ManyToMany(() => ApiKey, (apiKey) => apiKey.apiNames)
|
||||
@JoinTable()
|
||||
apiKeys: ApiKey[];
|
||||
|
||||
@OneToMany(() => ApiHistory, (v) => v.apiName)
|
||||
apiHistorys: ApiHistory[];
|
||||
|
||||
@OneToMany(() => ApiAttribute, (v) => v.apiName)
|
||||
apiAttributes: ApiAttribute[];
|
||||
}
|
||||
|
||||
export class CreateApi {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
methodApi: "GET" | "POST" | "PUT";
|
||||
|
||||
@Column()
|
||||
system: string;
|
||||
|
||||
@Column()
|
||||
isActive: boolean;
|
||||
|
||||
@Column()
|
||||
apiAttributes: CreateApiAttribute[];
|
||||
}
|
||||
|
||||
export class CreateApiAttribute {
|
||||
@Column()
|
||||
tbName: string;
|
||||
|
||||
@Column()
|
||||
propertyKey: string[];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue