@cpzxrobot/sdk 1.3.75 → 1.3.77
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/factory_gateway.js +7 -1
- package/factory_gateway.ts +6 -1
- package/package.json +1 -1
- package/types.d.ts +1 -1
- package/unit_gateway.ts +3 -0
package/dist/factory_gateway.js
CHANGED
|
@@ -33,7 +33,13 @@ class FactoryGateway extends Object {
|
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
var axios = yield this.context.ready;
|
|
35
35
|
const response = yield axios.get(`/api/v1/unit/${id}`);
|
|
36
|
-
|
|
36
|
+
const body = response.data;
|
|
37
|
+
if (body.code === 200) {
|
|
38
|
+
return body.data;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
throw new Error(body.message);
|
|
42
|
+
}
|
|
37
43
|
});
|
|
38
44
|
}
|
|
39
45
|
add(factory) {
|
package/factory_gateway.ts
CHANGED
|
@@ -25,7 +25,12 @@ export class FactoryGateway extends Object {
|
|
|
25
25
|
async unit(id: number): Promise<any> {
|
|
26
26
|
var axios = await this.context.ready;
|
|
27
27
|
const response = await axios.get(`/api/v1/unit/${id}`);
|
|
28
|
-
|
|
28
|
+
const body = response.data;
|
|
29
|
+
if (body.code === 200) {
|
|
30
|
+
return body.data;
|
|
31
|
+
}else{
|
|
32
|
+
throw new Error(body.message);
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
async add(factory: Factory) {
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
package/unit_gateway.ts
CHANGED
|
@@ -113,6 +113,9 @@ export class UnitGateway extends Object {
|
|
|
113
113
|
unitId: Number;
|
|
114
114
|
dayage: Number;
|
|
115
115
|
isTempBatch: Boolean;
|
|
116
|
+
tempAbnormal: Number;
|
|
117
|
+
outputSubtract: Number;
|
|
118
|
+
minOutput: Number;
|
|
116
119
|
}[], batchNo: string, type: "pigfarm") => {
|
|
117
120
|
return this.context.ready.then((axios) => {
|
|
118
121
|
return axios.post(`/api/v2/batch/unit/bind`, {
|