@Test public void add() throws Exception { String requestJson = JSONObject.toJSONString(DatabaseSet.builder().id(1L).name("name").build()); mockMvc.perform(MockMvcRequestBuilders.get("/groupdbset/add") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(requestJson) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }
@RequestMapping(value = "/add", method = RequestMethod.POST) public ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors) throws SQLException { return addDbSet(dbset, user, errors); }
DatabaseSetController { @RequestMapping(value = "/add", method = RequestMethod.POST) public ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors) throws SQLException { return addDbSet(dbset, user, errors); } }
DatabaseSetController { @RequestMapping(value = "/add", method = RequestMethod.POST) public ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors) throws SQLException { return addDbSet(dbset, user, errors); }  }
DatabaseSetController { @RequestMapping(value = "/add", method = RequestMethod.POST) public ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors) throws SQLException { return addDbSet(dbset, user, errors); }  @RequestMapping(value = "{groupId}/list") ServiceResult<List<DatabaseSet>> lists(@PathVariable("groupId") Long groupId); @RequestMapping(value = "/list") ServiceResult<List<DatabaseSetView>> list(@RequestParam(value = "projectId") Long projectId); @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdateDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeleteDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/sync") ServiceResult<String> sync(@RequestParam("id") Long id, @CurrentUser LoginUser user); @RequestMapping(value = "/check") ConfigCkeckResult check(@CurrentUser LoginUser user, @RequestParam("id") Long id); @RequestMapping(value = "/groupCheck") ConfigCkeckResult<ConfigCheckItem> groupCheck(@CurrentUser LoginUser user, @RequestParam("gourpId") Long gourpId); @RequestMapping(value = "/getdbsetnames") ServiceResult<String> getdbsetnames(@RequestParam("projectId") Long projectId); @RequestMapping(value = "/syncdb") ServiceResult<String> syncdb(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping("/buttons") ServiceResult getDbSetButton(@CurrentUser LoginUser user); }
DatabaseSetController { @RequestMapping(value = "/add", method = RequestMethod.POST) public ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors) throws SQLException { return addDbSet(dbset, user, errors); }  @RequestMapping(value = "{groupId}/list") ServiceResult<List<DatabaseSet>> lists(@PathVariable("groupId") Long groupId); @RequestMapping(value = "/list") ServiceResult<List<DatabaseSetView>> list(@RequestParam(value = "projectId") Long projectId); @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> add(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdateDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeleteDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/sync") ServiceResult<String> sync(@RequestParam("id") Long id, @CurrentUser LoginUser user); @RequestMapping(value = "/check") ConfigCkeckResult check(@CurrentUser LoginUser user, @RequestParam("id") Long id); @RequestMapping(value = "/groupCheck") ConfigCkeckResult<ConfigCheckItem> groupCheck(@CurrentUser LoginUser user, @RequestParam("gourpId") Long gourpId); @RequestMapping(value = "/getdbsetnames") ServiceResult<String> getdbsetnames(@RequestParam("projectId") Long projectId); @RequestMapping(value = "/syncdb") ServiceResult<String> syncdb(@Validated(AddDbSet.class) @RequestBody DatabaseSet dbset, @CurrentUser LoginUser user, Errors errors); @RequestMapping("/buttons") ServiceResult getDbSetButton(@CurrentUser LoginUser user);  }