wuyouming666
2024-03-26 0b30ecf9d6581b4e7a6f7b397ced716acaeaefc0
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
package com.mes.controller;
 
import com.mes.entity.DownGlassInfo;
import com.mes.service.DownGlassInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
@RequestMapping("/downGlassInfo")
public class DownGlassInfoController {
 
    @Autowired
    private DownGlassInfoService downGlassInfoService;
 
    // 获取指定ID的DownGlassInfo信息
    @GetMapping("/{id}")
    public DownGlassInfo getDownGlassInfoById(@PathVariable Integer id) {
        return downGlassInfoService.getDownGlassInfoById(id);
    }
 
//    @GetMapping("/messages")
//    public String getMessages() throws IOException, TimeoutException {
//        List<String> messages = new ArrayList<>();
//        try {
//            messages = RabbitMQUtils.browseMessages("hangzhou2");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        return messages.toString();  // 返回消息列表的字符串表示形式
//    }
 
 
}