公告修改接口

This commit is contained in:
wangliwen 2022-12-09 14:27:40 +08:00
parent 4425851bed
commit 80cbecc6e0
1 changed files with 18 additions and 19 deletions

View File

@ -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<PageData<SysNoticeManagementDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<SysNoticeManagementDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<SysNoticeManagementDTO> page = sysNoticeManagementService.page(params);
return new Result<PageData<SysNoticeManagementDTO>>().ok(page);
@ -61,7 +60,7 @@ public class SysNoticeManagementController {
@GetMapping("{id}")
@ApiOperation("信息")
//@RequiresPermissions("sysnoticemanagement:sysnoticemanagement:info")
public Result<SysNoticeManagementDTO> get(@PathVariable("id") Long id){
public Result<SysNoticeManagementDTO> get(@PathVariable("id") Long id) {
SysNoticeManagementDTO data = sysNoticeManagementService.get(id);
return new Result<SysNoticeManagementDTO>().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");