沙钢智慧能源系统后端代码
dongyukun
2025-06-10 0a2309483b770d448d2f011628d7cc436c322a2e
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
package com.iailab.module.shasteel.api.controller.admin;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.shasteel.job.entity.MessageInfoEntity;
import com.iailab.module.shasteel.job.service.MessageInfoService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import static com.iailab.framework.common.pojo.CommonResult.success;
 
@Slf4j
@RestController
@RequestMapping("/shasteel/api/message")
public class MessageInfoController {
 
    @Autowired
    private MessageInfoService messageInfoService;
 
    @GetMapping("/page")
    public CommonResult<PageResult<MessageInfoEntity>> queryMessagePage(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        PageResult<MessageInfoEntity> page = messageInfoService.getMessagePage(pageNo,pageSize);
        return success(page);
    }
 
    @GetMapping("/count")
    public long getUnreadMessageCount(){
        return messageInfoService.getUnreadMessageCount();
    }
 
    @PostMapping("/read")
    public void read(@RequestBody List<String> ids){
        messageInfoService.readMessage(ids);
    }
}