|
|
|
@ -5,21 +5,34 @@ namespace App\Controller; |
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
use App\Constants\ErrorCode; |
|
|
|
use App\Exception\BusinessException; |
|
|
|
use App\Service\DeviceServiceInterFace; |
|
|
|
|
|
|
|
class DeviceController extends BaseController |
|
|
|
{ |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
* @var DeviceServiceInterFace |
|
|
|
*/ |
|
|
|
protected $deviceService; |
|
|
|
|
|
|
|
|
|
|
|
public function bind() |
|
|
|
{ |
|
|
|
$validator = $this->validationFactory->make( |
|
|
|
$request->all(), |
|
|
|
$this->request->all(), |
|
|
|
[ |
|
|
|
'store_id' => 'required|nonempty|integer', |
|
|
|
'device_name' => 'required|nonempty|alpha_num', |
|
|
|
|
|
|
|
], |
|
|
|
[ |
|
|
|
'store_id.required' => '参数不正确', |
|
|
|
'store_id.nonempty' => '参数不正确', |
|
|
|
'store_id.integer' => '参数不正确', |
|
|
|
|
|
|
|
'device_name.required' => '参数不正确', |
|
|
|
'device_name.nonempty' => '参数不正确', |
|
|
|
'device_name.alpha_num' => '参数不正确', |
|
|
|
] |
|
|
|
); |
|
|
|
|
|
|
|
@ -29,9 +42,14 @@ class DeviceController extends BaseController |
|
|
|
$this->result(200,[],$errorMessage); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$store_id = $this->request->input('store_id'); |
|
|
|
$device_name = $this->request->input('device_name'); |
|
|
|
|
|
|
|
$sd = $this->deviceService->bindByStoreId($device_name,$store_id); |
|
|
|
|
|
|
|
return $this->result(0,[$sd],'绑定成功'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public function list() |
|
|
|
|