<?php
/**
 * ${CARET}
 * @file:NoticeTypesController.php
 * @Created by gnitif
 * @Date: 2023/3/27
 * @Time: 11:52
 */


namespace Modules\System\Http\Controllers;

use Catch\Base\CatchController as Controller;
use Illuminate\Http\Request;
use Modules\System\Http\Requests\NoticeTypeRequest;
use Modules\System\Services\Notice\NoitceTypeService;

class NoticeTypesController extends Controller
{

    /**
     * 获取通知分类列表
     * name: list
     * @param Request $request
     * date 2023/03/27 18:20
     */
    public function  list(Request $request)
    {
        $param  =  $request->all();
        $list =  NoitceTypeService::list($param, $request->input('is_all',false) == true);
        return $list;
    }

    /**
     *  添加分类
     * name: add
     * @param NoticeTypeRequest $request
     * @return mixed
     * date 2023/03/28 18:03
     */
    public function  add(NoticeTypeRequest $request)
    {
        $param = $request->all();
        return  NoitceTypeService::store($param);
    }

    public function  delete($id)
    {
        return  NoitceTypeService::del($id);
    }


}
