-
Notifications
You must be signed in to change notification settings - Fork 10
/
admin.proto
839 lines (762 loc) · 22.2 KB
/
admin.proto
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
/*
* Copyright 2023 FormulaGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
syntax = "proto3";
package admin;
option go_package = "/admin";
import "api.proto";
import "base.proto";
// admin service
service admin {
// init database
rpc InitDatabase (base.Empty) returns (base.BaseResp) {
option (api.get) = "/api/initDatabase";
}
// Check the system status | 检查系统状态
rpc HealthCheck (base.Empty) returns (base.BaseResp) {
option (api.get) = "/api/health";
}
// Get captcha | 获取验证码
rpc Captcha (base.Empty) returns (CaptchaInfoResp) {
option (api.get) = "/api/captcha";
}
// DeleteStructTag | 去掉struct tag
rpc DeleteStructTag (StructReq) returns (StructResp) {
option (api.post) = "/api/deleteStructTag";
}
// StructToProto | 转换struct至proto类型数据
rpc StructToProto (StructReq) returns (ProtoResp) {
option (api.post) = "/api/structToProto";
}
}
// The request of struct | struct请求类型数据
message StructReq {
string structStr = 1[(api.body)="structStr, required"];
}
// The information of struct | struct类型数据
message StructResp {
base.ErrCode errCode = 1;
string errMsg = 2;
string structStr = 3;
}
// The information of proto | proto类型数据
message ProtoResp {
base.ErrCode errCode = 1;
string errMsg = 2;
string protoStr = 3;
}
// The information of captcha | 验证码数据
message CaptchaInfoResp {
base.ErrCode errCode = 1;
string errMsg = 2;
string captchaID = 3;
string imgPath = 4;
}
// casbin
message UpdatePolicyReq {
uint64 roleID = 1;
repeated PolicyPartInfo rules = 2;
}
message PolicyPartInfo {
string path = 1;
string method = 2;
}
message CreatePolicyReq {
uint64 roleID = 1;
PolicyPartInfo info = 2;
}
// user service
service user {
// The login interface does not need to be automatically generated, it has been written in the jwt middleware
// Log in | 登录
// rpc Login(LoginReq) returns (LoginResp) {
// option (api.post) = "/api/login";
// }
// Register | 注册
rpc Register(RegisterReq) returns (base.BaseResp) {
option (api.post) = "/api/register";
}
// Get user's permission code | 获取用户权限码
rpc UserPermCode(base.Empty) returns (PermCodeResp) {
option (api.get) = "/api/admin/user/perm";
}
// Change Password | 修改密码
rpc ChangePassword (ChangePasswordReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/user/change-password";
}
// Create user's information | 新增用户
rpc CreateUser (CreateOrUpdateUserReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/user/create";
}
// Update user's information | 更新用户
rpc UpdateUser (CreateOrUpdateUserReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/user/update";
}
// Get user basic information | 获取用户基本信息
rpc UserInfo (base.Empty) returns (UserInfoResp) {
option (api.get) = "/api/admin/user/info";
}
// Get user list | 获取用户列表
rpc UserList (UserListReq) returns (UserListResp) {
option (api.get) = "/api/admin/user/list";
}
// Delete user information | 删除用户信息
rpc DeleteUser (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/user";
}
// Update user's profile | 更新用户个人信息
rpc UpdateProfile (ProfileReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/user/profile";
}
// Get user's profile | 获取用户个人信息
rpc UserProfile (base.Empty) returns (ProfileResp) {
option (api.get) = "/api/admin/user/profile";
}
// Set user's status | 更新用户状态
rpc UpdateUserStatus (base.StatusCodeReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/user/status";
}
}
// user message
// login request | 登录参数
message LoginReq {
string username = 1;
string password = 2;
string captchaID = 3;
string captcha = 4;
}
// The simple role data | 简单的角色数据
message SimpleRole {
string roleName = 1;
string value = 2;
}
// The log in response data | 登录返回数据
message LoginResp {
string code = 1;
string token = 2;
string expire = 3;
}
// The profile in response data | 返回个人数据
message ProfileResp {
base.ErrCode errCode = 1;
string errMsg = 2;
string nickname = 3;
string avatar = 4;
string mobile = 5;
string email = 6;
}
// The profile request | 获取个人数据
message ProfileReq {
string nickname = 1;
string avatar = 2;
string mobile = 3;
string email = 4;
}
// register request | 注册参数
message RegisterReq {
string username = 1;
string password = 2;
string captchaID = 3;
string captcha = 4;
string email = 5;
}
// change user's password request | 修改密码请求参数
message ChangePasswordReq {
uint64 userID = 1;
string oldPassword = 2;
string newPassword = 3;
}
// Create or update user information request | 创建或更新用户信息
message CreateOrUpdateUserReq {
uint64 ID = 1;
string avatar = 2;
uint64 roleID = 3;
string mobile = 4;
string email = 5;
uint64 status = 6;
string username = 7;
string nickname = 8;
string password = 9;
}
// The response data of user's information | 用户信息返回数据
message UserInfoResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 ID = 3;
string avatar = 4;
uint64 roleID = 5;
string mobile = 6;
string email = 7;
uint64 status = 8;
string username = 9;
string nickname = 10;
string roleName = 11;
string createdAt = 12;
string updatedAt = 13;
string roleValue = 14;
string sideMode = 15;
}
// The response data of user list | 用户列表数据
message UserListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated UserInfoResp data = 4;
}
// Get user list request | 获取用户列表请求参数
message UserListReq {
uint64 page = 1;
uint64 pageSize = 2;
string username = 3;
string nickname = 4;
string email = 5;
string mobile = 6;
uint64 roleID = 7;
}
// The permission code for front end permission control | 权限码: 用于前端权限控制
message PermCodeResp {
base.ErrCode errCode = 1;
string errMsg = 2;
repeated string data = 3;
}
// api service
service apis {
// Create API information | 创建或API
rpc CreateApi (ApiInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/api/create";
}
// Update API information | 更新API
rpc UpdateApi (ApiInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/api/update";
}
// Delete API information | 删除API信息
rpc DeleteApi (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/api";
}
// Get API list | 获取API列表
rpc ApiList (ApiPageReq) returns (ApiListResp) {
option (api.get) = "/api/admin/api/list";
}
}
// api message
// The response data of API information | API信息
message ApiInfo {
uint64 ID = 1;
string createdAt = 2;
string updatedAt = 3;
string path = 4;
string description = 5;
string group = 6;
string method = 7;
}
// The response data of API list | API列表数据
message ApiListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated ApiInfo data = 4;
}
// The request data of API list | API列表请求数据
message ApiPageReq {
uint64 page = 1;
uint64 pageSize = 2;
string path = 3;
string description = 4;
string method = 5;
string group = 6;
}
// authorization service
service authority {
// Create API authorization information | 创建API权限
rpc CreateAuthority (CreateOrUpdateApiAuthorityReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/authority/api/create";
}
// Update API authorization information | 更新API权限
rpc UpdateApiAuthority (CreateOrUpdateApiAuthorityReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/authority/api/update";
}
// Get role's API authorization list | 获取角色api权限列表
rpc ApiAuthority (base.IDReq) returns (ApiAuthorityListInfoResp) {
option (api.post) = "/api/admin/authority/api/role";
}
// Create menu authorization information | 创建菜单权限
rpc CreateMenuAuthority (MenuAuthorityInfoReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/authority/menu/create";
}
// Update menu authorization information | 更新菜单权限
rpc UpdateMenuAuthority (MenuAuthorityInfoReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/authority/menu/update";
}
// Get role's menu authorization list | 获取角色菜单权限列表
rpc MenuAuthority (base.IDReq) returns (MenuAuthorityInfoResp) {
option (api.post) = "/api/admin/authority/menu/role";
}
}
// authorization message
// The response data of api authorization | API授权数据
message ApiAuthorityInfo {
string path = 1;
string method = 2;
}
// Create or update api authorization information request | 创建或更新API授权信息
message CreateOrUpdateApiAuthorityReq {
uint64 roleID = 1;
repeated ApiAuthorityInfo data = 2;
}
// The data of api authorization list | API授权列表数据
message ApiAuthorityListInfoResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated ApiAuthorityInfo data = 4;
}
// The request data of menu authorization | 菜单授权请求数据
message MenuAuthorityInfoReq {
uint64 roleID = 1;
repeated uint64 MenuIDs = 2;
}
// The response data of menu authorization | 菜单授权数据
message MenuAuthorityInfoResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 roleID = 3;
repeated uint64 MenuIDs = 4;
}
// menu service
service menu {
// Create menu information | 创建菜单
rpc CreateMenu (CreateOrUpdateMenuReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/menu/create";
}
// Update menu information | 更新菜单
rpc UpdateMenu (CreateOrUpdateMenuReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/menu/update";
}
// Delete menu information | 删除菜单信息
rpc DeleteMenu (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/menu";
}
// Get role's menu list API | 获取角色菜单列表
rpc MenuByRole (base.Empty) returns (MenuInfoListResp) {
option (api.get) = "/api/admin/menu/role";
}
// Get menu list | 获取菜单列表
rpc MenuList (base.PageInfoReq) returns (MenuInfoListResp) {
option (api.get) = "/api/admin/menu/list";
}
// Create menu parameters | 创建菜单额外参数
rpc CreateMenuParam (CreateOrUpdateMenuParamReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/menu/param/create";
}
// Update menu parameters | 更新菜单额外参数
rpc UpdateMenuParam (CreateOrUpdateMenuParamReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/menu/param/update";
}
// Delete menu extra parameters | 删除菜单额外参数
rpc DeleteMenuParam (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/menu/param";
}
// Get menu extra parameters by menu ID | 获取某个菜单的额外参数列表
rpc MenuParamListByMenuID (base.IDReq) returns (MenuParamListResp) {
option (api.get) = "/api/admin/menu/param/list";
}
}
// menu messages
// Create or update menu information request params | 创建或更新菜单信息参数
message CreateOrUpdateMenuReq {
uint64 ID = 1;
uint64 parentID = 2;
uint32 level = 3;
string path = 4;
string name = 5;
string redirect = 6;
string component = 7;
uint32 orderNo = 8;
bool disabled = 9;
uint32 menuType = 10;
Meta meta = 11;
}
// The response data of menu information | 菜单返回数据
message MenuInfo {
uint64 ID = 1;
string createdAt = 2;
string updatedAt = 3;
uint32 level = 4;
uint64 parentID = 5;
string path = 6;
string name = 7;
string redirect = 8;
string component = 9;
uint32 orderNo = 10;
bool disabled = 11;
uint32 menuType = 12;
repeated MenuInfo children = 13;
Meta meta = 14;
}
// The meta data of menu | 菜单的meta数据
message Meta {
string title = 1;
string icon = 2;
bool hideMenu = 3;
bool hideBreadcrumb = 4;
string currentActiveMenu = 5;
bool ignoreKeepAlive = 6;
bool hideTab = 7;
string frameSrc = 8;
bool carryParam = 9;
bool hideChildrenInMenu = 10;
bool affix = 11;
uint32 dynamicLevel = 12;
string realPath = 13;
}
// The data of menu list | 菜单列表数据
message MenuInfoListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated MenuInfo data = 4;
}
// The response data of role menu list data | 角色菜单列表数据
message MenuListBase {
uint32 parentID = 1;
uint32 level = 2;
string path = 3;
string name = 4;
string redirect = 5;
string component = 6;
uint32 orderNo = 7;
bool disabled = 8;
repeated MenuListBase children = 9;
Meta meta = 10;
}
// Create or update menu extra parameters request params | 创建或更新菜单额外参数的请求参数
message CreateOrUpdateMenuParamReq {
uint64 ID = 1;
uint64 menuID = 2;
string type = 3;
string key = 4;
string value = 5;
}
// The response data of menu parameters | 菜单参数返回数据
message MenuParamResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 ID = 3;
string type = 4;
string key = 5;
string value = 6;
string createdAt = 7;
string updatedAt = 8;
}
// The data of menu parameters list | 菜单参数列表数据
message MenuParamListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated MenuParamResp data = 4;
}
// role service
service role {
// Create role information | 创建角色
rpc CreateRole (RoleInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/role/create";
}
// Update role information | 更新角色
rpc UpdateRole (RoleInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/role/update";
}
// Delete role information | 删除角色信息
rpc DeleteRole (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/role";
}
// Get role information | 获取角色信息
rpc RoleByID (base.IDReq) returns (RoleInfoResp) {
option (api.get) = "/api/admin/role";
}
// Get role list | 获取角色列表
rpc RoleList (base.PageInfoReq) returns (RoleListResp) {
option (api.get) = "/api/admin/role/list";
}
// Set role status | 设置角色状态, 启用1/禁用0
rpc UpdateRoleStatus (base.StatusCodeReq) returns (base.BaseResp) {
option (api.post) = "/api/admin/role/status";
}
}
// role messages
// Create or update role information params | 创建或更新角色信息参数
message RoleInfo {
uint64 ID = 1;
string name = 2;
string value = 3;
string defaultRouter = 4;
uint64 status = 5;
string remark = 6;
uint32 orderNo = 7;
string createdAt = 8;
string updatedAt = 9;
}
// The response data of role info | 角色信息返回数据
message RoleInfoResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 ID = 3;
string name = 4;
string value = 5;
string defaultRouter = 6;
uint64 status = 7;
string remark = 8;
uint32 orderNo = 9;
string createdAt = 10;
string updatedAt = 11;
}
// Get role list response | 获取角色列表响应
message RoleListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated RoleInfo data = 4;
}
// Token service
service token {
// Update Token information | 更新Token
rpc UpdateToken (TokenInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/token/update";
}
// Delete token information | 删除token信息
rpc DeleteToken (DeleteReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/token";
}
// Get Token list | 获取token列表
rpc TokenList (TokenListReq) returns (TokenListResp) {
option (api.get) = "/api/admin/token/list";
}
}
// The response data of Token information | Token信息
message TokenInfo {
uint64 ID = 1;
string createdAt = 2;
string updatedAt = 3;
uint64 userID = 4;
string userName = 5;
string token = 6;
string source = 7;
string expiredAt = 8;
}
// The response data of Token list | Token列表返回数据
message TokenListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated TokenInfo data = 4;
}
// Get token list request params | token列表请求参数
message TokenListReq {
uint64 page = 1;
uint64 pageSize = 2;
string username = 3;
uint64 userID = 4;
}
// Delete request params | token删除请求参数
message DeleteReq {
uint64 userID = 1;
}
// dictionary service
service dictionary {
// Create dictionary information | 创建字典信息
rpc CreateDictionary (DictionaryInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/dict/create";
}
// Update dictionary information | 更新字典信息
rpc UpdateDictionary (DictionaryInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/dict/update";
}
// Delete dictionary information | 删除字典信息
rpc DeleteDictionary (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/dict";
}
// Get dictionary list | 获取字典列表
rpc DictionaryList (DictionaryPageReq) returns (DictionaryListResp) {
option (api.get) = "/api/admin/dict/list";
}
// Create dictionary KV information | 创建字典键值信息
rpc CreateDictionaryDetail (DictionaryDetail) returns (base.BaseResp) {
option (api.post) = "/api/admin/dict/detail/create";
}
// Update dictionary KV information | 更新字典键值信息
rpc UpdateDictionaryDetail (DictionaryDetail) returns (base.BaseResp) {
option (api.post) = "/api/admin/dict/detail/update";
}
// Delete dictionary KV information | 删除字典键值信息
rpc DeleteDictionaryDetail (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/dict/detail";
}
// Get dictionary detail list by dictionary name | 根据字典名获取字典键值列表
rpc DetailByDictionaryName (DictionaryDetailReq) returns (DictionaryDetailListResp) {
option (api.get) = "/api/admin/dict/detail/list";
}
}
// dictionary message
// The response data of dictionary information | 字典信息
message DictionaryInfo {
uint64 ID = 1;
string title = 2;
string name = 3;
uint64 status = 4;
string description = 5;
string createdAt = 6;
string updatedAt = 7;
}
// The data of dictionary list | 字典列表数据
message DictionaryListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated DictionaryInfo data = 4;
}
// The dictionary KV information | 字典键值信息
message DictionaryDetail {
uint64 ID = 1;
string title = 2;
string key = 3;
string value = 4;
uint64 status = 5;
string createdAt = 6;
string updatedAt = 7;
uint64 parentID = 8;
}
// The response data of dictionary KV information list | 字典键值列表数据
message DictionaryDetailListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated DictionaryDetail data = 4;
}
// The request data of dictionary KV information | 字典名获取字典键值请求数据
message DictionaryDetailReq {
string name = 1;
}
// The request data of dictionary list | 字典列表请求数据
message DictionaryPageReq {
string title = 1;
string name = 2;
uint64 page = 3;
uint64 pageSize = 4;
}
// oauth service
service oauth {
// Create Provider information | 创建提供商
rpc CreateProvider (ProviderInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/oauth/provider/create";
}
// Update Provider information | 更新提供商
rpc UpdateProvider (ProviderInfo) returns (base.BaseResp) {
option (api.post) = "/api/admin/oauth/provider/update";
}
// Delete provider information | 删除提供商信息
rpc DeleteProvider (base.IDReq) returns (base.BaseResp) {
option (api.delete) = "/api/admin/oauth/provider";
}
// Get provider list | 获取提供商列表
rpc GetProviderList (base.PageInfoReq) returns (ProviderListResp) {
option (api.get) = "/api/admin/oauth/provider/list";
}
// Oauth log in | Oauth 登录
rpc OauthLogin (OauthLoginReq) returns (OauthRedirectResp) {
option (api.post) = "/api/oauth/login";
}
// Oauth log in callback route | Oauth 登录返回调接口
rpc OauthCallback (CallbackReq) returns (LoginResp) {
option (api.get) = "/api/oauth/callback";
}
}
// oauth message
// Oauth log in request | Oauth 登录请求
message OauthLoginReq {
// format: random string-provider name | 格式:随机字符串-供应商名称
string state = 1;
string provider = 2;
}
// Redirect information | 跳转网址
message OauthRedirectResp {
base.ErrCode errCode = 1;
string errMsg = 2;
string url = 3;
}
// The response data of oauth provider information | 提供者信息
message ProviderInfo {
uint64 id = 1;
string name = 2;
string clientID = 3;
string clientSecret = 4;
string redirectUrl = 5;
string scopes = 6;
string authUrl = 7;
string tokenUrl = 8;
uint64 authStyle = 9;
string infoUrl = 10;
string createdAt = 11;
string updatedAt = 12;
}
message ProviderListReq {
uint64 page = 1;
uint64 pageSize = 2;
string name = 3;
}
// The response data of provider list | 提供商列表返回数据
message ProviderListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated ProviderInfo data = 4;
}
// Oauth login callback request | Oauth 登录回调请求
message CallbackReq {
string state = 1;
string code = 2;
}
// logs service
service logs {
// Get logs list | 获取日志列表
rpc GetLogsList (LogsListReq) returns (LogsListResp) {
option (api.get) = "/api/admin/logs/list";
}
// Delete logs | 删除日志信息
rpc DeleteLogs (base.Empty) returns (base.BaseResp) {
option (api.delete) = "/api/admin/logs/deleteAll";
}
}
// logs message
// The response data of logs | 日志信息
message LogsInfo {
string type = 1;
string method = 2;
string api = 3;
bool success = 4;
string reqContent = 5;
string respContent = 6;
string ip = 7;
string userAgent = 8;
string operator = 9;
uint32 time = 10;
string createdAt = 11;
string updatedAt = 12;
}
// The request data of logs list | 日志列表请求数据
message LogsListReq {
uint64 page = 1;
uint64 pageSize = 2;
string type = 3;
string method = 4;
string api = 5;
string success = 6;
string operator = 7;
}
// The response data of logs list | 日志列表返回数据
message LogsListResp {
base.ErrCode errCode = 1;
string errMsg = 2;
uint64 total = 3;
repeated LogsInfo data = 4;
}