<?php

namespace App\Http\Controllers\API\Admin\YeWu;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Services\Admin\YeWu\DevicesService;

class DevicesController extends Controller
{
    public function GetList()
    {
        $page = request('page');
        $pageSize = request('pageSize');
        $searchInfo = request('searchInfo');
        $service = new DevicesService();
        return $service->GetList($searchInfo, $page, $pageSize);
    }

    //获取启用的设备列表
    public function GetEnableList()
    {
        $service = new DevicesService();
        return $service->GetEnableList();
    }

    public function Save(Request $request)
    {
        $userid = $request->get('userid');//中间件产生的参数
        $data = request('Info');
        $service = new DevicesService();
        return $service->Save($data, $userid);
    }

    public function Del()
    {
        $id = request('id');
        $service = new DevicesService();
        return $service->Del($id);
    }

}
