request->params([ ["campus_id",""], ["person_id",""], ["role_id",""], ["dept_id",""], ["created_at",""], ["updated_at",""], ["deleted_at",""] ]); return success((new CampusPersonRoleService())->getPage($data)); } /** * 角色关系详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new CampusPersonRoleService())->getInfo($id)); } /** * 添加角色关系 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["campus_id",0], ["person_id",0], ["role_id",0], ["dept_id",0], ["created_at",1747386167], ["updated_at",1747386167], ["deleted_at",1747386167] ]); $this->validate($data, 'app\validate\campus_person_role\CampusPersonRole.add'); $id = (new CampusPersonRoleService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 角色关系编辑 * @param $id 角色关系id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["campus_id",0], ["person_id",0], ["role_id",0], ["dept_id",0], ["created_at",1747386167], ["updated_at",1747386167], ["deleted_at",1747386167] ]); $this->validate($data, 'app\validate\campus_person_role\CampusPersonRole.edit'); (new CampusPersonRoleService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 角色关系删除 * @param $id 角色关系id * @return \think\Response */ public function del(int $id){ (new CampusPersonRoleService())->del($id); return success('DELETE_SUCCESS'); } }