From ae9a1338e99672b40e21bb6476fa7918c2311898 Mon Sep 17 00:00:00 2001 From: byung eun park Date: Mon, 28 Oct 2019 17:12:17 +0900 Subject: [PATCH] user enum type crete --- src/modules/user/model/role.model.ts | 6 +----- src/modules/user/model/user.model.ts | 15 +++++++++------ src/modules/user/type/commission.type.ts | 5 +++++ src/modules/user/type/grade.type.ts | 7 +++++++ src/modules/user/type/level.type.ts | 7 +++++++ src/modules/user/type/role.type.ts | 8 ++++++++ src/modules/user/type/status.type.ts | 5 +++++ 7 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 src/modules/user/type/commission.type.ts create mode 100644 src/modules/user/type/grade.type.ts create mode 100644 src/modules/user/type/level.type.ts create mode 100644 src/modules/user/type/role.type.ts create mode 100644 src/modules/user/type/status.type.ts diff --git a/src/modules/user/model/role.model.ts b/src/modules/user/model/role.model.ts index 2fdf247..b2d430c 100644 --- a/src/modules/user/model/role.model.ts +++ b/src/modules/user/model/role.model.ts @@ -1,8 +1,4 @@ -export enum RoleName { - ROLE_SUPER_ADMIN = 'ROLE_SUPER_ADMIN', - ROLE_ADMIN = 'ROLE_ADMIN', - ROLE_USER = 'ROLE_USER' -} +import { RoleName } from '../type/role.type'; export interface Role { id: number; diff --git a/src/modules/user/model/user.model.ts b/src/modules/user/model/user.model.ts index 7bb5bcd..db6e68f 100644 --- a/src/modules/user/model/user.model.ts +++ b/src/modules/user/model/user.model.ts @@ -1,11 +1,9 @@ import { Role } from './role.model'; import { DateAudit } from 'src/modules/common/data/model/audit'; - -export enum StatusName { - USER_BLOCK = 'USER_BLOCK', - USER_NORMAL = 'USER_NORMAL', - USER_WITHDRAW = 'USER_WITHDRAW' -} +import { StatusName } from '../type/status.type'; +import { RoleName } from '../type/role.type'; +import { LevelName } from '../type/level.type'; +import { GradeName } from '../type/grade.type'; export interface User extends DateAudit { id?: number; @@ -27,4 +25,9 @@ export interface User extends DateAudit { phone?: string; descriptions?: string; + + roles?: Role[]; + grade?: number; + status?: StatusName; + level?: LevelName; } diff --git a/src/modules/user/type/commission.type.ts b/src/modules/user/type/commission.type.ts new file mode 100644 index 0000000..905c051 --- /dev/null +++ b/src/modules/user/type/commission.type.ts @@ -0,0 +1,5 @@ +export enum CommissionName { + BANKING = 'BANKING', // 충환 방식 + BETTING = 'BETTING', // 베팅 방식 + RAFFLE = 'RAFFLE' // 낙첨 방식 +} diff --git a/src/modules/user/type/grade.type.ts b/src/modules/user/type/grade.type.ts new file mode 100644 index 0000000..8c59b87 --- /dev/null +++ b/src/modules/user/type/grade.type.ts @@ -0,0 +1,7 @@ +export enum GradeName { + BAD_USER = 'BAD_USER', // 불량유저 등급 + NORMAL_USER = 'NORMAL_USER', // 일반유저 등급 + REGULAR_USER = 'REGULAR_USER', // 정회원 등급 + VIP_USER = 'VIP_USER', // VIP 등급 + PLATINUM_USER = 'PLATINUM_USER' // 플레티넘 등급 +} diff --git a/src/modules/user/type/level.type.ts b/src/modules/user/type/level.type.ts new file mode 100644 index 0000000..f4fd785 --- /dev/null +++ b/src/modules/user/type/level.type.ts @@ -0,0 +1,7 @@ +export enum LevelName { + LEVEL_1 = 'LEVEL_1', + LEVEL_2 = 'LEVEL_2', + LEVEL_3 = 'LEVEL_3', + LEVEL_4 = 'LEVEL_4', + LEVEL_5 = 'LEVEL_5' +} diff --git a/src/modules/user/type/role.type.ts b/src/modules/user/type/role.type.ts new file mode 100644 index 0000000..0edc9ff --- /dev/null +++ b/src/modules/user/type/role.type.ts @@ -0,0 +1,8 @@ +export enum RoleName { + ROLE_SUPER_ADMIN = 'ROLE_SUPER_ADMIN', // 본사 관리자 & 최고관리자 + ROLE_ADMIN = 'ROLE_ADMIN', // 사이트 관리자 + ROLE_TEAM = 'ROLE_TEAM', // 팀 단위 유저 + ROLE_AGENCY = 'ROLE_AGENCY', // 총판 + ROLE_DISTRIBUTOR = 'ROLE_DISTRIBUTOR', // 부본사 + ROLE_USER = 'ROLE_USER' // 일반 유저 +} diff --git a/src/modules/user/type/status.type.ts b/src/modules/user/type/status.type.ts new file mode 100644 index 0000000..7374c7d --- /dev/null +++ b/src/modules/user/type/status.type.ts @@ -0,0 +1,5 @@ +export enum StatusName { + USER_BLOCK = 'USER_BLOCK', // 정지 + USER_NORMAL = 'USER_NORMAL', // 정상 + USER_WITHDRAW = 'USER_WITHDRAW' // 탈퇴 +}