TestController.java
1.29 KB
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 cn.com.glsx.consumer;
import cn.com.glsx.consumer.client.SmartPlatformClient;
import cn.com.glsx.consumer.service.DeviceService;
import cn.com.glsx.consumer.service.InfoService;
import com.alibaba.nacos.common.utils.MD5Utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author zhouhaibao
* @date 2021/3/15 17:46
*/
@Controller
@RequestMapping("/test")
@Slf4j
public class TestController {
@Autowired
private InfoService infoService;
@Autowired
private DeviceService deviceService;
@RequestMapping(value = "/test",method = {RequestMethod.POST})
@ResponseBody
public void test(@RequestBody String json) {
infoService.processMessage(json);
}
@RequestMapping(value = "/test1",method = {RequestMethod.GET})
@ResponseBody
public void test1(@RequestParam String id) {
System.out.println(deviceService.getDeviceName(id));
}
}