1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package sample.mybatis.velocity;
17
18 import org.springframework.boot.CommandLineRunner;
19 import org.springframework.boot.SpringApplication;
20 import org.springframework.boot.autoconfigure.SpringBootApplication;
21
22 import sample.mybatis.velocity.mapper.CityMapper;
23
24
25
26
27 @SpringBootApplication
28 public class SampleVelocityApplication implements CommandLineRunner {
29
30 public static void main(String[] args) {
31 SpringApplication.run(SampleVelocityApplication.class, args);
32 }
33
34 private final CityMapper cityMapper;
35
36 public SampleVelocityApplication(CityMapper cityMapper) {
37 this.cityMapper = cityMapper;
38 }
39
40 @Override
41 @SuppressWarnings("squid:S106")
42 public void run(String... args) {
43 System.out.println(this.cityMapper.findById(1L));
44 }
45
46 }