疯狂的狮子li
2021-11-18 f8487f581be226c3def30676055e0e32a5ac341a
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java
@@ -16,6 +16,7 @@
import com.ruoyi.demo.service.ITestDemoService;
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.security.access.prepost.PreAuthorize;
@@ -86,7 +87,8 @@
    @ApiOperation("获取测试单表详细信息")
    @PreAuthorize("@ss.hasPermi('demo:demo:query')")
    @GetMapping("/{id}")
    public AjaxResult<TestDemoVo> getInfo(@NotNull(message = "主键不能为空")
    public AjaxResult<TestDemoVo> getInfo(@ApiParam("测试ID")
                                          @NotNull(message = "主键不能为空")
                                                  @PathVariable("id") Long id) {
        return AjaxResult.success(iTestDemoService.queryById(id));
    }
@@ -125,7 +127,8 @@
    @PreAuthorize("@ss.hasPermi('demo:demo:remove')")
    @Log(title = "测试单表" , businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
    public AjaxResult<Void> remove(@ApiParam("测试ID串")
                                   @NotEmpty(message = "主键不能为空")
                                       @PathVariable Long[] ids) {
        return toAjax(iTestDemoService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
    }