request->params([ ['keywords', ''], ]); return success((new SiteGroupService())->getPage($data)); } /** * 分组详情 * @param int $group_id * @return Response */ public function info(int $group_id){ return success((new SiteGroupService())->getInfo($group_id)); } /** * 添加分组 * @return Response * @throws \Exception */ public function add(){ $data = $this->request->params([ ['group_name', ''], ['group_desc', ''], ['group_roles', ''], ]); $this->validate($data, 'app\validate\site\SiteGroup.add'); $group_id = (new SiteGroupService())->add($data); return success(100011, ['group_id' => $group_id]); } /** * 编辑分组 * @param $group_id * @return Response */ public function update($group_id){ $data = $this->request->params([ ['group_name', ''], ['group_desc', ''], ['group_roles', ''], ]); $this->validate($data, 'app\validate\site\SiteGroup.add'); (new SiteGroupService())->update($group_id, $data); return success(100004); } /** * 删除分组 * @param $group_id * @return Response */ public function del($group_id){ (new SiteGroupService())->del($group_id); return success(100004); } /** * 所有分组 * @return Response */ public function all(){ return success( (new SiteGroupService())->getAll()); } }