From 7892ec5a596e6d1fce07bef7661d802dc3fb6afb Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 26 十一月 2021 16:32:56 +0800 Subject: [PATCH] fix 修复重复提交不生效问题 由于概念不同 使用 RedisUtils 重构 --- ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java index 692b567..7b70360 100644 --- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/TestDemoController.java +++ b/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; @@ -54,17 +55,17 @@ return iTestDemoService.queryPageList(bo); } - /** - * 鑷畾涔夊垎椤垫煡璇� - */ - @ApiOperation("鑷畾涔夊垎椤垫煡璇�") - @PreAuthorize("@ss.hasPermi('demo:demo:list')") - @GetMapping("/page") - public TableDataInfo<TestDemoVo> page(@Validated(QueryGroup.class) TestDemoBo bo) { - return iTestDemoService.customPageList(bo); - } + /** + * 鑷畾涔夊垎椤垫煡璇� + */ + @ApiOperation("鑷畾涔夊垎椤垫煡璇�") + @PreAuthorize("@ss.hasPermi('demo:demo:list')") + @GetMapping("/page") + public TableDataInfo<TestDemoVo> page(@Validated(QueryGroup.class) TestDemoBo bo) { + return iTestDemoService.customPageList(bo); + } - /** + /** * 瀵煎嚭娴嬭瘯鍗曡〃鍒楄〃 */ @ApiOperation("瀵煎嚭娴嬭瘯鍗曡〃鍒楄〃") @@ -73,11 +74,11 @@ @PostMapping("/export") public void export(@Validated TestDemoBo bo, HttpServletResponse response) { List<TestDemoVo> list = iTestDemoService.queryList(bo); - // 娴嬭瘯闆姳id瀵煎嚭 + // 娴嬭瘯闆姳id瀵煎嚭 // for (TestDemoVo vo : list) { // vo.setId(1234567891234567893L); // } - ExcelUtil.exportExcel(list, "娴嬭瘯鍗曡〃", TestDemoVo.class, response); + ExcelUtil.exportExcel(list, "娴嬭瘯鍗曡〃", TestDemoVo.class, response); } /** @@ -86,8 +87,9 @@ @ApiOperation("鑾峰彇娴嬭瘯鍗曡〃璇︾粏淇℃伅") @PreAuthorize("@ss.hasPermi('demo:demo:query')") @GetMapping("/{id}") - public AjaxResult<TestDemoVo> getInfo(@NotNull(message = "涓婚敭涓嶈兘涓虹┖") - @PathVariable("id") Long id) { + public AjaxResult<TestDemoVo> getInfo(@ApiParam("娴嬭瘯ID") + @NotNull(message = "涓婚敭涓嶈兘涓虹┖") + @PathVariable("id") Long id) { return AjaxResult.success(iTestDemoService.queryById(id)); } @@ -123,10 +125,11 @@ */ @ApiOperation("鍒犻櫎娴嬭瘯鍗曡〃") @PreAuthorize("@ss.hasPermi('demo:demo: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(iTestDemoService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); } } -- Gitblit v1.9.3