@ApiOperation(value = "单例查询") @RequestMapping(value = "get", method = RequestMethod.GET) @ResponseBody public ChannelTextFilter get(@ModelAttribute @Valid ChannelTextFilterPK id) { return ctfService.findOne(id); }
@ApiOperation(value = "单例新增") @RequestMapping(value = "create", method = RequestMethod.POST) @ResponseBody public void create(@ModelAttribute @Valid ChannelTextFilter ctf) throws Exception { if (ctfService.findOne(ctf.getId()) == null) ctfService.create(ctf); else throw new Exception("该ID已存在!"); }