-
Notifications
You must be signed in to change notification settings - Fork 12
/
mcms.proto
211 lines (185 loc) · 4.95 KB
/
mcms.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
syntax = "proto3";
package mcms;
option go_package = "./mcms";
message BaseIDResp {
uint64 id = 1;
string msg = 2;
}
message BaseResp {
string msg = 1;
}
message BaseUUIDResp {
string id = 1;
string msg = 2;
}
message EmailInfo {
repeated string target = 1;
string subject = 2;
string content = 3;
optional string provider = 4;
}
message EmailLogInfo {
optional string id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional string target = 4;
optional string subject = 5;
optional string content = 6;
optional uint32 send_status = 7;
optional string provider = 8;
}
message EmailLogListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string target = 3;
optional string subject = 4;
optional string provider = 5;
optional uint32 send_status = 6;
}
message EmailLogListResp {
uint64 total = 1;
repeated EmailLogInfo data = 2;
}
message EmailProviderInfo {
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional string name = 4;
optional uint32 auth_type = 5;
optional string email_addr = 6;
optional string password = 7;
optional string host_name = 8;
optional string identify = 9;
optional string secret = 10;
optional uint32 port = 11;
optional bool tls = 12;
optional bool is_default = 13;
}
message EmailProviderListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string name = 3;
optional string email_addr = 4;
}
message EmailProviderListResp {
uint64 total = 1;
repeated EmailProviderInfo data = 2;
}
// base message
message Empty {}
message IDReq {
uint64 id = 1;
}
message IDsReq {
repeated uint64 ids = 1;
}
message PageInfoReq {
uint64 page = 1;
uint64 page_size = 2;
}
message SmsInfo {
repeated string phone_number = 1;
repeated string params = 2;
optional string template_id = 4;
optional string app_id = 5;
optional string sign_name = 6;
optional string provider = 7;
}
message SmsLogInfo {
optional string id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional string phone_number = 4;
optional string content = 5;
optional uint32 send_status = 6;
optional string provider = 7;
}
message SmsLogListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string phone_number = 3;
optional string content = 4;
optional string provider = 5;
optional uint32 send_status = 6;
}
message SmsLogListResp {
uint64 total = 1;
repeated SmsLogInfo data = 2;
}
message SmsProviderInfo {
optional uint64 id = 1;
optional int64 created_at = 2;
optional int64 updated_at = 3;
optional string name = 4;
optional string secret_id = 5;
optional string secret_key = 6;
optional string region = 7;
optional bool is_default = 8;
}
message SmsProviderListReq {
uint64 page = 1;
uint64 page_size = 2;
optional string name = 3;
}
message SmsProviderListResp {
uint64 total = 1;
repeated SmsProviderInfo data = 2;
}
message UUIDReq {
string id = 1;
}
message UUIDsReq {
repeated string ids = 1;
}
service Mcms {
// group: base
rpc initDatabase(Empty) returns (BaseResp);
// group: email
rpc sendEmail(EmailInfo) returns (BaseUUIDResp);
// EmailLog management
// group: emaillog
rpc createEmailLog(EmailLogInfo) returns (BaseUUIDResp);
// group: emaillog
rpc updateEmailLog(EmailLogInfo) returns (BaseResp);
// group: emaillog
rpc getEmailLogList(EmailLogListReq) returns (EmailLogListResp);
// group: emaillog
rpc getEmailLogById(UUIDReq) returns (EmailLogInfo);
// group: emaillog
rpc deleteEmailLog(UUIDsReq) returns (BaseResp);
// EmailProvider management
// group: emailprovider
rpc createEmailProvider(EmailProviderInfo) returns (BaseIDResp);
// group: emailprovider
rpc updateEmailProvider(EmailProviderInfo) returns (BaseResp);
// group: emailprovider
rpc getEmailProviderList(EmailProviderListReq) returns (EmailProviderListResp);
// group: emailprovider
rpc getEmailProviderById(IDReq) returns (EmailProviderInfo);
// group: emailprovider
rpc deleteEmailProvider(IDsReq) returns (BaseResp);
// group: sms
rpc sendSms(SmsInfo) returns (BaseUUIDResp);
// SmsLog management
// group: smslog
rpc createSmsLog(SmsLogInfo) returns (BaseUUIDResp);
// group: smslog
rpc updateSmsLog(SmsLogInfo) returns (BaseResp);
// group: smslog
rpc getSmsLogList(SmsLogListReq) returns (SmsLogListResp);
// group: smslog
rpc getSmsLogById(UUIDReq) returns (SmsLogInfo);
// group: smslog
rpc deleteSmsLog(UUIDsReq) returns (BaseResp);
// SmsProvider management
// group: smsprovider
rpc createSmsProvider(SmsProviderInfo) returns (BaseIDResp);
// group: smsprovider
rpc updateSmsProvider(SmsProviderInfo) returns (BaseResp);
// group: smsprovider
rpc getSmsProviderList(SmsProviderListReq) returns (SmsProviderListResp);
// group: smsprovider
rpc getSmsProviderById(IDReq) returns (SmsProviderInfo);
// group: smsprovider
rpc deleteSmsProvider(IDsReq) returns (BaseResp);
}