145 lines
2.8 KiB
Protocol Buffer
145 lines
2.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package percutaneous;
|
|
option go_package="./percutaneous";
|
|
import "google/api/annotations.proto";
|
|
|
|
|
|
message WifiCheckRequest {
|
|
string host_code = 1;
|
|
}
|
|
|
|
message WifiSetRequest {
|
|
string host_code = 1;
|
|
}
|
|
|
|
message UseRequest {
|
|
string host_code = 1;
|
|
int64 user_id = 2;
|
|
string data = 3;
|
|
string stamp = 4;
|
|
int32 position = 5;
|
|
}
|
|
|
|
message UsedLogRequest {
|
|
int32 page = 1;
|
|
int32 size = 2;
|
|
string stamp = 3;
|
|
repeated string time = 4;
|
|
}
|
|
|
|
message Response {
|
|
int32 code = 1;
|
|
string msg = 2;
|
|
string data = 3;
|
|
}
|
|
|
|
message AddUserRequest {
|
|
string host_code = 1;
|
|
int64 user_id = 2;
|
|
}
|
|
|
|
message UserItemsRequest {
|
|
string host_code = 1;
|
|
int32 page = 2;
|
|
int32 size = 3;
|
|
}
|
|
|
|
message LoginQRRequest {
|
|
string host_code = 1;
|
|
string bluetooth = 2;
|
|
}
|
|
|
|
message AddUserQRRequest {
|
|
string host_code = 1;
|
|
}
|
|
|
|
message setPositionRequest {
|
|
int32 position =2;
|
|
string session_id =4;
|
|
}
|
|
|
|
message getWsCodeRequest {
|
|
int32 type =1;
|
|
int64 user_id = 2;
|
|
}
|
|
|
|
message EmptyRequest {
|
|
|
|
}
|
|
|
|
message WsStreamRequest {
|
|
bytes raw_body = 1; // websocket原始业务报文,不做解析
|
|
}
|
|
|
|
service Percutaneous {
|
|
rpc WifiCheck(WifiCheckRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/percutaneous/wifi/check"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc WifiSet(WifiSetRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
post: "/api/v3/percutaneous/wifi/set"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc Use(UseRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
post: "/api/v3/percutaneous/use"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc UsedLog(UsedLogRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/percutaneous/used/log"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
rpc AddUser(AddUserRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/percutaneous/add/user"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
rpc UserItems(UserItemsRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/percutaneous/user/items"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc UserDelete(AddUserRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/percutaneous/user/delete"
|
|
body: "*"
|
|
};
|
|
}
|
|
// 使用指南
|
|
rpc setPosition(setPositionRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
post: "/api/v3/percutaneous/use/position"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
rpc getWsCode(getWsCodeRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/percutaneous/get/code"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
rpc WsClientStatus(getWsCodeRequest) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/percutaneous/ws/status"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// 添加用户
|
|
rpc WsAddUserStream(stream WsStreamRequest) returns (stream WsStreamRequest);
|
|
}
|