@cpzxrobot/sdk 1.1.57 → 1.1.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.
package/camera_gateway.ts CHANGED
@@ -44,7 +44,7 @@ export class CameraGateway extends Object {
44
44
  //获取工厂天气
45
45
  async weather(id: number): Promise<any> {
46
46
  var axios = await this.context.ready;
47
- const response = await axios.get(`/api/v1/weather?code=${id}`);
47
+ const response = await axios.get(`/api/v1/weather?factoryId=${id}`);
48
48
  return response.data;
49
49
  }
50
50
 
@@ -29,7 +29,7 @@ class CameraGateway extends Object {
29
29
  //获取工厂天气
30
30
  async weather(id) {
31
31
  var axios = await this.context.ready;
32
- const response = await axios.get(`/api/v1/weather?code=${id}`);
32
+ const response = await axios.get(`/api/v1/weather?factoryId=${id}`);
33
33
  return response.data;
34
34
  }
35
35
  async control(data, action, start, stop) {
@@ -258,5 +258,31 @@ class UserGateway extends Object {
258
258
  }
259
259
  });
260
260
  }
261
+ get position() {
262
+ return {
263
+ leader: () => {
264
+ return this.context.ready.then((axios) => {
265
+ return axios.get(`/api/v2/user/info/leader`);
266
+ });
267
+ },
268
+ team: () => {
269
+ return this.context.ready.then((axios) => {
270
+ return axios.get(`/api/v2/user/info/team`);
271
+ });
272
+ },
273
+ //同事
274
+ colleague: () => {
275
+ return this.context.ready.then((axios) => {
276
+ return axios.get(`/api/v2/user/info/colleague`);
277
+ });
278
+ },
279
+ //根据部门获取同事
280
+ byDept: (deptName) => {
281
+ return this.context.ready.then((axios) => {
282
+ return axios.get(`/api/v2/user/dept/${deptName}`);
283
+ });
284
+ }
285
+ };
286
+ }
261
287
  }
262
288
  exports.UserGateway = UserGateway;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.57",
3
+ "version": "1.1.59",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -158,6 +158,10 @@ baseURL: "/"
158
158
  | cpzxrobot().user.workReport.list | 列出用户的日报记录 |
159
159
  | cpzxrobot().user.workReport.get | 获取用户的日报记录 |
160
160
  | cpzxrobot().user.workReport.add | 添加用户的日报记录 |
161
+ | cpzxrobot().user.position.leader | 获取当前用户的领导信息 |
162
+ | cpzxrobot().user.position.team | 获取当前用户的下属团队信息 |
163
+ | cpzxrobot().user.position.colleague | 获取当前用户的同组团队信息,传入teamId参数 |
164
+ | cpzxrobot().user.position.byDept | 按部门获得团队信息,传入deptName参数 |
161
165
  | cpzxrobot().product.list | 获得产品列表,传入factory_id和必要的分页参数 |
162
166
  | cpzxrobot().product.get | 获得产品信息,传入id参数 |
163
167
  | cpzxrobot().product.price.list | 获得产品报价列表 |
@@ -175,6 +179,7 @@ baseURL: "/"
175
179
  | cpzxrobot().project.inquiry.export | 导出项目询盘信息,传入project_id参数,建议传入自定义文件名,否则默认文件名 |
176
180
  | cpzxrobot().project.inquiry.approval | 审批项目询盘,传入id参数和审批意见 |
177
181
  | cpzxrobot().project.document.list | 获得项目文档列表,传入project_id参数 |
182
+ | cpzxrobot().project.document.export | 导出项目文档信息,传入id参数,建议传入自定义文件名,否则默认文件名 |
178
183
  | cpzxrobot().project.material.list | 获得项目物料到货列表,传入project_id参数 |
179
184
  | cpzxrobot().project.attendance.list | 获得项目到岗列表,传入project_id参数 |
180
185
  | cpzxrobot().project.constructionTeam.list | 获得项目施工队列表,传入project_id参数 |
package/user_gateway.ts CHANGED
@@ -285,4 +285,31 @@ export class UserGateway extends Object {
285
285
  }
286
286
  });
287
287
  }
288
+
289
+ get position() {
290
+ return {
291
+ leader: () => {
292
+ return this.context.ready.then((axios) => {
293
+ return axios.get(`/api/v2/user/info/leader`);
294
+ });
295
+ },
296
+ team: () => {
297
+ return this.context.ready.then((axios) => {
298
+ return axios.get(`/api/v2/user/info/team`);
299
+ });
300
+ },
301
+ //同事
302
+ colleague: () => {
303
+ return this.context.ready.then((axios) => {
304
+ return axios.get(`/api/v2/user/info/colleague`);
305
+ });
306
+ },
307
+ //根据部门获取同事
308
+ byDept: (deptName: string) => {
309
+ return this.context.ready.then((axios) => {
310
+ return axios.get(`/api/v2/user/dept/${deptName}`);
311
+ });
312
+ }
313
+ };
314
+ }
288
315
  }