request->params([ ["title",""], ["content",""], ["category",""], ["publisher_id",""], ["status",""] ]); return success((new ArticlesService())->getPage($data)); } /** * 文章管理详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new ArticlesService())->getInfo($id)); } /** * 添加文章管理 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["title",""], ["content",""], ["category",""], ["publisher_id",0], ["status",""], ]); $this->validate($data, 'addon\zhjw\app\validate\articles\Articles.add'); $id = (new ArticlesService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 文章管理编辑 * @param $id 文章管理id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["title",""], ["content",""], ["category",""], ["publisher_id",0], ["status",""], ]); $this->validate($data, 'addon\zhjw\app\validate\articles\Articles.edit'); (new ArticlesService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 文章管理删除 * @param $id 文章管理id * @return \think\Response */ public function del(int $id){ (new ArticlesService())->del($id); return success('DELETE_SUCCESS'); } public function getSysUserAll(){ return success(( new ArticlesService())->getSysUserAll()); } }