| | |
| | | |
| | | |
| | | import com.gkhy.exam.common.annotation.Log; |
| | | import com.gkhy.exam.common.annotation.RepeatSubmit; |
| | | import com.gkhy.exam.common.api.CommonResult; |
| | | import com.gkhy.exam.common.enums.BusinessType; |
| | | import com.gkhy.exam.system.domain.ExResource; |
| | |
| | | return CommonResult.success(resourceService.selectResourceById(resourceId)); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @Log(title = "资源管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增资源") |
| | | @PostMapping |
| | | public CommonResult add(@Validated @RequestBody ExResource resource){ |
| | | public CommonResult add(@Validated @ModelAttribute ExResource resource){ |
| | | return CommonResult.success(resourceService.insertResource(resource)); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @Log(title = "资源管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "编辑资源") |
| | | @PutMapping |
| | | public CommonResult edit(@Validated @RequestBody ExResource resource){ |
| | | public CommonResult edit(@Validated @ModelAttribute ExResource resource){ |
| | | return CommonResult.success(resourceService.updateResource(resource)); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @Log(title = "资源管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "删除资源") |
| | | @DeleteMapping(value = { "/{resourceId}" }) |