From 80cbecc6e0e3ef55f5d4c775661c8017f23e02a8 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 9 Dec 2022 14:27:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E4=BF=AE=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysNoticeManagementController.java | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java b/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java index cc8690b2..d71ca655 100644 --- a/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java +++ b/renren-admin/src/main/java/io/renren/modules/sysnoticemanagement/controller/SysNoticeManagementController.java @@ -17,7 +17,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; @@ -29,14 +28,14 @@ import java.util.Map; /** -* 公告管理 -* -* @author dg 2498628697@qq.com -* @since 1.0 2022-12-01 -*/ + * 公告管理 + * + * @author dg 2498628697@qq.com + * @since 1.0 2022-12-01 + */ @RestController @RequestMapping("/sysnoticemanagement") -@Api(tags="公告管理") +@Api(tags = "公告管理") public class SysNoticeManagementController { @Autowired private SysNoticeManagementService sysNoticeManagementService; @@ -44,15 +43,15 @@ public class SysNoticeManagementController { @GetMapping("page") @ApiOperation("分页") @ApiImplicitParams({ - @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , - @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , - @ApiImplicitParam(name = "days", value = "公告显示周期", paramType = "query", dataType="int") , - @ApiImplicitParam(name = "content", value = "公告内容", paramType = "query", dataType="int") , - @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , - @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = "days", value = "公告显示周期", paramType = "query", dataType = "int"), + @ApiImplicitParam(name = "content", value = "公告内容", paramType = "query", dataType = "int"), + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String") }) //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:page") - public Result> page(@ApiIgnore @RequestParam Map params){ + public Result> page(@ApiIgnore @RequestParam Map params) { PageData page = sysNoticeManagementService.page(params); return new Result>().ok(page); @@ -61,7 +60,7 @@ public class SysNoticeManagementController { @GetMapping("{id}") @ApiOperation("信息") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:info") - public Result get(@PathVariable("id") Long id){ + public Result get(@PathVariable("id") Long id) { SysNoticeManagementDTO data = sysNoticeManagementService.get(id); return new Result().ok(data); @@ -71,7 +70,7 @@ public class SysNoticeManagementController { @ApiOperation("保存") @LogOperation("保存") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:save") - public Result save(@RequestBody SysNoticeManagementDTO dto){ + public Result save(@RequestBody SysNoticeManagementDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); dto.setDelFlag(0); @@ -81,11 +80,11 @@ public class SysNoticeManagementController { return new Result(); } - @PutMapping + @PostMapping(value = "/update") @ApiOperation("修改") @LogOperation("修改") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:update") - public Result update(@RequestBody SysNoticeManagementDTO dto){ + public Result update(@RequestBody SysNoticeManagementDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -98,7 +97,7 @@ public class SysNoticeManagementController { @ApiOperation("删除") @LogOperation("删除") //@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:delete") - public Result delete(@RequestBody Long[] ids){ + public Result delete(@RequestBody Long[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id");