@cpzxrobot/sdk 1.1.97 → 1.1.99

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
@@ -23,6 +23,7 @@ const contract_gateway_1 = require("./contract_gateway");
23
23
  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
+ const logs_gateway_1 = require("./logs_gateway");
26
27
  class Cpzxrobot {
27
28
  constructor(appCode) {
28
29
  this.pigfarm = new pigfarm_gateway_1.PigfarmGateway(this);
@@ -38,6 +39,7 @@ class Cpzxrobot {
38
39
  this.customer = new customer_gateway_1.CustomerGateway(this);
39
40
  this.company = new company_gateway_1.CompanyGateway(this);
40
41
  this.news = new news_gateway_1.NewsGateway(this);
42
+ this.logs = new logs_gateway_1.LogsGateway(this);
41
43
  //获取当前浏览器的域名
42
44
  this.ready = new Promise((resolve, reject) => {
43
45
  this.resolveReady = resolve;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogsGateway = void 0;
4
+ class LogsGateway extends Object {
5
+ constructor(context) {
6
+ super();
7
+ this.context = context;
8
+ }
9
+ operations(args) {
10
+ return this.context.ready.then(axios => {
11
+ return axios.post("/api/v2/log/operationRecord", args);
12
+ });
13
+ }
14
+ }
15
+ exports.LogsGateway = LogsGateway;
package/index.ts CHANGED
@@ -18,6 +18,7 @@ import { ContractGateway } from "./contract_gateway";
18
18
  import { CustomerGateway } from "./customer_gateway";
19
19
  import { CompanyGateway } from "./company_gateway";
20
20
  import { NewsGateway } from "./news_gateway";
21
+ import { LogsGateway } from "./logs_gateway";
21
22
 
22
23
  export class Cpzxrobot {
23
24
  device: DeviceGateway;
@@ -62,6 +63,7 @@ export class Cpzxrobot {
62
63
  customer: CustomerGateway = new CustomerGateway(this);
63
64
  company: CompanyGateway = new CompanyGateway(this);
64
65
  news: NewsGateway = new NewsGateway(this);
66
+ logs: LogsGateway = new LogsGateway(this);
65
67
 
66
68
 
67
69
  constructor(appCode: string) {
@@ -0,0 +1,17 @@
1
+ import { Cpzxrobot, Factory, Unit } from "./types";
2
+
3
+ export class LogsGateway extends Object {
4
+ context: Cpzxrobot;
5
+
6
+ constructor(context: Cpzxrobot) {
7
+ super();
8
+ this.context = context;
9
+ }
10
+
11
+ operations(args:any){
12
+ return this.context.ready.then(axios => {
13
+ return axios.post("/api/v2/log/operationRecord", args);
14
+ })
15
+ }
16
+
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.97",
3
+ "version": "1.1.99",
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 | 更新客户 |
@@ -242,6 +243,7 @@ baseURL: "/"
242
243
  | cpzxrobot().news.alarm.add | 添加报警信息 |
243
244
  | cpzxrobot().news.alarm.list | 获得报警列表,传入必要的分页参数 |
244
245
  | cpzxrobot().getGeo | 获得地理位置信息 |
246
+ | cpzxrobot().logs.operations | 获得操作日志列表,传入必要的参数 |
245
247
 
246
248
  ### 工厂信息接口
247
249
 
package/types.d.ts CHANGED
@@ -13,6 +13,7 @@ import { ProductGateway } from "@cpzxrobot/sdk/product_gateway";
13
13
  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
+ import { LogsGateway } from "@cpzxrobot/sdk/logs_gateway";
16
17
 
17
18
  type Device = {
18
19
  id: number;
@@ -329,6 +330,7 @@ class Cpzxrobot {
329
330
  contract: ContractGateway;
330
331
  customer: CustomerGateway;
331
332
  company: CompanyGateway;
333
+ logs: LogsGateway;
332
334
  dict: (key: string) => any;
333
335
  _getSelectedFarmFromMiniApp: () => Promise<Factory>;
334
336
  _getSelectedUnitFromMiniApp: () => Promise<Unit>;