@Test public void testDelete() throws Exception { String id = "{}"; mockMvc.perform(delete("/tool/tableInfo/1" + id) .header(HttpHeaders.AUTHORIZATION, String.join(" ", accessToken.getTokenType(), accessToken.getValue())) .contentType(MediaType.APPLICATION_JSON_UTF8) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); }
@Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除表信息") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") public Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) { return super.delete(id); }
TableInfoController extends BaseControllerImpl<TableInfo> { @Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除表信息") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") public Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) { return super.delete(id); } }
TableInfoController extends BaseControllerImpl<TableInfo> { @Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除表信息") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") public Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) { return super.delete(id); }  }
TableInfoController extends BaseControllerImpl<TableInfo> { @Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除表信息") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") public Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) { return super.delete(id); }  @Autowired void setTableInfoService(TableInfoService tableInfoService); @Override @GetMapping("/dict") @ApiOperation("获取表信息的数据字典") @PreAuthorize("hasAnyAuthority('" + LIST_PERM + "')") Result<TableInfo> getTableInfo(); @Override @PostMapping @ApiOperation("保存表信息") @PreAuthorize("hasAnyAuthority('" + ADD_PERM + "')") Result<TableInfo> save(@Valid @RequestBody TableInfo model); @Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除表信息") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) {; @Override @PutMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("更新表信息") @PreAuthorize("hasAnyAuthority('" + EDIT_PERM + "')") Result<TableInfo> update(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id, @RequestBody TableInfo model) {; @Override @GetMapping @ApiOperation("查询所有表信息") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<List<TableInfo>> findAll(TableInfo model); @Override @GetMapping("/{page:[0-9]+}/{size:[0-9]+}") @ApiOperation("分页查询表信息列表") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<QueryResult<TableInfo>> query(@ApiParam(value = "页码", required = true) @PathVariable("page") int page, @ApiParam(value = "每页数据条数", required = true) @PathVariable("size") int size, TableInfo model) {; @Override @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("根据ID查询表信息") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<TableInfo> findById(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) {; @Override @PostMapping("/batch") @ApiOperation("批量操作表信息") @PreAuthorize("hasAuthority('" + ADD_PERM +"') and hasAuthority('" + EDIT_PERM +"') and hasAuthority('" + DELETE_PERM +"')") Result batch(@RequestBody BatchModel<TableInfo> batch); @Override @PostMapping("/import") @ApiOperation("从文件导入数据字典") @PreAuthorize("hasAnyAuthority('" + IMPORT_PERM + "')") Result<List<TableInfo>> importData(MultipartFile file); @Override @GetMapping("/export") @ApiOperation("导出数据字典到文件") @PreAuthorize("permitAll()") void exportData(@RequestBody(required = false) List<String> ids, HttpServletResponse response); }
TableInfoController extends BaseControllerImpl<TableInfo> { @Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除表信息") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") public Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) { return super.delete(id); }  @Autowired void setTableInfoService(TableInfoService tableInfoService); @Override @GetMapping("/dict") @ApiOperation("获取表信息的数据字典") @PreAuthorize("hasAnyAuthority('" + LIST_PERM + "')") Result<TableInfo> getTableInfo(); @Override @PostMapping @ApiOperation("保存表信息") @PreAuthorize("hasAnyAuthority('" + ADD_PERM + "')") Result<TableInfo> save(@Valid @RequestBody TableInfo model); @Override @DeleteMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("删除表信息") @PreAuthorize("hasAnyAuthority('" + DELETE_PERM + "')") Result<Void> delete(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) {; @Override @PutMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("更新表信息") @PreAuthorize("hasAnyAuthority('" + EDIT_PERM + "')") Result<TableInfo> update(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id, @RequestBody TableInfo model) {; @Override @GetMapping @ApiOperation("查询所有表信息") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<List<TableInfo>> findAll(TableInfo model); @Override @GetMapping("/{page:[0-9]+}/{size:[0-9]+}") @ApiOperation("分页查询表信息列表") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<QueryResult<TableInfo>> query(@ApiParam(value = "页码", required = true) @PathVariable("page") int page, @ApiParam(value = "每页数据条数", required = true) @PathVariable("size") int size, TableInfo model) {; @Override @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("根据ID查询表信息") @PreAuthorize("hasAnyAuthority('" + QUERY_PERM + "')") Result<TableInfo> findById(@ApiParam(value = "主键id", required = true) @PathVariable("id") String id) {; @Override @PostMapping("/batch") @ApiOperation("批量操作表信息") @PreAuthorize("hasAuthority('" + ADD_PERM +"') and hasAuthority('" + EDIT_PERM +"') and hasAuthority('" + DELETE_PERM +"')") Result batch(@RequestBody BatchModel<TableInfo> batch); @Override @PostMapping("/import") @ApiOperation("从文件导入数据字典") @PreAuthorize("hasAnyAuthority('" + IMPORT_PERM + "')") Result<List<TableInfo>> importData(MultipartFile file); @Override @GetMapping("/export") @ApiOperation("导出数据字典到文件") @PreAuthorize("permitAll()") void exportData(@RequestBody(required = false) List<String> ids, HttpServletResponse response);  }