phanes
2022-01-16 868942e202aeb967b8ce47b38cc2433a636a128d
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestTreeController.java
@@ -15,8 +15,8 @@
import com.ruoyi.demo.service.ITestTreeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -34,7 +34,7 @@
 */
@Validated
@Api(value = "测试树表控制器", tags = {"测试树表管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RequiredArgsConstructor
@RestController
@RequestMapping("/demo/tree")
public class TestTreeController extends BaseController {
@@ -61,7 +61,7 @@
    @GetMapping("/export")
    public void export(@Validated TestTreeBo bo, HttpServletResponse response) {
        List<TestTreeVo> list = iTestTreeService.queryList(bo);
      ExcelUtil.exportExcel(list, "测试树表", TestTreeVo.class, response);
        ExcelUtil.exportExcel(list, "测试树表", TestTreeVo.class, response);
    }
    /**
@@ -70,8 +70,9 @@
    @ApiOperation("获取测试树表详细信息")
    @SaCheckPermission("demo:tree:query")
    @GetMapping("/{id}")
    public AjaxResult<TestTreeVo> getInfo(@NotNull(message = "主键不能为空")
                                                  @PathVariable("id") Long id) {
    public AjaxResult<TestTreeVo> getInfo(@ApiParam("测试树ID")
                                          @NotNull(message = "主键不能为空")
                                          @PathVariable("id") Long id) {
        return AjaxResult.success(iTestTreeService.queryById(id));
    }
@@ -104,10 +105,11 @@
     */
    @ApiOperation("删除测试树表")
    @SaCheckPermission("demo:tree:remove")
    @Log(title = "测试树表" , businessType = BusinessType.DELETE)
    @Log(title = "测试树表", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
                                       @PathVariable Long[] ids) {
    public AjaxResult<Void> remove(@ApiParam("测试树ID串")
                                   @NotEmpty(message = "主键不能为空")
                                   @PathVariable Long[] ids) {
        return toAjax(iTestTreeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
    }
}