| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import com.ruoyi.common.core.validate.QueryGroup; |
| | |
| | | @ApiOperation("查询测试树表列表") |
| | | @SaCheckPermission("demo:tree:list") |
| | | @GetMapping("/list") |
| | | public AjaxResult<List<TestTreeVo>> list(@Validated(QueryGroup.class) TestTreeBo bo) { |
| | | public R<List<TestTreeVo>> list(@Validated(QueryGroup.class) TestTreeBo bo) { |
| | | List<TestTreeVo> list = iTestTreeService.queryList(bo); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("获取测试树表详细信息") |
| | | @SaCheckPermission("demo:tree:query") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult<TestTreeVo> getInfo(@ApiParam("测试树ID") |
| | | public R<TestTreeVo> getInfo(@ApiParam("测试树ID") |
| | | @NotNull(message = "主键不能为空") |
| | | @PathVariable("id") Long id) { |
| | | return AjaxResult.success(iTestTreeService.queryById(id)); |
| | | return R.ok(iTestTreeService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "测试树表", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit |
| | | @PostMapping() |
| | | public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody TestTreeBo bo) { |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody TestTreeBo bo) { |
| | | return toAjax(iTestTreeService.insertByBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | |
| | | @Log(title = "测试树表", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit |
| | | @PutMapping() |
| | | public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody TestTreeBo bo) { |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody TestTreeBo bo) { |
| | | return toAjax(iTestTreeService.updateByBo(bo) ? 1 : 0); |
| | | } |
| | | |
| | |
| | | @SaCheckPermission("demo:tree:remove") |
| | | @Log(title = "测试树表", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult<Void> remove(@ApiParam("测试树ID串") |
| | | public R<Void> remove(@ApiParam("测试树ID串") |
| | | @NotEmpty(message = "主键不能为空") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(iTestTreeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); |