start project
This commit is contained in:
commit
0703810fa3
62 changed files with 12665 additions and 0 deletions
85
src/entities/Skill.ts
Normal file
85
src/entities/Skill.ts
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
OneToMany,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { AssignSkill } from "./AssignSkill";
|
||||
|
||||
export enum TypeSkill {
|
||||
COMPUTER = "computer",
|
||||
ENG = "english",
|
||||
INFORMATION = "information",
|
||||
RESOURSE = "resourse",
|
||||
}
|
||||
|
||||
@Entity("skills")
|
||||
export class Skill extends EntityBase {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "enum",
|
||||
enum: TypeSkill,
|
||||
comment: "หมวดหมู่ทักษะ",
|
||||
})
|
||||
type: TypeSkill;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
comment: "หัวข้อความรู้",
|
||||
})
|
||||
title: string;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
comment: "คำอธิบายระดับความรู้ ระดับที่ 1",
|
||||
})
|
||||
level1: string;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
comment: "คำอธิบายระดับความรู้ ระดับที่ 2",
|
||||
})
|
||||
level2: string;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
comment: "คำอธิบายระดับความรู้ ระดับที่ 3",
|
||||
})
|
||||
level3: string;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
comment: "คำอธิบายระดับความรู้ ระดับที่ 4",
|
||||
})
|
||||
level4: string;
|
||||
|
||||
@Column({
|
||||
type: "text",
|
||||
nullable: true,
|
||||
comment: "คำอธิบายระดับความรู้ ระดับที่ 5",
|
||||
})
|
||||
level5: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
comment: "สถานะการใช้งาน 1 คือใช้งานปกติ, 0 คือไม่ใช้งาน",
|
||||
default: 1,
|
||||
})
|
||||
active: number;
|
||||
|
||||
@OneToMany(
|
||||
() => AssignSkill,
|
||||
(assignSkill: AssignSkill) => assignSkill.skill_id
|
||||
)
|
||||
@JoinColumn({ name: "id" })
|
||||
assignSkill: AssignSkill[];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue