@cpzxrobot/sdk 1.0.86 → 1.0.88
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 +18 -6
- package/factory_gateway.ts +18 -6
- package/package.json +1 -1
package/dist/factory_gateway.js
CHANGED
|
@@ -24,10 +24,22 @@ class FactoryGateway extends Object {
|
|
|
24
24
|
return response.data;
|
|
25
25
|
}
|
|
26
26
|
//获得工厂的车间信息
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
get workshop() {
|
|
28
|
+
return {
|
|
29
|
+
get: async (id) => {
|
|
30
|
+
var axios = await this.context.ready;
|
|
31
|
+
const response = await axios.get(`/api/v1/workshop/${id}`);
|
|
32
|
+
return response.data;
|
|
33
|
+
},
|
|
34
|
+
post: async (data) => {
|
|
35
|
+
var axios = await this.context.ready;
|
|
36
|
+
return axios.post(`/api/v1/workshop/create`, data);
|
|
37
|
+
},
|
|
38
|
+
types: async (factoryType) => {
|
|
39
|
+
var axios = await this.context.ready;
|
|
40
|
+
return axios.get(`/api/v1/workshop/types?factoryType=${factoryType}`);
|
|
41
|
+
},
|
|
42
|
+
};
|
|
31
43
|
}
|
|
32
44
|
get info() {
|
|
33
45
|
return {
|
|
@@ -78,10 +90,10 @@ class FactoryGateway extends Object {
|
|
|
78
90
|
return {
|
|
79
91
|
//上传banner,formData中包含key为file的文件,返回code
|
|
80
92
|
add: (factory, form) => {
|
|
81
|
-
return this.context.axios.post(`/api/
|
|
93
|
+
return this.context.axios.post(`/api/v2/factory/${factory.id}/banner/add`, form);
|
|
82
94
|
},
|
|
83
95
|
del: (code) => {
|
|
84
|
-
return this.context.axios.get(`/api/
|
|
96
|
+
return this.context.axios.get(`/api/v2/factory/banner/delete?id=${code}`);
|
|
85
97
|
},
|
|
86
98
|
};
|
|
87
99
|
}
|
package/factory_gateway.ts
CHANGED
|
@@ -29,10 +29,22 @@ export class FactoryGateway extends Object {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
//获得工厂的车间信息
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
get workshop() {
|
|
33
|
+
return {
|
|
34
|
+
get: async (id: number): Promise<any> => {
|
|
35
|
+
var axios = await this.context.ready;
|
|
36
|
+
const response = await axios.get(`/api/v1/workshop/${id}`);
|
|
37
|
+
return response.data;
|
|
38
|
+
},
|
|
39
|
+
post: async (data: any) => {
|
|
40
|
+
var axios = await this.context.ready;
|
|
41
|
+
return axios.post(`/api/v1/workshop/create`, data);
|
|
42
|
+
},
|
|
43
|
+
types: async (factoryType: string) => {
|
|
44
|
+
var axios = await this.context.ready;
|
|
45
|
+
return axios.get(`/api/v1/workshop/types?factoryType=${factoryType}`);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
get info() {
|
|
@@ -101,13 +113,13 @@ export class FactoryGateway extends Object {
|
|
|
101
113
|
//上传banner,formData中包含key为file的文件,返回code
|
|
102
114
|
add: (factory: Factory, form: FormData) => {
|
|
103
115
|
return this.context.axios.post(
|
|
104
|
-
`/api/
|
|
116
|
+
`/api/v2/factory/${factory.id}/banner/add`,
|
|
105
117
|
form
|
|
106
118
|
);
|
|
107
119
|
},
|
|
108
120
|
del: (code: String) => {
|
|
109
121
|
return this.context.axios.get(
|
|
110
|
-
`/api/
|
|
122
|
+
`/api/v2/factory/banner/delete?id=${code}`
|
|
111
123
|
);
|
|
112
124
|
},
|
|
113
125
|
};
|