@Test public void loadPageList() throws Exception { Paging<DatabaseSet> paging = new Paging<>(); paging.setData(new DatabaseSet()); String requestJson = JSONObject.toJSONString(paging); mockMvc.perform(MockMvcRequestBuilders.post("/groupdbset/list") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(requestJson) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }
@RequestMapping(value = "/list", method = RequestMethod.POST) public ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user) throws SQLException { if (StringUtils.isNotBlank(paging.getData().getApp_id())) { if (permissionService.isManagerById(user.getId())) { return ServiceResult.success(databaseSetService.findDbSetPageListByAppid(paging)); } else { return ServiceResult.success(ListResult.builder().list(ListUtils.EMPTY_LIST).build()); } } return ServiceResult.success(databaseSetService.findDbSetPageList(paging)); }
DatabaseSetController { @RequestMapping(value = "/list", method = RequestMethod.POST) public ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user) throws SQLException { if (StringUtils.isNotBlank(paging.getData().getApp_id())) { if (permissionService.isManagerById(user.getId())) { return ServiceResult.success(databaseSetService.findDbSetPageListByAppid(paging)); } else { return ServiceResult.success(ListResult.builder().list(ListUtils.EMPTY_LIST).build()); } } return ServiceResult.success(databaseSetService.findDbSetPageList(paging)); } }
DatabaseSetController { @RequestMapping(value = "/list", method = RequestMethod.POST) public ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user) throws SQLException { if (StringUtils.isNotBlank(paging.getData().getApp_id())) { if (permissionService.isManagerById(user.getId())) { return ServiceResult.success(databaseSetService.findDbSetPageListByAppid(paging)); } else { return ServiceResult.success(ListResult.builder().list(ListUtils.EMPTY_LIST).build()); } } return ServiceResult.success(databaseSetService.findDbSetPageList(paging)); }  }
DatabaseSetController { @RequestMapping(value = "/list", method = RequestMethod.POST) public ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user) throws SQLException { if (StringUtils.isNotBlank(paging.getData().getApp_id())) { if (permissionService.isManagerById(user.getId())) { return ServiceResult.success(databaseSetService.findDbSetPageListByAppid(paging)); } else { return ServiceResult.success(ListResult.builder().list(ListUtils.EMPTY_LIST).build()); } } return ServiceResult.success(databaseSetService.findDbSetPageList(paging)); }  @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 = "/list", method = RequestMethod.POST) public ServiceResult<ListResult<DatabaseSetView>> loadPageList(@RequestBody Paging<DatabaseSet> paging, @CurrentUser LoginUser user) throws SQLException { if (StringUtils.isNotBlank(paging.getData().getApp_id())) { if (permissionService.isManagerById(user.getId())) { return ServiceResult.success(databaseSetService.findDbSetPageListByAppid(paging)); } else { return ServiceResult.success(ListResult.builder().list(ListUtils.EMPTY_LIST).build()); } } return ServiceResult.success(databaseSetService.findDbSetPageList(paging)); }  @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);  }