@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.
@@ -24,10 +24,22 @@ class FactoryGateway extends Object {
24
24
  return response.data;
25
25
  }
26
26
  //获得工厂的车间信息
27
- async workshop(id) {
28
- var axios = await this.context.ready;
29
- const response = await axios.get(`/api/v1/workshop/${id}`);
30
- return response.data;
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/v1/factory/${factory.id}/banner/add`, form);
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/v1/factory/banner/delete?id=${code}`);
96
+ return this.context.axios.get(`/api/v2/factory/banner/delete?id=${code}`);
85
97
  },
86
98
  };
87
99
  }
@@ -29,10 +29,22 @@ export class FactoryGateway extends Object {
29
29
  }
30
30
 
31
31
  //获得工厂的车间信息
32
- async workshop(id: number): Promise<any> {
33
- var axios = await this.context.ready;
34
- const response = await axios.get(`/api/v1/workshop/${id}`);
35
- return response.data;
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/v1/factory/${factory.id}/banner/add`,
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/v1/factory/banner/delete?id=${code}`
122
+ `/api/v2/factory/banner/delete?id=${code}`
111
123
  );
112
124
  },
113
125
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {