Commit 598cc868871777ec6f3c9d832243c8ff4873f84f
1 parent
44c0de47
Exists in
master
test数据
Showing
2 changed files
with
127 additions
and
108 deletions
Show diff stats
springboot/pom.xml
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
3 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
4 | - <modelVersion>4.0.0</modelVersion> | ||
5 | - <parent> | ||
6 | - <groupId>org.springframework.boot</groupId> | ||
7 | - <artifactId>spring-boot-starter-parent</artifactId> | ||
8 | - <version>2.1.3.RELEASE</version> | ||
9 | - <relativePath/> <!-- lookup parent from repository --> | ||
10 | - </parent> | ||
11 | - <groupId>com.sincre</groupId> | ||
12 | - <artifactId>springboot</artifactId> | ||
13 | - <version>0.0.1-SNAPSHOT</version> | ||
14 | - <name>springboot</name> | ||
15 | - <description>Demo project for Spring Boot</description> | ||
16 | - | ||
17 | - <properties> | ||
18 | - <java.version>1.8</java.version> | ||
19 | - </properties> | ||
20 | - | ||
21 | - <dependencies> | ||
22 | - <dependency> | ||
23 | - <groupId>org.springframework.boot</groupId> | ||
24 | - <artifactId>spring-boot-starter-web</artifactId> | ||
25 | - </dependency> | ||
26 | - | ||
27 | - <dependency> | ||
28 | - <groupId>org.springframework.boot</groupId> | ||
29 | - <artifactId>spring-boot-starter-jdbc</artifactId> | ||
30 | - </dependency> | ||
31 | - | ||
32 | - <dependency> | ||
33 | - <groupId>org.springframework.boot</groupId> | ||
34 | - <artifactId>spring-boot-starter-test</artifactId> | ||
35 | - <scope>test</scope> | ||
36 | - </dependency> | ||
37 | - | ||
38 | - <!--API文档配置--> | ||
39 | - <dependency> | ||
40 | - <groupId>io.springfox</groupId> | ||
41 | - <artifactId>springfox-swagger-ui</artifactId> | ||
42 | - <version>2.9.2</version> | ||
43 | - </dependency> | ||
44 | - | ||
45 | - <dependency> | ||
46 | - <groupId>io.springfox</groupId> | ||
47 | - <artifactId>springfox-swagger2</artifactId> | ||
48 | - <version>2.9.2</version> | ||
49 | - </dependency> | ||
50 | - | ||
51 | - <dependency> | ||
52 | - <groupId>com.microsoft.sqlserver</groupId> | ||
53 | - <artifactId>mssql-jdbc</artifactId> | ||
54 | - <scope>runtime</scope> | ||
55 | - </dependency> | ||
56 | - | ||
57 | - <dependency> | ||
58 | - <groupId>org.mybatis.spring.boot</groupId> | ||
59 | - <artifactId>mybatis-spring-boot-starter</artifactId> | ||
60 | - <version>2.0.0</version> | ||
61 | - </dependency> | ||
62 | - </dependencies> | ||
63 | - | ||
64 | - <build> | ||
65 | - <plugins> | ||
66 | - <plugin> | ||
67 | - <groupId>org.springframework.boot</groupId> | ||
68 | - <artifactId>spring-boot-maven-plugin</artifactId> | ||
69 | - </plugin> | ||
70 | - </plugins> | ||
71 | - </build> | ||
72 | - | ||
73 | -</project> | 1 | +<?xml version="1.0" encoding="UTF-8"?> |
2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
3 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
4 | + <modelVersion>4.0.0</modelVersion> | ||
5 | + <parent> | ||
6 | + <groupId>org.springframework.boot</groupId> | ||
7 | + <artifactId>spring-boot-starter-parent</artifactId> | ||
8 | + <version>2.1.3.RELEASE</version> | ||
9 | + <relativePath/> <!-- lookup parent from repository --> | ||
10 | + </parent> | ||
11 | + <groupId>com.sincre</groupId> | ||
12 | + <artifactId>springboot</artifactId> | ||
13 | + <version>0.0.1-SNAPSHOT</version> | ||
14 | + <packaging>war</packaging> | ||
15 | + <name>springboot</name> | ||
16 | + <description>Demo project for Spring Boot</description> | ||
17 | + | ||
18 | + <properties> | ||
19 | + <java.version>1.8</java.version> | ||
20 | + </properties> | ||
21 | + | ||
22 | + <dependencies> | ||
23 | + <dependency> | ||
24 | + <groupId>org.springframework.boot</groupId> | ||
25 | + <artifactId>spring-boot-starter-web</artifactId> | ||
26 | + <exclusions> | ||
27 | + <exclusion> | ||
28 | + <groupId>org.springframework.boot</groupId> | ||
29 | + <artifactId>spring-boot-starter-tomcat</artifactId> | ||
30 | + </exclusion> | ||
31 | + </exclusions> | ||
32 | + </dependency> | ||
33 | + | ||
34 | + <dependency> | ||
35 | + <groupId>org.springframework.boot</groupId> | ||
36 | + <artifactId>spring-boot-starter-jdbc</artifactId> | ||
37 | + </dependency> | ||
38 | + | ||
39 | + <dependency> | ||
40 | + <groupId>org.springframework.boot</groupId> | ||
41 | + <artifactId>spring-boot-starter-test</artifactId> | ||
42 | + <scope>test</scope> | ||
43 | + </dependency> | ||
44 | + <dependency> | ||
45 | + <groupId>javax.servlet</groupId> | ||
46 | + <artifactId>javax.servlet-api</artifactId> | ||
47 | + <version>4.0.1</version> | ||
48 | + </dependency> | ||
49 | + <!--API文档配置--> | ||
50 | + <dependency> | ||
51 | + <groupId>io.springfox</groupId> | ||
52 | + <artifactId>springfox-swagger-ui</artifactId> | ||
53 | + <version>2.9.2</version> | ||
54 | + </dependency> | ||
55 | + | ||
56 | + <dependency> | ||
57 | + <groupId>io.springfox</groupId> | ||
58 | + <artifactId>springfox-swagger2</artifactId> | ||
59 | + <version>2.9.2</version> | ||
60 | + </dependency> | ||
61 | + | ||
62 | + <dependency> | ||
63 | + <groupId>com.microsoft.sqlserver</groupId> | ||
64 | + <artifactId>mssql-jdbc</artifactId> | ||
65 | + <scope>runtime</scope> | ||
66 | + </dependency> | ||
67 | + | ||
68 | + <dependency> | ||
69 | + <groupId>org.mybatis.spring.boot</groupId> | ||
70 | + <artifactId>mybatis-spring-boot-starter</artifactId> | ||
71 | + <version>2.0.0</version> | ||
72 | + </dependency> | ||
73 | + </dependencies> | ||
74 | + | ||
75 | + <build> | ||
76 | + <finalName>springboot-sincere</finalName> | ||
77 | + <plugins> | ||
78 | + <plugin> | ||
79 | + <groupId>org.springframework.boot</groupId> | ||
80 | + <artifactId>spring-boot-maven-plugin</artifactId> | ||
81 | + </plugin> | ||
82 | + </plugins> | ||
83 | + </build> | ||
84 | + | ||
85 | +</project> |
springboot/src/main/java/com/sincre/springboot/SpringbootApplication.java
1 | -package com.sincre.springboot; | ||
2 | - | ||
3 | -import org.apache.ibatis.annotations.Mapper; | ||
4 | -import org.mybatis.spring.annotation.MapperScan; | ||
5 | -import org.springframework.boot.SpringApplication; | ||
6 | -import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
7 | - | ||
8 | -import javax.swing.*; | ||
9 | -import java.awt.*; | ||
10 | - | ||
11 | -@MapperScan("com.sincre.springboot.mapper") | ||
12 | -@SpringBootApplication | ||
13 | -public class SpringbootApplication { | ||
14 | - | ||
15 | - public static void main(String[] args) { | ||
16 | - | ||
17 | - SpringApplication.run(SpringbootApplication.class, args); | ||
18 | - System.out.println("classpath:" + new SpringbootApplication().getClass().getResource("")); | ||
19 | - | ||
20 | -// new SpringbootApplication().initFrame(); | ||
21 | - } | ||
22 | - | ||
23 | - private void initFrame() { | ||
24 | - JFrame jFrame = new JFrame(); | ||
25 | - //设置窗口是否可视 | ||
26 | - jFrame.setVisible(true); | ||
27 | -//设置窗口的大小是否可以调节 | ||
28 | - jFrame.setResizable(false); | ||
29 | -//设置窗口大小和x,y位置 | ||
30 | - jFrame.setBounds(100, 100, 600, 800); | ||
31 | -//设置窗口退出则程序退出 | ||
32 | - jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
33 | - } | ||
34 | - | ||
35 | -} | 1 | +package com.sincre.springboot; |
2 | + | ||
3 | +import org.apache.ibatis.annotations.Mapper; | ||
4 | +import org.mybatis.spring.annotation.MapperScan; | ||
5 | +import org.springframework.boot.SpringApplication; | ||
6 | +import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
7 | +import org.springframework.boot.builder.SpringApplicationBuilder; | ||
8 | +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | ||
9 | + | ||
10 | +import javax.swing.*; | ||
11 | +import java.awt.*; | ||
12 | + | ||
13 | +@MapperScan("com.sincre.springboot.mapper") | ||
14 | +@SpringBootApplication | ||
15 | +public class SpringbootApplication extends SpringBootServletInitializer { | ||
16 | + | ||
17 | + public static void main(String[] args) { | ||
18 | + | ||
19 | + SpringApplication.run(SpringbootApplication.class, args); | ||
20 | + System.out.println("classpath:" + new SpringbootApplication().getClass().getResource("")); | ||
21 | + | ||
22 | +// new SpringbootApplication().initFrame(); | ||
23 | + } | ||
24 | + | ||
25 | + @Override | ||
26 | + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { | ||
27 | + return builder.sources(SpringbootApplication.class); | ||
28 | + } | ||
29 | + | ||
30 | + private void initFrame() { | ||
31 | + JFrame jFrame = new JFrame(); | ||
32 | + //设置窗口是否可视 | ||
33 | + jFrame.setVisible(true); | ||
34 | +//设置窗口的大小是否可以调节 | ||
35 | + jFrame.setResizable(false); | ||
36 | +//设置窗口大小和x,y位置 | ||
37 | + jFrame.setBounds(100, 100, 600, 800); | ||
38 | +//设置窗口退出则程序退出 | ||
39 | + jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | ||
40 | + } | ||
41 | + | ||
42 | +} |