saas-smartAi通信协议标准库
gongshangguo
2022-03-02 532831c91c6898f7cd402d9bfb9a35d7573afccf
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
syntax = "proto3";
 
package aiot;
 
import "aiot_common.proto";
 
enum RequestType{
    Async = 0;
    sync = 1;
}
 
// 请求的body体
message BusinessReq {
    string topic = 1;
    string authorization = 2;
    string ip = 3;
    string port = 4;
    RequestType type = 5;
    bytes req = 6;
}
 
// 响应的body体
message BusinessReply {
    int32 code = 1;
    string msg = 2;
    bool success = 3;
    bytes data = 4;
}
 
service AiotService {
    rpc GetBusiness(BusinessReq) returns (BusinessReply){}
    rpc SendAiotReq(Protocol) returns (Protocol){}
}