@cpzxrobot/sdk 1.0.14 → 1.0.16

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.
@@ -12,5 +12,11 @@ class PigfarmGateway extends Object {
12
12
  return axios.get(`/api/v1/pigfarm/${unit.id}/dayage`);
13
13
  });
14
14
  }
15
+ //获得存栏量
16
+ pigCountForUnit(unit) {
17
+ return this.context.ready.then((axios) => {
18
+ return axios.get(`/api/v1/pigfarm/pigcount/${unit.id}`);
19
+ });
20
+ }
15
21
  }
16
22
  exports.PigfarmGateway = PigfarmGateway;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,10 +1,10 @@
1
1
  import { Cpzxrobot, Unit } from ".";
2
2
 
3
3
  export class PigfarmGateway extends Object {
4
- context: Cpzxrobot
4
+ context: Cpzxrobot;
5
5
  constructor(context: Cpzxrobot) {
6
- super()
7
- this.context = context
6
+ super();
7
+ this.context = context;
8
8
  }
9
9
  //获得日龄
10
10
  dayageForUnit(unit: Unit) {
@@ -12,4 +12,11 @@ export class PigfarmGateway extends Object {
12
12
  return axios.get(`/api/v1/pigfarm/${unit.id}/dayage`);
13
13
  });
14
14
  }
15
+
16
+ //获得存栏量
17
+ pigCountForUnit(unit: Unit) {
18
+ return this.context.ready.then((axios) => {
19
+ return axios.get(`/api/v1/pigfarm/pigcount/${unit.id}`);
20
+ });
21
+ }
15
22
  }