yanghb
2025-05-07 bf8f34752cc7584193d490cd6c1fe5850d31a269
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
package com.ruoyi.web.controller.bussiness;
 
import com.ruoyi.common.core.domain.BaseResult;
import com.ruoyi.common.core.domain.ResponseUtils;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.object.response.index.IndexMessageResponse;
import com.ruoyi.system.service.ISysNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
@Validated
@Api(value = "首页",tags = "首页")
@RestController
@RequestMapping(value = "/index")
public class IndexController {
 
    @Autowired
    private ISysNoticeService sysNoticeService;
 
    @ApiOperation(value = "首页消息", notes = "首页消息")
    @PostMapping(value = "/message")
    public BaseResult<IndexMessageResponse> alwaysMessage() {
        IndexMessageResponse response = new IndexMessageResponse();
        List<SysNotice> sysNotices = sysNoticeService.alwaysMessage();
        response.setAlwaysMessages(sysNotices);
        List<SysNotice> payMessage = sysNoticeService.payMessage();
        response.setNoticeMessage(payMessage);
        return ResponseUtils.successResponse(response);
    }
 
}