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 baf530d

Browse files
base traffic
1 parent 9659055 commit baf530d

File tree

10 files changed

+212
-0
lines changed

10 files changed

+212
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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>java9-action-demo1</artifactId>
7+
<groupId>com.dockx.traffic</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>dockerx-traffic-demo1-api</artifactId>
13+
<dependencies>
14+
<dependency>
15+
<groupId>com.dockx.traffic</groupId>
16+
<artifactId>dockerx-traffic-demo1-entity</artifactId>
17+
<version>1.0-SNAPSHOT</version>
18+
</dependency>
19+
<dependency>
20+
<groupId>com.dockx.traffic</groupId>
21+
<artifactId>dockerx-traffic-demo1-service</artifactId>
22+
<version>1.0-SNAPSHOT</version>
23+
</dependency>
24+
</dependencies>
25+
26+
27+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.dockerx.traffic.gui;
2+
3+
import com.dockerx.traffic.entity.Person;
4+
import com.dockerx.traffic.service.Analysis;
5+
6+
/**
7+
* @author Author 知秋
8+
* @email fei6751803@163.com
9+
* @time Created by Auser on 2017年11月20日 20:35.
10+
*/
11+
public class Gui {
12+
public static void main(String[] args) {
13+
Person nao = new Person(0, 0);
14+
Person miniperson = new Person(10, 0);
15+
Person minperson = new Person(1001, 0);
16+
Person minxperson = new Person(1001, 11);
17+
Person maxperson = new Person(100000, 11);
18+
Person maxxperson = new Person(100000, 26);
19+
Person poorperson = new Person(100000, 0);
20+
21+
Analysis analysis = new Analysis();
22+
System.out.println(analysis.analyze(nao));
23+
System.out.println(analysis.analyze(miniperson));
24+
System.out.println(analysis.analyze(minperson));
25+
System.out.println(analysis.analyze(minxperson));
26+
System.out.println(analysis.analyze(maxperson));
27+
System.out.println(analysis.analyze(maxxperson));
28+
System.out.println(analysis.analyze(poorperson));
29+
}
30+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @author Author 知秋
3+
* @email fei6751803@163.com
4+
* @time Created by Auser on 2017年11月20日 20:36.
5+
*/
6+
module dockerx.traffic.demo1.api {
7+
requires dockerx.traffic.demo1.entity;
8+
requires dockerx.traffic.demo1.service;
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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>java9-action-demo1</artifactId>
7+
<groupId>com.dockx.traffic</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>dockerx-traffic-demo1-entity</artifactId>
13+
14+
15+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.dockerx.traffic.entity;
2+
3+
/**
4+
* @author Author 知秋
5+
* @email fei6751803@163.com
6+
* @time Created by Auser on 2017年11月20日 20:11.
7+
*/
8+
public class Person {
9+
private int mileage;
10+
private int money;
11+
12+
public Person(int mileage, int money) {
13+
this.mileage = mileage;
14+
this.money = money;
15+
}
16+
17+
public int getMileage() {
18+
return mileage;
19+
}
20+
21+
public Person setMileage(int mileage) {
22+
this.mileage = mileage;
23+
return this;
24+
}
25+
26+
public int getMoney() {
27+
return money;
28+
}
29+
30+
public Person setMoney(int money) {
31+
this.money = money;
32+
return this;
33+
}
34+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @author Author 知秋
3+
* @email fei6751803@163.com
4+
* @time Created by Auser on 2017年11月20日 20:06.
5+
*/
6+
module dockerx.traffic.demo1.entity {
7+
exports com.dockerx.traffic.entity;
8+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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>java9-action-demo1</artifactId>
7+
<groupId>com.dockx.traffic</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>dockerx-traffic-demo1-service</artifactId>
13+
<dependencies>
14+
<dependency>
15+
<groupId>com.dockx.traffic</groupId>
16+
<artifactId>dockerx-traffic-demo1-entity</artifactId>
17+
<version>1.0-SNAPSHOT</version>
18+
</dependency>
19+
</dependencies>
20+
21+
22+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.dockerx.traffic.service;
2+
3+
import com.dockerx.traffic.entity.Person;
4+
5+
/**
6+
* @author Author 知秋
7+
* @email fei6751803@163.com
8+
* @time Created by Auser on 2017年11月20日 20:14.
9+
*/
10+
public class Analysis {
11+
public String analyze(Person person){
12+
13+
int mileage = person.getMileage();
14+
int money = person.getMoney();
15+
if (mileage<=0) return "别闹";
16+
return mileage<1000?"步行"
17+
:mileage<10000&&money>=10?"单车"
18+
:mileage>=10000&&money>=25?"专车"
19+
:money>=10?"单车":"老实步行吧";
20+
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @author Author 知秋
3+
* @email fei6751803@163.com
4+
* @time Created by Auser on 2017年11月20日 20:07.
5+
*/
6+
module dockerx.traffic.demo1.service {
7+
requires dockerx.traffic.demo1.entity;
8+
exports com.dockerx.traffic.service;
9+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.dockx.traffic</groupId>
8+
<artifactId>java9-action-demo1</artifactId>
9+
<packaging>pom</packaging>
10+
<version>1.0-SNAPSHOT</version>
11+
<modules>
12+
<module>dockerx-traffic-demo1-entity</module>
13+
<module>dockerx-traffic-demo1-service</module>
14+
<module>dockerx-traffic-demo1-api</module>
15+
</modules>
16+
17+
<properties>
18+
<java.version>1.9</java.version>
19+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20+
</properties>
21+
<build>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<version>3.6.1</version>
27+
<configuration>
28+
<source>${java.version}</source>
29+
<target>${java.version}</target>
30+
<showDeprecation>true</showDeprecation>
31+
<showWarnings>true</showWarnings>
32+
</configuration>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
</project>

0 commit comments

Comments
(0)

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