Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bfd2b13

Browse files
java9-spring-web
1 parent d12616d commit bfd2b13

File tree

16 files changed

+568
-0
lines changed

16 files changed

+568
-0
lines changed

‎.gitignore‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
*#*#
2+
*.#*
3+
*.iml
4+
*.ipr
5+
*.iws
6+
*.pyc
7+
*.pyo
8+
*.swp
9+
*~
10+
.DS_Store
11+
.cache
12+
.classpath
13+
.ensime
14+
.ensime_cache/
15+
.ensime_lucene
16+
.generated-mima*
17+
.idea/
18+
.idea_modules/
19+
.project
20+
.pydevproject
21+
.scala_dependencies
22+
.settings
23+
/lib/
24+
R-unit-tests.log
25+
R/unit-tests.out
26+
R/cran-check.out
27+
R/pkg/vignettes/sparkr-vignettes.html
28+
R/pkg/tests/fulltests/Rplots.pdf
29+
build/*.jar
30+
build/apache-maven*
31+
build/scala*
32+
build/zinc*
33+
cache
34+
checkpoint
35+
conf/*.cmd
36+
conf/*.conf
37+
conf/*.properties
38+
conf/*.sh
39+
conf/*.xml
40+
conf/java-opts
41+
conf/slaves
42+
dependency-reduced-pom.xml
43+
derby.log
44+
dev/create-release/*final
45+
dev/create-release/*txt
46+
dev/pr-deps/
47+
dist/
48+
docs/_site
49+
docs/api
50+
sql/docs
51+
sql/site
52+
lib_managed/
53+
lint-r-report.log
54+
log/
55+
logs/
56+
out/
57+
project/boot/
58+
project/build/target/
59+
project/plugins/lib_managed/
60+
project/plugins/project/build.properties
61+
project/plugins/src_managed/
62+
project/plugins/target/
63+
python/lib/pyspark.zip
64+
python/deps
65+
python/pyspark/python
66+
reports/
67+
scalastyle-on-compile.generated.xml
68+
scalastyle-output.xml
69+
scalastyle.txt
70+
spark-*-bin-*.tgz
71+
spark-tests.log
72+
src_managed/
73+
streaming-tests.log
74+
target/
75+
unit-tests.log
76+
work/
77+
78+
# For Hive
79+
TempStatsStore/
80+
metastore/
81+
metastore_db/
82+
sql/hive-thriftserver/test_warehouses
83+
warehouse/
84+
spark-warehouse/
85+
86+
# For R session data
87+
.RData
88+
.RHistory
89+
.Rhistory
90+
*.Rproj
91+
*.Rproj.*
92+
93+
.Rproj.user
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>java-9-spring-web</artifactId>
7+
<groupId>dockerx.java9</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>dockerx-admin</artifactId>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
</properties>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-web</artifactId>
22+
<version>${spring-boot.version}</version>
23+
<exclusions>
24+
<exclusion>
25+
<groupId>org.slf4j</groupId>
26+
<artifactId>jcl-over-slf4j</artifactId>
27+
</exclusion>
28+
<exclusion>
29+
<!-- served by tomcat-annotations-api instead -->
30+
<groupId>javax.annotation</groupId>
31+
<artifactId>javax.annotation-api</artifactId>
32+
</exclusion>
33+
</exclusions>
34+
</dependency>
35+
<!-- <dependency>
36+
<groupId>org.apache.tomcat</groupId>
37+
<artifactId>tomcat-annotations-api</artifactId>
38+
<version>LATEST</version>
39+
</dependency>-->
40+
</dependencies>
41+
42+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.dockerx.admin.configration;
2+
3+
import org.springframework.context.annotation.ComponentScan;
4+
import org.springframework.context.annotation.Configuration;
5+
6+
/**
7+
* @author Author 知秋
8+
* @email fei6751803@163.com
9+
* @time Created by Auser on 2017年11月15日 22:57.
10+
*/
11+
@Configuration
12+
@ComponentScan("com.dockerx.admin.service")
13+
public class ServiceConfiguration {
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.dockerx.admin.model;
2+
3+
/**
4+
* @author Author 知秋
5+
* @email fei6751803@163.com
6+
* @time Created by Auser on 2017年11月15日 21:13.
7+
*/
8+
public class Admin {
9+
private int level;
10+
11+
public Admin(int level) {
12+
this.level = level;
13+
}
14+
15+
public int getLevel() {
16+
return level;
17+
}
18+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @author Author 知秋
3+
* @email fei6751803@163.com
4+
* @time Created by Auser on 2017年11月15日 20:38.
5+
*/
6+
package com.dockerx.admin;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.dockerx.admin.service;
2+
3+
import com.dockerx.admin.model.Admin;
4+
import org.springframework.stereotype.Service;
5+
6+
/**
7+
* @author Author 知秋
8+
* @email fei6751803@163.com
9+
* @time Created by Auser on 2017年11月15日 21:23.
10+
*/
11+
@Service
12+
public class AdminService {
13+
public String adminLevel(Admin admin) {
14+
switch (admin.getLevel()) {
15+
case 0:
16+
return "管理员";
17+
case 1:
18+
return "副管理";
19+
case 2:
20+
return "底层管理";
21+
default:
22+
return "谁让你进来的?";
23+
}
24+
}
25+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @author Author 知秋
3+
* @email fei6751803@163.com
4+
* @time Created by Auser on 2017年11月15日 20:38.
5+
*/
6+
module dockerx.admin {
7+
requires spring.context;
8+
requires spring.web;
9+
requires spring.beans;
10+
11+
exports com.dockerx.admin.model;
12+
exports com.dockerx.admin.service;
13+
exports com.dockerx.admin.configration;
14+
15+
16+
opens com.dockerx.admin.service;
17+
opens com.dockerx.admin.model;
18+
opens com.dockerx.admin.configration;
19+
}

‎java9-spring-web/dockerx-app/pom.xml‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>java-9-spring-web</artifactId>
7+
<groupId>dockerx.java9</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>dockerx-app</artifactId>
13+
<properties>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>dockerx.java9</groupId>
20+
<artifactId>dockerx-admin</artifactId>
21+
<version>1.0-SNAPSHOT</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>dockerx.java9</groupId>
25+
<artifactId>dockerx-user</artifactId>
26+
<version>1.0-SNAPSHOT</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-autoconfigure</artifactId>
31+
<version>${spring-boot.version}</version>
32+
</dependency>
33+
</dependencies>
34+
35+
<build>
36+
<plugins>
37+
38+
<plugin>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-maven-plugin</artifactId>
41+
<version>2.0.0.BUILD-SNAPSHOT</version>
42+
<executions>
43+
<execution>
44+
<goals>
45+
<goal>repackage</goal>
46+
</goals>
47+
<configuration>
48+
<classifier>exec</classifier>
49+
<mainClass>${start-class}</mainClass>
50+
</configuration>
51+
</execution>
52+
</executions>
53+
</plugin>
54+
</plugins>
55+
</build>
56+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.dockerx.web;
2+
3+
import com.dockerx.admin.configration.ServiceConfiguration;
4+
import org.springframework.boot.SpringApplication;
5+
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
import org.springframework.context.annotation.ComponentScan;
7+
import org.springframework.context.annotation.Import;
8+
9+
/**
10+
* @author Author 知秋
11+
* @email fei6751803@163.com
12+
* @time Created by Auser on 2017年11月15日 19:19.
13+
*/
14+
@SpringBootApplication
15+
@ComponentScan("com.dockerx.web.*")
16+
@Import(ServiceConfiguration.class)
17+
public class Java9WebDemo {
18+
public static void main(String[] args) {
19+
SpringApplication.run(Java9WebDemo.class,args);
20+
}
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.dockerx.web.api;
2+
3+
import com.dockerx.admin.model.Admin;
4+
import com.dockerx.admin.service.AdminService;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.web.bind.annotation.GetMapping;
7+
import org.springframework.web.bind.annotation.PathVariable;
8+
import org.springframework.web.bind.annotation.RequestMapping;
9+
import org.springframework.web.bind.annotation.RestController;
10+
11+
/**
12+
* @author Author 知秋
13+
* @email fei6751803@163.com
14+
* @time Created by Auser on 2017年11月15日 21:33.
15+
*/
16+
@RestController
17+
@RequestMapping("admin")
18+
public class AdminController {
19+
@Autowired
20+
private AdminService adminService;
21+
22+
@GetMapping("{id}")
23+
public String adminLevel(@PathVariable("id") int id){
24+
Admin admin = new Admin(id);
25+
return adminService.adminLevel(admin);
26+
}
27+
28+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /