Skip to content

Commit

Permalink
项目结构调整
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Jul 17, 2018
1 parent e5b2cdf commit 10ab01d
Show file tree
Hide file tree
Showing 17 changed files with 152 additions and 26 deletions.
16 changes: 16 additions & 0 deletions main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
47 changes: 47 additions & 0 deletions main/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.pdown.gui</groupId>
<artifactId>main</artifactId>
<version>3.0</version>
<packaging>jar</packaging>

<name>proxyee-down-main</name>
<url>https://github.com/proxyee-down-org/proxyee-down</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>

<dependencies>
<dependency>
<groupId>org.pdown</groupId>
<artifactId>rest</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.roskenet</groupId>
<artifactId>springboot-javafx-support</artifactId>
<version>2.1.5</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<configuration>
<mainClass>org.pdown.gui.DownApplication</mainClass>
<vendor>pdown</vendor>
<!-- <bundleArguments>
<icon>${project.basedir}/src/main/resources/logo.ico</icon>
</bundleArguments>-->
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
package org.pdown.gui;

import de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport;
import java.awt.AWTException;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.net.URL;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.geometry.Rectangle2D;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Screen;
import javafx.stage.Stage;
import org.pdown.gui.com.Browser;
import org.pdown.rest.DownRestServer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

public class DownApplication extends Application {
@SpringBootApplication
@ComponentScan(basePackages = "org.pdown.rest")
public class DownApplication extends AbstractJavaFxApplicationSupport {

private static final String ICON_NAME = "icon.png";

Expand Down Expand Up @@ -100,9 +103,6 @@ private void show() {


public static void main(String[] args) {
//start rest server
new Thread(() -> DownRestServer.start(null)).start();
//gui start
launch(args);
launch(DownApplication.class, null, args);
}
}
2 changes: 2 additions & 0 deletions main/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logging:
config: classpath:logback-dev.xml
2 changes: 2 additions & 0 deletions main/src/main/resources/application-prd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logging:
config: classpath:logback-prd.xml
6 changes: 6 additions & 0 deletions main/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring:
# 数据库配置
profiles:
active: dev
server:
port: 26339
15 changes: 15 additions & 0 deletions main/src/main/resources/logback-dev.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<root level="ERROR">
<appender-ref ref="stdout"/>
</root>
<logger name="org.pdown.gui" level="DEBUG"/>
<logger name="org.springframework.web.filter.CommonsRequestLoggingFilter" level="DEBUG"/>
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="DEBUG"/>
</configuration>
15 changes: 15 additions & 0 deletions main/src/main/resources/logback-prd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<root level="ERROR">
<appender-ref ref="stdout"/>
</root>
<logger name="org.pdown.gui" level="DEBUG"/>
<logger name="org.springframework.web.filter.CommonsRequestLoggingFilter" level="DEBUG"/>
<logger name="org.springframework.boot.web.embedded.tomcat.TomcatWebServer" level="DEBUG"/>
</configuration>
Binary file added main/src/main/resources/logo.ico
Binary file not shown.
File renamed without changes
16 changes: 16 additions & 0 deletions runner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
24 changes: 9 additions & 15 deletions pom.xml → runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.pdown</groupId>
<artifactId>gui</artifactId>
<groupId>org.pdown.gui</groupId>
<artifactId>runner</artifactId>
<version>3.0</version>
<packaging>jar</packaging>

<name>proxyee-down</name>
<name>proxyee-down-runner</name>
<url>https://github.com/proxyee-down-org/proxyee-down</url>

<properties>
Expand All @@ -19,19 +19,13 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<configuration>
<mainClass>org.pdown.gui.DownApplication</mainClass>
<vendor>ProxyeeDown</vendor>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.pdown</groupId>
<artifactId>rest</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>

</project>
17 changes: 17 additions & 0 deletions runner/src/main/java/org/pdown/gui/Runner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.pdown.gui;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Runner {

public static void main(String[] args) throws IOException {
Process process = Runtime.getRuntime().exec("./main/proxyee-down-main");
BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
}
}
4 changes: 0 additions & 4 deletions start

This file was deleted.

0 comments on commit 10ab01d

Please sign in to comment.