-
Notifications
You must be signed in to change notification settings - Fork 10
/
mms.proto
241 lines (211 loc) · 5.5 KB
/
mms.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
syntax = "proto3";
package mms;
option go_package = "./mms";
message BaseIDResp {
uint64 id = 1;
string msg = 2;
}
message BaseResp {
string msg = 1;
}
message BaseUUIDResp {
string id = 1;
string msg = 2;
}
message CallbackReq {
string state = 1;
string code = 2;
}
// base message
message Empty {}
message IDReq {
uint64 id = 1;
}
message IDsReq {
repeated uint64 ids = 1;
}
message MemberInfo {
optional string id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional uint32 status = 4;
optional string username = 5;
optional string password = 6;
optional string nickname = 7;
optional uint64 rank_id = 8;
optional string mobile = 9;
optional string email = 10;
optional string avatar = 11;
optional string wechat_id = 12;
optional string rank_code = 13;
optional int64 expired_at = 14;
}
message MemberListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string username = 3;
optional string nickname = 4;
optional string mobile = 5;
optional string email = 6;
optional uint64 rank_id = 7;
optional string wechat_id = 8;
}
message MemberListResp {
uint64 total = 1;
repeated MemberInfo data = 2;
}
message MemberLoginResp {
string id = 1;
string nickname = 2;
string avatar = 3;
uint64 rank_id = 4;
}
message MemberRankInfo {
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional string name = 4;
optional string description = 5;
optional string remark = 6;
optional string code = 7;
}
message MemberRankListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string name = 3;
optional string description = 4;
optional string remark = 5;
}
message MemberRankListResp {
uint64 total = 1;
repeated MemberRankInfo data = 2;
}
message MemberRegisterReq {
string username = 1;
string email = 2;
string password = 3;
}
message OauthLoginReq {
string state = 1;
string provider = 2;
}
message OauthProviderInfo {
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional string name = 4;
optional string client_id = 5;
optional string client_secret = 6;
optional string redirect_url = 7;
optional string scopes = 8;
optional string auth_url = 9;
optional string token_url = 10;
optional uint64 auth_style = 11;
optional string info_url = 12;
}
message OauthProviderListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string name = 3;
}
message OauthProviderListResp {
uint64 total = 1;
repeated OauthProviderInfo data = 2;
}
message OauthRedirectResp {
string url = 1;
}
message PageInfoReq {
uint64 page = 1;
uint64 page_size = 2;
}
message TokenInfo {
optional string id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional uint32 status = 4;
optional string uuid = 5;
optional string token = 6;
optional string source = 7;
optional int64 expired_at = 8;
optional string username = 9;
}
message TokenListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string username = 3;
optional string nickname = 4;
optional string email = 5;
optional string uuid = 6;
}
message TokenListResp {
uint64 total = 1;
repeated TokenInfo data = 2;
}
message UUIDReq {
string id = 1;
}
message UUIDsReq {
repeated string ids = 1;
}
message UsernameReq {
string username = 1;
}
service Mms {
// group: base
rpc initDatabase(Empty) returns (BaseResp);
// Member management
// group: member
rpc createMember(MemberInfo) returns (BaseUUIDResp);
// group: member
rpc updateMember(MemberInfo) returns (BaseResp);
// group: member
rpc getMemberList(MemberListReq) returns (MemberListResp);
// group: member
rpc deleteMember(UUIDsReq) returns (BaseResp);
// group: member
rpc getMemberById(UUIDReq) returns (MemberInfo);
// group: member
rpc getMemberByUsername(UsernameReq) returns (MemberInfo);
// MemberRank management
// group: memberrank
rpc createMemberRank(MemberRankInfo) returns (BaseIDResp);
// group: memberrank
rpc updateMemberRank(MemberRankInfo) returns (BaseResp);
// group: memberrank
rpc getMemberRankList(MemberRankListReq) returns (MemberRankListResp);
// group: memberrank
rpc getMemberRankById(IDReq) returns (MemberRankInfo);
// group: memberrank
rpc deleteMemberRank(IDsReq) returns (BaseResp);
// OauthProvider management
// group: oauthprovider
rpc createOauthProvider(OauthProviderInfo) returns (BaseIDResp);
// group: oauthprovider
rpc updateOauthProvider(OauthProviderInfo) returns (BaseResp);
// group: oauthprovider
rpc getOauthProviderList(OauthProviderListReq) returns (OauthProviderListResp);
// group: oauthprovider
rpc getOauthProviderById(IDReq) returns (OauthProviderInfo);
// group: oauthprovider
rpc deleteOauthProvider(IDsReq) returns (BaseResp);
// group: oauthprovider
rpc oauthLogin(OauthLoginReq) returns (OauthRedirectResp);
// group: oauthprovider
rpc oauthCallback(CallbackReq) returns (MemberInfo);
// group: oauthprovider
rpc wechatMiniProgramLogin(OauthLoginReq) returns (BaseResp);
// Token management
// group: token
rpc createToken(TokenInfo) returns (BaseUUIDResp);
// group: token
rpc deleteToken(UUIDsReq) returns (BaseResp);
// group: token
rpc getTokenList(TokenListReq) returns (TokenListResp);
// group: token
rpc getTokenById(UUIDReq) returns (TokenInfo);
// group: token
rpc blockUserAllToken(UUIDReq) returns (BaseResp);
// group: token
rpc updateToken(TokenInfo) returns (BaseResp);
}