From 0bf868d3cdf9226e178c076d3b588ed5207409a0 Mon Sep 17 00:00:00 2001 From: kongzy <kongzy> Date: 星期五, 24 十一月 2023 17:51:40 +0800 Subject: [PATCH] merge --- assess-admin/src/main/java/com/gkhy/assess/admin/controller/SysNoticeController.java | 69 ++++++++++++++++++++++++++++++++++ 1 files changed, 69 insertions(+), 0 deletions(-) diff --git a/assess-admin/src/main/java/com/gkhy/assess/admin/controller/SysNoticeController.java b/assess-admin/src/main/java/com/gkhy/assess/admin/controller/SysNoticeController.java new file mode 100644 index 0000000..df91d52 --- /dev/null +++ b/assess-admin/src/main/java/com/gkhy/assess/admin/controller/SysNoticeController.java @@ -0,0 +1,69 @@ +package com.gkhy.assess.admin.controller; + +import com.gkhy.assess.common.api.CommonResult; +import com.gkhy.assess.system.domain.SysNotice; +import com.gkhy.assess.system.service.SysNoticeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +@Api(tags = "通知公告前端控制器") +@RestController +@RequestMapping("/system/notice") +public class SysNoticeController { + @Autowired + private SysNoticeService noticeService; + + @ApiOperation(value = "通知列表(分页)") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"), + @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10") + }) + @GetMapping("/noticeList") + public CommonResult noticeList(SysNotice notice){ + return CommonResult.success(noticeService.noticeList(notice)); + } + + + @ApiOperation(value = "根据id获取通知详情") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "query", name = "noticeId", dataType = "int", required = true, value = "通知id") + }) + @GetMapping("/getNoticeById") + public CommonResult getNoticeById(@RequestParam(required = true)Long noticeId){ + return CommonResult.success(noticeService.getNoticeById(noticeId)); + } + + @ApiOperation(value = "新增通知") + @PostMapping("/addNotice") + public CommonResult addNotice(@Validated @RequestBody SysNotice notice){ + return CommonResult.success(noticeService.addNotice(notice)); + } + + + @ApiOperation(value = "编辑通知") + @PutMapping("/editNotice") + public CommonResult editNotice(@Validated @RequestBody SysNotice notice){ + return CommonResult.success(noticeService.editNotice(notice)); + } + + + @ApiOperation(value = "删除通知") + @PutMapping("/remove/{noticeId}") + public CommonResult removeNotice(@PathVariable(name = "noticeId")Long noticeId){ + return CommonResult.success(noticeService.deleteNoticeById(noticeId)); + } + + + @ApiOperation(value = "通知状态修改,停用/启用") + @PostMapping("/changeStatus") + public CommonResult changeStatus(SysNotice notice) + { + return CommonResult.success(noticeService.changeNoticeStatus(notice)); + } + +} -- Gitblit v1.9.2