<?php

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

use App\Http\Controllers\Controller;
use App\Services\Admin\UserService;
use Illuminate\Http\Request;
use App\Services\Admin\YeWu\DepartmentService;
class DepartmentController extends Controller
{
    //获取科室列表
    public function GetList()
    {
        $page =request('page');
        $pageSize =request('pageSize');
        $searchInfo =request('searchInfo');

        $service = new DepartmentService();
        return $service->GetList($searchInfo,$page,$pageSize);
    }
    //获取启用的科室列表
    public function GetEnableList(Request $request)
    {
        $userid = $request->get('userid');//中间件产生的参数
        $group = $request->get('role');//中间件产生的参数
        $is_all = $request->get('is_all');
        $is_all=isset($is_all)?$is_all:false;
        $service = new DepartmentService();
        return $service->GetEnableList(['userid'=>$userid,'group'=>$group],$is_all);
    }

    //保存科室信息
    public function Save()
    {
        $info =request('info');
        $service = new DepartmentService();
        return $service->Save($info);
    }
    public function Del()
    {
        $id =request('id');
        $service = new DepartmentService();
        return $service->Del($id);
    }



}
