@cpzxrobot/sdk 1.3.58 → 1.3.59

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.
@@ -264,6 +264,10 @@ class PigfarmGateway extends Object {
264
264
  var axios = await this.context.ready;
265
265
  return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, Object.assign(Object.assign({}, lamp), { ids }));
266
266
  },
267
+ getGroup: async (unit) => {
268
+ var axios = await this.context.ready;
269
+ return axios.post(`/api/v1/pigfarm/heatLamp/group?unitId={unit.id}`);
270
+ },
267
271
  deleteGroup: async (id) => {
268
272
  var axios = await this.context.ready;
269
273
  return axios.post(`/api/v1/pigfarm/heatLamp/deleteGroup?id=${id}`);
@@ -106,6 +106,16 @@ class UnitGateway extends Object {
106
106
  return axios.post(`/api/v2/batch/unit/bind`, args);
107
107
  });
108
108
  },
109
+ //获得绑定在某个批次的某个类别的单元信息,当前支持温度补偿信息
110
+ info: (id, type) => {
111
+ return this.context.ready.then((axios) => {
112
+ return axios.get(`/api/v2/batch/unit/bind/${id}`, {
113
+ params: {
114
+ type
115
+ }
116
+ });
117
+ });
118
+ },
109
119
  update: (args) => {
110
120
  return this.context.ready.then((axios) => {
111
121
  return axios.post(`/api/v2/batch/unit/update`, args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.58",
3
+ "version": "1.3.59",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -326,6 +326,10 @@ export class PigfarmGateway extends Object {
326
326
  ids
327
327
  });
328
328
  },
329
+ getGroup: async (unit: Unit): Promise<any> => {
330
+ var axios = await this.context.ready;
331
+ return axios.post(`/api/v1/pigfarm/heatLamp/group?unitId={unit.id}`);
332
+ },
329
333
  deleteGroup: async (id: any): Promise<any> => {
330
334
  var axios = await this.context.ready;
331
335
  return axios.post(`/api/v1/pigfarm/heatLamp/deleteGroup?id=${id}`);
package/unit_gateway.ts CHANGED
@@ -7,7 +7,7 @@ export class UnitGateway extends Object {
7
7
  this.context = context;
8
8
  }
9
9
 
10
- get(id: number|string) {
10
+ get(id: number | string) {
11
11
  return this.context.ready.then((axios) => {
12
12
  return axios.get(`/api/v1/unit/${id}`);
13
13
  });
@@ -123,20 +123,30 @@ export class UnitGateway extends Object {
123
123
  });
124
124
  },
125
125
  //创建批次,和bind可以复用
126
- create: (args:any) => {
126
+ create: (args: any) => {
127
127
  return this.context.ready.then((axios) => {
128
128
  return axios.post(`/api/v2/batch/unit/bind`, args);
129
129
  });
130
130
  },
131
- update: (args:any) => {
131
+ //获得绑定在某个批次的某个类别的单元信息,当前支持温度补偿信息
132
+ info: (id: any, type: 'tempCompensation') => {
133
+ return this.context.ready.then((axios) => {
134
+ return axios.get(`/api/v2/batch/unit/bind/${id}`, {
135
+ params: {
136
+ type
137
+ }
138
+ });
139
+ });
140
+ },
141
+ update: (args: any) => {
132
142
  return this.context.ready.then((axios) => {
133
143
  return axios.post(`/api/v2/batch/unit/update`, args);
134
144
  });
135
145
  },
136
- clear: (args:any) => {
146
+ clear: (args: any) => {
137
147
  return this.context.ready.then((axios) => {
138
148
  return axios.post(
139
- `/api/v2/batch/unit/empty`,args);
149
+ `/api/v2/batch/unit/empty`, args);
140
150
  });
141
151
  },
142
152
  //获取某个批次的所有单元信息
@@ -153,17 +163,17 @@ export class UnitGateway extends Object {
153
163
  });
154
164
  },
155
165
  //查询某个单元的所有批次信息
156
- searchInUnit: (unitId: Number,args :any) => {
166
+ searchInUnit: (unitId: Number, args: any) => {
157
167
  return this.context.ready.then((axios) => {
158
- return axios.post(`/api/v2/batch/${unitId}?`,args);
168
+ return axios.post(`/api/v2/batch/${unitId}?`, args);
159
169
  });
160
170
  },
161
171
  list: (unitIds: Number[]) => {
162
172
  return this.context.ready.then((axios) => {
163
173
  return axios.post(
164
- `/api/v2/batch/unit/getUnitBatchs`,{
165
- unitIds
166
- });
174
+ `/api/v2/batch/unit/getUnitBatchs`, {
175
+ unitIds
176
+ });
167
177
  });
168
178
  },
169
179
  // 获取批次操作记录