detector.proto 2.45 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
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
syntax = "proto3";

package dfs.facility.detector;
option go_package = "cnlab.net/csst/proto/facility/detector";
import "common/error.proto";

service DetectorSrv {
        rpc Find(FindDetectorReq) returns (FindDetectorResp) {}
        rpc Get(GetDetectorReq) returns (GetDetectorResp) {}
        rpc Write(WriteDetectorReq) returns (WriteDetectorResp) {}
        rpc Update(UpdateDetectorReq) returns (UpdateDetectorResp) {}
        rpc Delete(DeleteDetectorReq) returns (DeleteDetectorResp) {}
        rpc FindStatus(FindStatusReq) returns (FindStatusResp) {}
        rpc GetStatus(GetStatusReq) returns (GetStatusResp) {}
        rpc WriteStatus(WriteStatusReq) returns (WriteStatusResp) {}
}
message Detector {
        string no = 1;
        string detector_name = 2;
        string module_id = 3;   
        string filter_id = 4;
        string create_time = 5;
        string update_time = 6;
}
message DetectorStatus {
        int64 id = 1;
        string detector_no = 2;
        string status = 3;
        string status_time = 4;
        string create_time = 5;
}
message FindDetectorReq {
        string module_id = 1;
        string key = 2;
}

message FindDetectorResp {
        bool success = 1;
        int32 totalCount = 2;
        common.Error error = 3;
        repeated Detector records = 4;
}

message GetDetectorReq {
        string no = 1;
}

message GetDetectorResp {
        Detector record = 1;
}

message WriteDetectorReq {
        Detector record = 1;
}

message WriteDetectorResp {
        bool success = 1;
        common.Error error = 2;
        Detector record = 3;
}

message UpdateDetectorReq {
        Detector record = 3;
}

message UpdateDetectorResp {
        bool success = 1;
        common.Error error = 2;
}
message DeleteDetectorReq {
        string no = 1;
}

message DeleteDetectorResp {
        bool success = 1;
        common.Error error = 2;
}
message FindStatusReq {
        string detector_no = 1;
        string status_begin_time = 2;
        string status_end_time = 3;
        int32 limit = 4;
}

message FindStatusResp {
        bool success = 1;
        int32 totalCount = 2;
        common.Error error = 3;
        repeated DetectorStatus records = 4;
}

message GetStatusReq {
        int64 id = 1;
}

message GetStatusResp {
        DetectorStatus record = 1;
}

message WriteStatusReq {
        DetectorStatus record = 1;  
}

message WriteStatusResp {
        bool success = 1;
        common.Error error = 2;
        DetectorStatus record = 3;
}