-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
58 lines (52 loc) · 1.11 KB
/
types.ts
File metadata and controls
58 lines (52 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { Request, Response, NextFunction } from 'express'
export type ControllerType = (
req: Request,
res: Response,
next: NextFunction,
) => void
export type RequestPart = 'body' | 'params' | 'query' | 'file'
export enum EVENT_APPLY_STATUS {
APPLY = 0, // 신청
REFUSE = 1, // 거절
CANCEL = 2, // 취소
APPROVED = 3, // 승인
LEAVE = 4, // 탈퇴
DEPORTATION = 5, // 추방
}
export enum EVENT_APPLY_FLAG {
MEMBER = 0, // 팀원
LEADER = 1, // 방장
}
export enum EVENT_SORT {
LIKES = 'likes',
}
export enum EVENT_ORDER {
ASC = 'ASC',
DESC = 'DESC',
}
export enum CHAT {
CONNECT = 'connect',
ROOM_JOIN = 'room',
PREV_MESSAGES = 'getPrevMessages',
SEND_MESSAGE = 'sendMessage',
MESSAGE = 'message',
MESSAGES = 'read',
DISCONNECT = 'disconnect',
USER_INFO = 'userinfo',
ROOM_INFO = 'roomInfo',
USER_JOIN = 'userJoin',
}
export interface ChatUser {
_id: string
userId: number
online: boolean
createdAt: Date
updatedAt: Date
}
export interface ChatMessage {
_id: string
type: 'text' | 'image' | 'link' | 'system'
message: string
user: ChatUser
createdAt: Date
}