@cpzxrobot/sdk 1.1.58 → 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.
@@ -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.58",
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 | 获得产品报价列表 |
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
  }