提交其他文件
This commit is contained in:
61
app/storeapi/controller/DeviceController.php
Normal file
61
app/storeapi/controller/DeviceController.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace app\storeapi\controller;
|
||||
|
||||
use app\storeapi\logic\DeviceLogic;
|
||||
use app\storeapi\validate\DeviceValidate;
|
||||
|
||||
class DeviceController extends BaseApiController
|
||||
{
|
||||
|
||||
public array $notNeedLogin = ['deviceOff_On'];
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* 门店设备列表
|
||||
*/
|
||||
public function deviceList(){
|
||||
|
||||
$params = (new DeviceValidate())->post()->goCheck('deviceList');
|
||||
|
||||
$result = DeviceLogic::getDeviceLists($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(DeviceLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* 空开控制
|
||||
*/
|
||||
public function deviceOff_On(){
|
||||
|
||||
$params = (new DeviceValidate())->post()->goCheck('deviceOff_On');
|
||||
|
||||
$result = DeviceLogic::deviceOff_On($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(DeviceLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* 门锁控制
|
||||
*/
|
||||
public function lockOff_On(){
|
||||
|
||||
$params = (new DeviceValidate())->post()->goCheck('lockOff_On');
|
||||
|
||||
$result = DeviceLogic::lockOff_On($params);
|
||||
if ($result === false) {
|
||||
return $this->fail(DeviceLogic::getError());
|
||||
}
|
||||
return $this->success('', $result, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user