forked from OtterMind/Chat2DB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteam.ts
More file actions
237 lines (211 loc) · 3.34 KB
/
Copy pathteam.ts
File metadata and controls
237 lines (211 loc) · 3.34 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
// ===================== Common ==================
export enum ManagementType {
DATASOURCE = 'DATASOURCE',
TEAM = 'TEAM',
USER = 'USER',
}
export enum AffiliationType {
'USER_TEAM' = 'USER_TEAM',
'USER_DATASOURCE' = 'USER_DATASOURCE',
'TEAM_USER' = 'TEAM_USER',
'TEAM_DATASOURCE' = 'TEAM_DATASOURCE',
'DATASOURCE_USER/TEAM' = 'DATASOURCE_USER/TEAM'
}
export enum SearchType {
DATASOURCE = 'DATASOURCE',
TEAM = 'TEAM',
USER = 'USER',
'USER/TEAM' = 'USER/TEAM'
}
export enum StatusType {
INVALID = 'INVALID',
VALID = 'VALID',
}
export enum RoleType {
ADMIN = 'ADMIN',
USER = 'USER',
}
export enum MemberType {
TEAM = 'TEAM',
USER = 'USER'
}
// ===================== DataSource ==================
export interface IDataSourceVO {
/**
* 连接别名
*/
alias?: string;
/**
* 环境
*/
environment?: IEnvironmentVO;
/**
* 环境id
*/
environmentId?: number;
/**
* 主键id
*/
id?: number;
/**
* 连接地址
*/
url?: string;
}
export interface IEnvironmentVO {
/**
* 主键
*/
id?: number;
/**
* 环境名称
*/
name?: string;
/**
* 环境缩写
*/
shortName?: string;
/**
* 样式类型
*/
style?: string;
}
export interface IDataSourceAccessVO {
/**
* 授权对象
*/
accessObject: IDataSourceAccessObjectVO;
/**
* 授权id,根据类型区分是用户还是团队
*/
accessObjectId: number;
/**
* 授权类型
*/
accessObjectType: RoleType;
/**
* 主键
*/
id: number;
}
export interface IDataSourceAccessObjectVO {
/**
* The name of the code that belongs to the authorization type, such as user account, team
* code
*/
code?: string;
/**
* 授权id,根据类型区分是用户还是团队
*/
id?: number;
/**
* Code that belongs to the authorization type, such as user name, team name
*/
name?: string;
/**
* 授权类型
*/
type?: RoleType;
}
// ===================== User ======================
export interface IUserVO {
/**
* 主键
*/
id: number;
/**
* 邮箱
*/
email: string;
/**
* 昵称
*/
nickName: string;
/**
* 密码
*/
password: string;
/**
* 角色编码
*/
roleCode: RoleType;
/**
* 用户状态
*/
status: StatusType;
/**
* 用户名
*/
userName: string;
}
export interface IUserWithTeamVO {
/**
* 主键
*/
id?: number;
/**
* 团队
*/
team?: ITeamVO;
/**
* user id
*/
userId?: number;
}
export interface IUserWithDataSourceVO {
id?: number;
/**
* Data Source
*/
dataSource?: IDataSourceVO;
/**
* user id
*/
userId?: number;
}
// ===================== Team =====================
export interface ITeamVO {
id?: number;
/**
* 团队编码
*/
code: string;
/**
* 团队描述
*/
description?: string;
/**
* 团队名称
*/
name: string;
/**
* 团队状态
*/
status: StatusType;
}
export interface ITeamWithUserVO {
id: number;
teamId: number;
user: IUserVO;
}
export interface ITeamWithDataSourceVO {
/**
* Data Source
*/
dataSource?: IDataSourceVO;
/**
* 主键
*/
id: number;
/**
* team id
*/
teamId?: number;
}
// ===================== USER/TEAM =====================
export interface ITeamAndUserVO {
code?: string;
id?: number;
name?: string;
type?: MemberType
}