@cpzxrobot/sdk 1.0.83 → 1.0.85
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 +2 -2
- package/dist/unit_gateway.js +11 -0
- package/factory_gateway.ts +4 -3
- package/package.json +1 -1
- package/unit_gateway.ts +17 -2
package/dist/factory_gateway.js
CHANGED
|
@@ -78,11 +78,11 @@ class FactoryGateway extends Object {
|
|
|
78
78
|
return {
|
|
79
79
|
//上传banner,formData中包含key为file的文件,返回code
|
|
80
80
|
add: (factory, form) => {
|
|
81
|
-
return this.context.axios.
|
|
81
|
+
return this.context.axios.post(`/api/v1/factory/${factory.id}/banner/add`, form);
|
|
82
82
|
},
|
|
83
83
|
del: (code) => {
|
|
84
84
|
return this.context.axios.get(`/api/v1/factory/banner/delete?id=${code}`);
|
|
85
|
-
}
|
|
85
|
+
},
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
}
|
package/dist/unit_gateway.js
CHANGED
|
@@ -36,6 +36,17 @@ class UnitGateway extends Object {
|
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
},
|
|
39
|
+
delete: (unit, config, type) => {
|
|
40
|
+
return this.context.ready.then((axios) => {
|
|
41
|
+
return axios.get(`/api/v2/unit/config/delete`, {
|
|
42
|
+
params: {
|
|
43
|
+
unitId: unit.id,
|
|
44
|
+
type,
|
|
45
|
+
config,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
},
|
|
39
50
|
};
|
|
40
51
|
}
|
|
41
52
|
v2() {
|
package/factory_gateway.ts
CHANGED
|
@@ -100,15 +100,16 @@ export class FactoryGateway extends Object {
|
|
|
100
100
|
return {
|
|
101
101
|
//上传banner,formData中包含key为file的文件,返回code
|
|
102
102
|
add: (factory: Factory, form: FormData) => {
|
|
103
|
-
return this.context.axios.
|
|
104
|
-
`/api/v1/factory/${factory.id}/banner/add
|
|
103
|
+
return this.context.axios.post(
|
|
104
|
+
`/api/v1/factory/${factory.id}/banner/add`,
|
|
105
|
+
form
|
|
105
106
|
);
|
|
106
107
|
},
|
|
107
108
|
del: (code: String) => {
|
|
108
109
|
return this.context.axios.get(
|
|
109
110
|
`/api/v1/factory/banner/delete?id=${code}`
|
|
110
111
|
);
|
|
111
|
-
}
|
|
112
|
+
},
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
115
|
}
|
package/package.json
CHANGED
package/unit_gateway.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class UnitGateway extends Object {
|
|
|
25
25
|
},
|
|
26
26
|
update: (
|
|
27
27
|
unit: Unit,
|
|
28
|
-
type: "HeatLamp",
|
|
28
|
+
type: "HeatLamp" | "DeviceFilter",
|
|
29
29
|
config: {
|
|
30
30
|
[key: string]: any;
|
|
31
31
|
}
|
|
@@ -38,7 +38,7 @@ export class UnitGateway extends Object {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
},
|
|
41
|
-
get: (unit: Unit, type: "HeatLamp"| "") => {
|
|
41
|
+
get: (unit: Unit, type: "HeatLamp" | "DeviceFilter") => {
|
|
42
42
|
return this.context.ready.then((axios) => {
|
|
43
43
|
return axios.get(`/api/v2/unit/config`, {
|
|
44
44
|
params: {
|
|
@@ -48,6 +48,21 @@ export class UnitGateway extends Object {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
},
|
|
51
|
+
delete: (
|
|
52
|
+
unit: Unit,
|
|
53
|
+
config: string,
|
|
54
|
+
type: "HeatLamp" | "DeviceFilter"
|
|
55
|
+
) => {
|
|
56
|
+
return this.context.ready.then((axios) => {
|
|
57
|
+
return axios.get(`/api/v2/unit/config/delete`, {
|
|
58
|
+
params: {
|
|
59
|
+
unitId: unit.id,
|
|
60
|
+
type,
|
|
61
|
+
config,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
},
|
|
51
66
|
};
|
|
52
67
|
}
|
|
53
68
|
|