Temperature.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\common\model\TemperatureDevice;
  5. use app\hander\HelpHander;
  6. use app\temperature\controller\Push;
  7. use think\App;
  8. require_once $_SERVER['DOCUMENT_ROOT'] . '/../vendor/wenkong/TemperatureDevice.php';
  9. class Temperature extends Base
  10. {
  11. public function __construct(App $app) {
  12. parent::__construct($app);
  13. $this->api = new Push($this->app);
  14. }
  15. public function lists(){
  16. $res = $this->api->getDeviceData();
  17. $page = input('page/d',1);
  18. $size = input('size/d',10);
  19. $groupId = input('groupId/d',0);
  20. $m = new TemperatureDevice();
  21. $list =$m->getList($page,$size,$this->orgId,$this->userId,$groupId);
  22. HelpHander::success($list);
  23. }
  24. public function getGroup(){
  25. $m = new TemperatureDevice();
  26. $page = input('page/d',1);
  27. $size = input('size/d',10);
  28. $list =$m->getGroup($this->orgId,$this->userId,$page,$size);
  29. HelpHander::success($list);
  30. }
  31. }