xiaoyong931011
2020-08-12 ec7480312a1d80354e695eab72eaa8b8fbc46dc4
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.xcong.excoin.modules.helpCenter.controller;
 
import javax.annotation.Resource;
import javax.validation.Valid;
 
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import com.xcong.excoin.common.response.Result;
import com.xcong.excoin.modules.helpCenter.dto.ImportantNoticePageDto;
import com.xcong.excoin.modules.helpCenter.dto.NewNoticePageDto;
import com.xcong.excoin.modules.helpCenter.service.HelpCenterService;
import com.xcong.excoin.modules.helpCenter.vo.ImportantNoticeVo;
import com.xcong.excoin.modules.helpCenter.vo.NewNoticeInfoVo;
import com.xcong.excoin.modules.helpCenter.vo.NoticeInfoVo;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
 
@RestController
@Slf4j
@RequestMapping(value = "/api/helpCenter")
@Api(value = "HelpCenterController", tags = "帮助中心")
public class HelpCenterController {
    
    @Resource
    HelpCenterService helpCenterService;
    
    /**
     *  最新公告
     */
    @ApiOperation(value="最新公告", notes="最新公告")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = NewNoticeInfoVo.class)})
    @PostMapping(value = "/getNewNoticeList")
    public Result  getNewNoticeList(@RequestBody @Valid NewNoticePageDto newNoticePageDto) {
        return helpCenterService.getNewNoticeList(newNoticePageDto);
    }
    
    /**
     *  重要公告
     */
    @ApiOperation(value="重要公告", notes="重要公告")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = ImportantNoticeVo.class)})
    @PostMapping(value = "/getImportantNoticeList")
    public Result  getImportantNoticeList(@RequestBody @Valid ImportantNoticePageDto importantNoticePageDto) {
        return helpCenterService.getImportantNoticeList(importantNoticePageDto);
    }
    
    /**
     *  公告详情
     */
    @ApiOperation(value="公告详情", notes="公告详情")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = NoticeInfoVo.class)})
    @GetMapping(value = "/getNoticeInfo")
    public Result  getNoticeInfo(@ApiParam(name = "Id", value = "ID", example = "1") @RequestParam(value = "Id", required = false) long Id) {
        return helpCenterService.getNoticeInfo(Id);
    }
 
}