| | |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | @PreAuthorize("hasAuthority('dynamicColumn:add')") |
| | | @PreAuthorize("@ss.hasPermi('dynamicColumn:add')") |
| | | public Result add(@RequestBody @Validated(Add.class) DynamicColumnForm form) { |
| | | return dynamicColumnService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | @PreAuthorize("hasAuthority('dynamicColumn:edit')") |
| | | public Result update(@RequestBody @Validated(Update.class) DynamicColumnForm form) { |
| | | return dynamicColumnService.update(form); |
| | | public Result update(@RequestBody @NotEmpty(message = "数据为空,无法保存") List<DynamicColumnForm> columnList) { |
| | | return dynamicColumnService.update(columnList); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | @PreAuthorize("hasAuthority('dynamicColumn:del')") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return dynamicColumnService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | @PreAuthorize("hasAuthority('dynamicColumn:del:batch')") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return dynamicColumnService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | @PreAuthorize("hasAuthority('dynamicColumn:page')") |
| | | public Result page(DynamicColumnQuery query) { |
| | | return dynamicColumnService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | @PreAuthorize("hasAuthority('dynamicColumn:detail')") |
| | | public Result detail(@PathVariable("id") Integer id) { |
| | | return dynamicColumnService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @PreAuthorize("hasAuthority('dynamicColumn:list')") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return dynamicColumnService.all(); |