-
Notifications
You must be signed in to change notification settings - Fork 0
/
http_dto.proto
151 lines (134 loc) · 3.33 KB
/
http_dto.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
syntax = "proto3";
package dto;
option go_package="./dto";
message Bot{
int64 bot_id = 1;
bool is_online = 2;
Captcha captcha = 3;
message Captcha{
int64 bot_id = 1;
CaptchaType captcha_type = 2;
oneof data{
string url = 3;
bytes image = 4;
}
enum CaptchaType{
PIC_CAPTCHA = 0;
SLIDER_CAPTCHA = 1;
UNSAFE_DEVICE_LOGIN_VERIFY = 2;
SMS = 4;
}
}
}
// 创建机器人 /bot/create/v1/
message CreateBotReq{
int64 bot_id = 1;
string password = 2;
int64 device_seed = 3; // 设备信息随机种子
int32 client_protocol = 4; // 协议类型
string sign_server = 5;
string sign_server_auth = 6;
}
message CreateBotResp{
}
// 删除机器人 /bot/delete/v1/
message DeleteBotReq{
int64 bot_id = 1;
}
message DeleteBotResp{
}
// 查询机器人 /bot/list/v1/
message ListBotReq{
}
message ListBotResp{
repeated Bot bot_list = 1;
}
// 处理验证码 /captcha/solve/v1/
message SolveCaptchaReq{
int64 bot_id = 1;
string result = 2;
}
message SolveCaptchaResp{
}
// 获取二维码 /qrcode/fetch/v1/
message FetchQRCodeReq{
int64 device_seed = 1;
int32 client_protocol = 2; // 协议类型
}
// 查询二维码状态 /qrcode/query/v1/
message QueryQRCodeStatusReq{
bytes sig = 1;
int64 bot_id = 2;
}
// 二维码登陆响应(获取和查询统一)
message QRCodeLoginResp{
QRCodeLoginState state = 1;
bytes image_data = 2;
bytes sig = 3;
enum QRCodeLoginState{
Unknown = 0;
QRCodeImageFetch = 1;
QRCodeWaitingForScan = 2; // 等待扫描
QRCodeWaitingForConfirm = 3; // 扫码成功,请确认登陆
QRCodeTimeout = 4; // 二维码过期
QRCodeConfirmed = 5; // 已确认登陆
QRCodeCanceled = 6; // 扫码被用户取消
}
}
message Plugin{
string name = 1;
bool disabled = 2;
bool json = 3;
int32 protocol = 4;
repeated string urls = 5;
repeated int32 event_filter = 6;
repeated int32 api_filter = 7;
string regex_filter = 8;
string regex_replace = 9;
repeated Header extra_header = 10;
message Header{
string key = 1;
repeated string value = 2;
}
}
message ListPluginReq{
}
message ListPluginResp{
repeated Plugin plugins = 1;
}
message SavePluginReq{
Plugin plugin = 1;
}
message SavePluginResp{
}
message DeletePluginReq{
string name = 1;
}
message DeletePluginResp{
}
message ReLoginReq {
int64 bot_id = 1;
}
message ReLoginResp {
int64 bot_id = 1;
bool success = 2;
}
message RestartReq{
bool restart = 1;
}
message RestartResp {
bool success = 1;
}
service HttpService{
rpc CreateBot(CreateBotReq)returns (CreateBotResp);
rpc DeleteBot(DeleteBotReq)returns (DeleteBotResp);
rpc ListBot(ListBotReq)returns (ListBotResp);
rpc SolveCaptcha(SolveCaptchaReq)returns (SolveCaptchaResp);
rpc FetchQRCode(FetchQRCodeReq)returns (QRCodeLoginResp);
rpc QueryQRCodeStatus(QueryQRCodeStatusReq)returns (QRCodeLoginResp);
rpc ReloginBot(ReLoginReq)returns (ReLoginResp);
rpc Restart(RestartReq)returns (RestartResp);
rpc ListPlugin(ListPluginReq)returns (ListPluginResp);
rpc SavePlugin(SavePluginReq)returns (SavePluginResp);
rpc DeletePlugin(DeletePluginReq)returns (DeletePluginResp);
}