kongzy
2023-12-08 ca5445257b1fdeceddf3fcc2dea18c442023aeb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.gkhy.assess.admin.controller.web.front;
 
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.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
@Api(tags = "前台首页-通知公告前端控制器")
@RestController
@RequestMapping("/notice")
public class NoticeController {
    @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){
        notice.setStatus(0);
        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));
    }
 
 
}