-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
DemoController.java
39 lines (30 loc) · 1.03 KB
/
DemoController.java
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
package cn.iocoder.springboot.lab45.apollodemo.controller;
import cn.iocoder.springboot.lab45.apollodemo.properties.TestProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/demo")
public class DemoController {
@Value("${test.test}")
private String test;
@GetMapping("/test")
public String test() {
return test;
}
@Autowired
private TestProperties testProperties;
@GetMapping("/test_properties")
public TestProperties testProperties() {
return testProperties;
}
private Logger logger = LoggerFactory.getLogger(getClass());
@GetMapping("/logger")
public void logger() {
logger.debug("[logger][测试一下]");
}
}