@cpzxrobot/sdk 1.1.98 → 1.2.0

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.
@@ -8,6 +8,7 @@ export class CustomerGateway extends Object {
8
8
  this.context = context;
9
9
  }
10
10
 
11
+ // @deprecated
11
12
  list(args: {
12
13
  pageNo: number;
13
14
  pageSize: number;
@@ -20,6 +21,14 @@ export class CustomerGateway extends Object {
20
21
  });
21
22
  }
22
23
 
24
+ listV2(args: any) {
25
+
26
+ return this.context.ready.then((axios) => {
27
+ return axios.post(`/api/v2/coremde-sale/customer/list/v2`, args);
28
+ });
29
+ }
30
+
31
+
23
32
  listByProvince(area_code: string) {
24
33
  return this.context.ready.then((axios) => {
25
34
  return axios.get(`/api/v2/coremde-sale/customer/province/get?area_code=${area_code}`);
@@ -6,11 +6,17 @@ class CustomerGateway extends Object {
6
6
  super();
7
7
  this.context = context;
8
8
  }
9
+ // @deprecated
9
10
  list(args) {
10
11
  return this.context.ready.then((axios) => {
11
12
  return axios.post(`/api/v2/coremde-sale/customer/list`, args);
12
13
  });
13
14
  }
15
+ listV2(args) {
16
+ return this.context.ready.then((axios) => {
17
+ return axios.post(`/api/v2/coremde-sale/customer/list/v2`, args);
18
+ });
19
+ }
14
20
  listByProvince(area_code) {
15
21
  return this.context.ready.then((axios) => {
16
22
  return axios.get(`/api/v2/coremde-sale/customer/province/get?area_code=${area_code}`);
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ const customer_gateway_1 = require("./customer_gateway");
24
24
  const company_gateway_1 = require("./company_gateway");
25
25
  const news_gateway_1 = require("./news_gateway");
26
26
  const logs_gateway_1 = require("./logs_gateway");
27
+ const robot_gateway_1 = require("./robot_gateway");
27
28
  class Cpzxrobot {
28
29
  constructor(appCode) {
29
30
  this.pigfarm = new pigfarm_gateway_1.PigfarmGateway(this);
@@ -40,6 +41,7 @@ class Cpzxrobot {
40
41
  this.company = new company_gateway_1.CompanyGateway(this);
41
42
  this.news = new news_gateway_1.NewsGateway(this);
42
43
  this.logs = new logs_gateway_1.LogsGateway(this);
44
+ this.robot = new robot_gateway_1.RobotGateway(this);
43
45
  //获取当前浏览器的域名
44
46
  this.ready = new Promise((resolve, reject) => {
45
47
  this.resolveReady = resolve;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RobotGateway = void 0;
4
+ class RobotGateway extends Object {
5
+ constructor(context) {
6
+ super();
7
+ this.context = context;
8
+ }
9
+ async cage(unitId) {
10
+ ///api/v2/robot/getCageList/{unitId}
11
+ var axios = await this.context.ready;
12
+ return axios.get(`/api/v2/robot/getCageList/${unitId}`);
13
+ }
14
+ async alarm(unitId) {
15
+ ///api/v2/robot/getAlarmList/{unitId}
16
+ var axios = await this.context.ready;
17
+ return axios.get(`/api/v2/robot/getAlarmList/${unitId}`);
18
+ }
19
+ }
20
+ exports.RobotGateway = RobotGateway;
package/index.ts CHANGED
@@ -19,6 +19,7 @@ import { CustomerGateway } from "./customer_gateway";
19
19
  import { CompanyGateway } from "./company_gateway";
20
20
  import { NewsGateway } from "./news_gateway";
21
21
  import { LogsGateway } from "./logs_gateway";
22
+ import { RobotGateway } from "./robot_gateway";
22
23
 
23
24
  export class Cpzxrobot {
24
25
  device: DeviceGateway;
@@ -64,6 +65,7 @@ export class Cpzxrobot {
64
65
  company: CompanyGateway = new CompanyGateway(this);
65
66
  news: NewsGateway = new NewsGateway(this);
66
67
  logs: LogsGateway = new LogsGateway(this);
68
+ robot: RobotGateway = new RobotGateway(this);
67
69
 
68
70
 
69
71
  constructor(appCode: string) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.98",
3
+ "version": "1.2.0",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -208,6 +208,7 @@ baseURL: "/"
208
208
  | cpzxrobot().contract.restart | 重新提交合同审批,传入id等参数 |
209
209
  | cpzxrobot().contract.types | 获得合同类型列表,传入factory_id参数 |
210
210
  | cpzxrobot().customer.list | 获得客户列表,传入factory_id和必要的分页参数 |
211
+ | cpzxrobot().customer.listV2 | 更新版本的获得客户列表,传入factory_id和必要的分页参数,请逐步替换list的使用 |
211
212
  | cpzxrobot().customer.get | 获得客户信息,传入id参数 |
212
213
  | cpzxrobot().customer.add | 添加客户 |
213
214
  | cpzxrobot().customer.update | 更新客户 |
@@ -243,6 +244,8 @@ baseURL: "/"
243
244
  | cpzxrobot().news.alarm.list | 获得报警列表,传入必要的分页参数 |
244
245
  | cpzxrobot().getGeo | 获得地理位置信息 |
245
246
  | cpzxrobot().logs.operations | 获得操作日志列表,传入必要的参数 |
247
+ | cpzxrobot().robot.cage | 获得栏位信息 |
248
+ | cpzxrobot().robot.alarm | 获得报警信息,传入必要的参数 |
246
249
 
247
250
  ### 工厂信息接口
248
251
 
@@ -0,0 +1,23 @@
1
+ import { Cpzxrobot, Factory, Unit } from "./types";
2
+
3
+ export class RobotGateway extends Object {
4
+ context: Cpzxrobot;
5
+
6
+ constructor(context: Cpzxrobot) {
7
+ super();
8
+ this.context = context;
9
+ }
10
+
11
+ async cage(unitId: number){
12
+ ///api/v2/robot/getCageList/{unitId}
13
+ var axios = await this.context.ready;
14
+ return axios.get(`/api/v2/robot/getCageList/${unitId}`);
15
+ }
16
+
17
+ async alarm(unitId: number){
18
+ ///api/v2/robot/getAlarmList/{unitId}
19
+ var axios = await this.context.ready;
20
+ return axios.get(`/api/v2/robot/getAlarmList/${unitId}`);
21
+ }
22
+
23
+ }
package/types.d.ts CHANGED
@@ -14,6 +14,7 @@ import { ContractGateway } from "@cpzxrobot/sdk/contract_gateway";
14
14
  import { CustomerGateway } from "@cpzxrobot/sdk/customer_gateway";
15
15
  import { CompanyGateway } from "@cpzxrobot/sdk/company_gateway";
16
16
  import { LogsGateway } from "@cpzxrobot/sdk/logs_gateway";
17
+ import { RobotGateway } from "@cpzxrobot/sdk/robot_gateway";
17
18
 
18
19
  type Device = {
19
20
  id: number;
@@ -331,6 +332,7 @@ class Cpzxrobot {
331
332
  customer: CustomerGateway;
332
333
  company: CompanyGateway;
333
334
  logs: LogsGateway;
335
+ robot: RobotGateway;
334
336
  dict: (key: string) => any;
335
337
  _getSelectedFarmFromMiniApp: () => Promise<Factory>;
336
338
  _getSelectedUnitFromMiniApp: () => Promise<Unit>;