request->params([ {SEARCH_PARAMS} ]); return success((new {UCASE_NAME}Service())->getPage($data)); } /** * {NOTES}详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new {UCASE_NAME}Service())->getInfo($id)); } /** * 添加{NOTES} * @return \think\Response */ public function add(){ $data = $this->request->params({ADD_FILED_NOTE}); $this->validate($data, '{VALIDATE}.add'); $id = (new {UCASE_NAME}Service())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * {NOTES}编辑 * @param $id {NOTES}id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params({EDIT_FILED_NOTE}); $this->validate($data, '{VALIDATE}.edit'); (new {UCASE_NAME}Service())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * {NOTES}删除 * @param $id {NOTES}id * @return \think\Response */ public function del(int $id){ (new {UCASE_NAME}Service())->del($id); return success('DELETE_SUCCESS'); } {WITH_CONTROLLER} }