@cpzxrobot/sdk 1.2.11 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/robot_gateway.js +86 -45
- package/package.json +1 -1
- package/readme.md +19 -32
- package/robot_gateway.ts +132 -50
package/dist/robot_gateway.js
CHANGED
|
@@ -6,55 +6,96 @@ class RobotGateway extends Object {
|
|
|
6
6
|
super();
|
|
7
7
|
this.context = context;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
get alarm() {
|
|
10
|
+
return {
|
|
11
|
+
list: (unitId) => {
|
|
12
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/alarm/list/${unitId}`));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
get task() {
|
|
17
|
+
return {
|
|
18
|
+
list: (unitId) => {
|
|
19
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectTask/list/${unitId}`));
|
|
20
|
+
},
|
|
21
|
+
add: (data) => {
|
|
22
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectTask/add', data));
|
|
23
|
+
},
|
|
24
|
+
update: (data) => {
|
|
25
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectTask/update', data));
|
|
26
|
+
},
|
|
27
|
+
delete: (id) => {
|
|
28
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectTask/delete/${id}`));
|
|
29
|
+
},
|
|
30
|
+
dispatch: (taskId) => {
|
|
31
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectTask/dispatch/${taskId}`));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
18
34
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
get record() {
|
|
36
|
+
return {
|
|
37
|
+
list: (taskId) => {
|
|
38
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectRecord/list/${taskId}`));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
23
41
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
get cage() {
|
|
43
|
+
return {
|
|
44
|
+
list: (unitId) => {
|
|
45
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/cage/list/${unitId}`));
|
|
46
|
+
},
|
|
47
|
+
addList: (data) => {
|
|
48
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/cage/addList', data));
|
|
49
|
+
},
|
|
50
|
+
updateList: (data) => {
|
|
51
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/cage/updateList', data));
|
|
52
|
+
},
|
|
53
|
+
update: (data) => {
|
|
54
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/cage/update', data));
|
|
55
|
+
},
|
|
56
|
+
delete: (id) => {
|
|
57
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/cage/delete/${id}`));
|
|
58
|
+
},
|
|
59
|
+
deleteList: (unitId) => {
|
|
60
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/cage/deleteList/${unitId}`));
|
|
61
|
+
}
|
|
62
|
+
};
|
|
28
63
|
}
|
|
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
|
-
|
|
64
|
+
get path() {
|
|
65
|
+
return {
|
|
66
|
+
list: (unitId) => {
|
|
67
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectPath/list/${unitId}`));
|
|
68
|
+
},
|
|
69
|
+
add: (data) => {
|
|
70
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPath/add', data));
|
|
71
|
+
},
|
|
72
|
+
update: (data) => {
|
|
73
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPath/update', data));
|
|
74
|
+
},
|
|
75
|
+
delete: (data) => {
|
|
76
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPath/delete', data));
|
|
77
|
+
},
|
|
78
|
+
point: {
|
|
79
|
+
list: (pathId) => {
|
|
80
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectPathPoint/list/${pathId}`));
|
|
81
|
+
},
|
|
82
|
+
addList: (data) => {
|
|
83
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPathPoint/addList', data));
|
|
84
|
+
},
|
|
85
|
+
updateList: (data) => {
|
|
86
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPathPoint/updateList', data));
|
|
87
|
+
},
|
|
88
|
+
update: (data) => {
|
|
89
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPathPoint/update', data));
|
|
90
|
+
},
|
|
91
|
+
delete: (id) => {
|
|
92
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectPathPoint/delete/${id}`));
|
|
93
|
+
},
|
|
94
|
+
deleteList: (pathId) => {
|
|
95
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectPathPoint/deleteList/${pathId}`));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
58
99
|
}
|
|
59
100
|
}
|
|
60
101
|
exports.RobotGateway = RobotGateway;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -320,73 +320,60 @@ heatlamp 属性提供了一组方法,用于管理猪场的热灯配置。它
|
|
|
320
320
|
|
|
321
321
|
### 巡检任务相关接口
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
以下是更新后的巡检任务相关接口,分组在 `cpzxrobot().task` 和 `cpzxrobot().record` 命名空间下:
|
|
324
|
+
|
|
325
|
+
#### 任务管理 (cpzxrobot().task)
|
|
324
326
|
|
|
325
327
|
1. **获取任务列表**
|
|
326
328
|
```typescript
|
|
327
|
-
cpzxrobot().
|
|
329
|
+
cpzxrobot().task.list(unitId: number)
|
|
328
330
|
```
|
|
329
331
|
- 描述:获取指定单元的巡检任务列表
|
|
330
332
|
- 参数:`unitId` - 单元ID
|
|
331
333
|
- HTTP方法:GET
|
|
332
334
|
- 接口路径:`/api/v2/robot/inspectTask/list/{unitId}`
|
|
333
335
|
|
|
334
|
-
2.
|
|
335
|
-
```typescript
|
|
336
|
-
cpzxrobot().robot.getInspectTaskDetail(id: number)
|
|
337
|
-
```
|
|
338
|
-
- 描述:获取指定巡检任务的详细信息
|
|
339
|
-
- 参数:`id` - 任务ID
|
|
340
|
-
- HTTP方法:GET
|
|
341
|
-
- 接口路径:`/api/v2/robot/inspectTask/{id}`
|
|
342
|
-
|
|
343
|
-
3. **新增任务**
|
|
336
|
+
2. **新增任务**
|
|
344
337
|
```typescript
|
|
345
|
-
cpzxrobot().
|
|
338
|
+
cpzxrobot().task.add(data: any)
|
|
346
339
|
```
|
|
347
340
|
- 描述:添加新的巡检任务
|
|
348
341
|
- 参数:`data` - 包含任务信息的对象
|
|
349
342
|
- HTTP方法:POST
|
|
350
343
|
- 接口路径:`/api/v2/robot/inspectTask/add`
|
|
351
344
|
|
|
352
|
-
|
|
345
|
+
3. **修改任务**
|
|
353
346
|
```typescript
|
|
354
|
-
cpzxrobot().
|
|
347
|
+
cpzxrobot().task.update(data: any)
|
|
355
348
|
```
|
|
356
349
|
- 描述:更新现有的巡检任务
|
|
357
350
|
- 参数:`data` - 包含更新信息的对象
|
|
358
351
|
- HTTP方法:POST
|
|
359
352
|
- 接口路径:`/api/v2/robot/inspectTask/update`
|
|
360
353
|
|
|
361
|
-
|
|
354
|
+
4. **删除任务**
|
|
362
355
|
```typescript
|
|
363
|
-
cpzxrobot().
|
|
356
|
+
cpzxrobot().task.delete(id: number)
|
|
364
357
|
```
|
|
365
358
|
- 描述:删除指定的巡检任务
|
|
366
359
|
- 参数:`id` - 任务ID
|
|
367
|
-
- HTTP方法:
|
|
360
|
+
- HTTP方法:POST
|
|
368
361
|
- 接口路径:`/api/v2/robot/inspectTask/delete/{id}`
|
|
369
362
|
|
|
370
|
-
|
|
363
|
+
5. **下发任务**
|
|
371
364
|
```typescript
|
|
372
|
-
cpzxrobot().
|
|
373
|
-
```
|
|
374
|
-
- 描述:获取所有未下发的巡检任务列表
|
|
375
|
-
- HTTP方法:GET
|
|
376
|
-
- 接口路径:`/api/v2/robot/inspectTask/notAssignedList`
|
|
377
|
-
|
|
378
|
-
7. **下发任务**
|
|
379
|
-
```typescript
|
|
380
|
-
cpzxrobot().robot.assignInspectTask(taskId: number)
|
|
365
|
+
cpzxrobot().task.dispatch(taskId: number)
|
|
381
366
|
```
|
|
382
367
|
- 描述:下发指定的巡检任务
|
|
383
368
|
- 参数:`taskId` - 任务ID
|
|
384
|
-
- HTTP方法:
|
|
385
|
-
- 接口路径:`/api/v2/robot/inspectTask/
|
|
369
|
+
- HTTP方法:POST
|
|
370
|
+
- 接口路径:`/api/v2/robot/inspectTask/dispatch/{taskId}`
|
|
371
|
+
|
|
372
|
+
#### 巡检记录 (cpzxrobot().record)
|
|
386
373
|
|
|
387
|
-
|
|
374
|
+
1. **获取巡检结果**
|
|
388
375
|
```typescript
|
|
389
|
-
cpzxrobot().
|
|
376
|
+
cpzxrobot().record.list(taskId: number)
|
|
390
377
|
```
|
|
391
378
|
- 描述:获取指定巡检任务的结果列表
|
|
392
379
|
- 参数:`taskId` - 任务ID
|
package/robot_gateway.ts
CHANGED
|
@@ -8,63 +8,145 @@ export class RobotGateway extends Object {
|
|
|
8
8
|
this.context = context;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
get alarm() {
|
|
12
|
+
return {
|
|
13
|
+
list: (unitId: number) => {
|
|
14
|
+
return this.context.ready.then(axios =>
|
|
15
|
+
axios.get(`/api/v2/robot/alarm/list/${unitId}`)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
get task() {
|
|
22
|
+
return {
|
|
23
|
+
list: (unitId: number) => {
|
|
24
|
+
return this.context.ready.then(axios =>
|
|
25
|
+
axios.get(`/api/v2/robot/inspectTask/list/${unitId}`)
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
add: (data: any) => {
|
|
29
|
+
return this.context.ready.then(axios =>
|
|
30
|
+
axios.post('/api/v2/robot/inspectTask/add', data)
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
update: (data: any) => {
|
|
34
|
+
return this.context.ready.then(axios =>
|
|
35
|
+
axios.post('/api/v2/robot/inspectTask/update', data)
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
delete: (id: number) => {
|
|
39
|
+
return this.context.ready.then(axios =>
|
|
40
|
+
axios.post(`/api/v2/robot/inspectTask/delete/${id}`)
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
dispatch: (taskId: number) => {
|
|
44
|
+
return this.context.ready.then(axios =>
|
|
45
|
+
axios.post(`/api/v2/robot/inspectTask/dispatch/${taskId}`)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
21
49
|
}
|
|
22
50
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
51
|
+
get record() {
|
|
52
|
+
return {
|
|
53
|
+
list: (taskId: number) => {
|
|
54
|
+
return this.context.ready.then(axios =>
|
|
55
|
+
axios.get(`/api/v2/robot/inspectRecord/list/${taskId}`)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
27
59
|
}
|
|
28
60
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
61
|
+
get cage() {
|
|
62
|
+
return {
|
|
63
|
+
list: (unitId: number) => {
|
|
64
|
+
return this.context.ready.then(axios =>
|
|
65
|
+
axios.get(`/api/v2/robot/cage/list/${unitId}`)
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
addList: (data: any) => {
|
|
69
|
+
return this.context.ready.then(axios =>
|
|
70
|
+
axios.post('/api/v2/robot/cage/addList', data)
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
updateList: (data: any) => {
|
|
74
|
+
return this.context.ready.then(axios =>
|
|
75
|
+
axios.post('/api/v2/robot/cage/updateList', data)
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
update: (data: any) => {
|
|
79
|
+
return this.context.ready.then(axios =>
|
|
80
|
+
axios.post('/api/v2/robot/cage/update', data)
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
delete: (id: number) => {
|
|
84
|
+
return this.context.ready.then(axios =>
|
|
85
|
+
axios.post(`/api/v2/robot/cage/delete/${id}`)
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
deleteList: (unitId: number) => {
|
|
89
|
+
return this.context.ready.then(axios =>
|
|
90
|
+
axios.post(`/api/v2/robot/cage/deleteList/${unitId}`)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
33
94
|
}
|
|
34
95
|
|
|
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
|
-
|
|
96
|
+
get path() {
|
|
97
|
+
return {
|
|
98
|
+
list: (unitId: number) => {
|
|
99
|
+
return this.context.ready.then(axios =>
|
|
100
|
+
axios.get(`/api/v2/robot/inspectPath/list/${unitId}`)
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
add: (data: any) => {
|
|
104
|
+
return this.context.ready.then(axios =>
|
|
105
|
+
axios.post('/api/v2/robot/inspectPath/add', data)
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
update: (data: any) => {
|
|
109
|
+
return this.context.ready.then(axios =>
|
|
110
|
+
axios.post('/api/v2/robot/inspectPath/update', data)
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
delete: (data: any) => {
|
|
114
|
+
return this.context.ready.then(axios =>
|
|
115
|
+
axios.post('/api/v2/robot/inspectPath/delete', data)
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
point: {
|
|
119
|
+
list: (pathId: number) => {
|
|
120
|
+
return this.context.ready.then(axios =>
|
|
121
|
+
axios.get(`/api/v2/robot/inspectPathPoint/list/${pathId}`)
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
addList: (data: any) => {
|
|
125
|
+
return this.context.ready.then(axios =>
|
|
126
|
+
axios.post('/api/v2/robot/inspectPathPoint/addList', data)
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
updateList: (data: any) => {
|
|
130
|
+
return this.context.ready.then(axios =>
|
|
131
|
+
axios.post('/api/v2/robot/inspectPathPoint/updateList', data)
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
update: (data: any) => {
|
|
135
|
+
return this.context.ready.then(axios =>
|
|
136
|
+
axios.post('/api/v2/robot/inspectPathPoint/update', data)
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
delete: (id: number) => {
|
|
140
|
+
return this.context.ready.then(axios =>
|
|
141
|
+
axios.post(`/api/v2/robot/inspectPathPoint/delete/${id}`)
|
|
142
|
+
);
|
|
143
|
+
},
|
|
144
|
+
deleteList: (pathId: number) => {
|
|
145
|
+
return this.context.ready.then(axios =>
|
|
146
|
+
axios.post(`/api/v2/robot/inspectPathPoint/deleteList/${pathId}`)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
69
151
|
}
|
|
70
152
|
}
|