@cpzxrobot/sdk 1.0.70 → 1.0.72

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.
@@ -62,6 +62,12 @@ class PigfarmGateway extends Object {
62
62
  });
63
63
  });
64
64
  }
65
+ //根据单元类型和传感器类型获取告警阈值曲线
66
+ threshold(data, sensorType) {
67
+ return this.context.ready.then((axios) => {
68
+ return axios.get(`/api/v1/pigfarm/alertThershold/${data.type}/${sensorType}`, data);
69
+ });
70
+ }
65
71
  get relay() {
66
72
  return {
67
73
  list: (unit) => {
@@ -57,6 +57,12 @@ class UnitGateway extends Object {
57
57
  return axios.get(`/api/v2/unit/delete?id=${unit.id}`);
58
58
  });
59
59
  },
60
+ //获取单元的展示布局信息
61
+ layout: (unit) => {
62
+ return this.context.ready.then((axios) => {
63
+ return axios.get(`/api/v2/unit/config/appLayout/${unit.id}`);
64
+ });
65
+ },
60
66
  };
61
67
  }
62
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -81,6 +81,16 @@ export class PigfarmGateway extends Object {
81
81
  });
82
82
  }
83
83
 
84
+ //根据单元类型和传感器类型获取告警阈值曲线
85
+ threshold(data: Unit, sensorType: String) {
86
+ return this.context.ready.then((axios) => {
87
+ return axios.get(
88
+ `/api/v1/pigfarm/alertThershold/${data.type}/${sensorType}`,
89
+ data
90
+ );
91
+ });
92
+ }
93
+
84
94
  get relay() {
85
95
  return {
86
96
  list: (unit: Unit) => {
@@ -178,7 +188,7 @@ export class PigfarmGateway extends Object {
178
188
  });
179
189
  },
180
190
  update: (data: weightMeterSensorsConfig) => {
181
- if(!data.weightMeterConfigId){
191
+ if (!data.weightMeterConfigId) {
182
192
  throw new Error("weightMeterConfigId不能为空");
183
193
  }
184
194
  return this.context.ready.then((axios) => {
@@ -189,7 +199,7 @@ export class PigfarmGateway extends Object {
189
199
  });
190
200
  },
191
201
  add: (data: weightMeterSensorsConfig) => {
192
- if(data.weightMeterConfigId){
202
+ if (data.weightMeterConfigId) {
193
203
  throw new Error("weightMeterConfigId不为空");
194
204
  }
195
205
  return this.context.ready.then((axios) => {
package/readme.md CHANGED
@@ -101,11 +101,13 @@ baseURL: "/"
101
101
  | cpzxrobot().pigfarm.heatlamp.set | 设置保温灯的当前工作日龄,调用时,action传"dayage",argc传天数 |
102
102
  | cpzxrobot().pigfarm.heatlamp.switch | 设置保温灯的当前工作日龄,调用时,action"on"或"off" |
103
103
  | cpzxrobot().pigfarm.heatlamp.iotFields | 获取保温灯用于获取iot的字段列表 |
104
+ | cpzxrobot().pigfarm.threshold | 获取单元中特定类型的阈值信息 |
104
105
  | cpzxrobot().scanQrcode | 调用扫码功能,获得扫码文字 |
105
106
  | cpzxrobot().unit.v2.list | 获得单元列表,v2版本 |
106
107
  | cpzxrobot().unit.v2.add | 添加单元,v2版本 |
107
108
  | cpzxrobot().unit.v2.update | 更新单元,v2版本 |
108
109
  | cpzxrobot().unit.v2.delete | 删除单元,v2版本 |
110
+ | cpzxrobot().unit.v2.layout | 获取单元的展示布局,v2版本 |
109
111
 
110
112
 
111
113
  ### 工厂信息接口
package/types.d.ts CHANGED
@@ -215,6 +215,8 @@ type FeedTowerV2 = {
215
215
  volume: number;
216
216
  footNumber: number;
217
217
  loadBearing: number;
218
+ size: number;
219
+ buildTime: string;
218
220
  };
219
221
 
220
222
  export type FeedTower = {
package/unit_gateway.ts CHANGED
@@ -72,6 +72,12 @@ export class UnitGateway extends Object {
72
72
  return axios.get(`/api/v2/unit/delete?id=${unit.id}`);
73
73
  });
74
74
  },
75
+ //获取单元的展示布局信息
76
+ layout: (unit: Unit) => {
77
+ return this.context.ready.then((axios) => {
78
+ return axios.get(`/api/v2/unit/config/appLayout/${unit.id}`);
79
+ });
80
+ },
75
81
  };
76
82
  }
77
83
  }