Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
390da586
Commit
390da586
authored
Aug 20, 2017
by
jmdhappy
Browse files
1. 升级spring boot版本为1.5.6
2. 修复通知业务系统bug
parent
202bbb59
Changes
39
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
390da586
/.idea/
*.iml
/log/
target/
\ No newline at end of file
pom.xml
View file @
390da586
...
...
@@ -5,8 +5,10 @@
<groupId>
org.xxpay
</groupId>
<artifactId>
xxpay-master
</artifactId>
<version>
0.0
.1-SNAPSHOT
</version>
<version>
1.
0.0
</version>
<packaging>
pom
</packaging>
<name>
xxpay-master
</name>
<description>
xxpay-master
</description>
<modules>
<module>
xxpay-common
</module>
...
...
@@ -16,36 +18,10 @@
<module>
xxpay4spring-cloud
</module>
</modules>
<!-- 使用最新的spring-boot版本 -->
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.4.0.RELEASE
</version>
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
Brixton.SR5
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
xxpay-common/pom.xml
View file @
390da586
...
...
@@ -7,65 +7,46 @@
<artifactId>
xxpay-common
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<name>
xxpay-common
</name>
<description>
xxpay-
master
</description>
<description>
xxpay-
common
</description>
<properties>
<fastjson.version>
1.2.7
</fastjson.version>
<logback-classic.version>
1.1.7
</logback-classic.version>
<slf4j-api.version>
1.7.7
</slf4j-api.version>
<commons-lang3.version>
3.4
</commons-lang3.version>
</properties>
<dependencies>
<!-- Logging -->
<dependency>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-core
</artifactId>
<version>
1.1.7
</version>
<version>
${logback-classic.version}
</version>
</dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-classic
</artifactId>
<version>
1.1.7
</version>
<version>
${logback-classic.version}
</version>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
<version>
1.7.7
</version>
<version>
${slf4j-api.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.4
</version>
<version>
${commons-lang3.version}
</version>
</dependency>
</dependencies>
<build>
<finalName>
xxpay-common
</finalName>
<resources>
<resource>
<directory>
src/main/java
</directory>
<includes>
<include>
**/*.xml
</include>
</includes>
</resource>
<resource>
<!-- 配置需要被替换的资源文件路径 -->
<directory>
src/main/resources
</directory>
<includes>
<include>
**/*.properties
</include>
<include>
**/*.xml
</include>
</includes>
<filtering>
true
</filtering>
</resource>
</resources>
</build>
</project>
\ No newline at end of file
xxpay-dal/pom.xml
View file @
390da586
...
...
@@ -7,15 +7,13 @@
<artifactId>
xxpay-dal
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<name>
xxpay-dal
</name>
<description>
xxpay-
master
</description>
<description>
xxpay-
dal
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.3.5.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
<version>
1.5.6.RELEASE
</version>
</parent>
<properties>
...
...
@@ -59,27 +57,15 @@
<artifactId>
druid
</artifactId>
<version>
1.0.26
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-autoconfigure
</artifactId>
<version>
1.3.6.RELEASE
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
1.
1.1
</version>
<version>
1.
3.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- mybatis 分页插件 -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
...
...
xxpay-dal/src/main/resources/generator.properties
View file @
390da586
generator.jdbc.driver
=
com.mysql.jdbc.Driver
gene
rator.jdbc.url
=
jdbc:mysql://127.0.0.1:3306/xxpaydb?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
rator.jdbc.url
=
jdbc:mysql://127.0.0.1:3306/xxpaydb?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
generator.jdbc.username
=
xxpay
generator.jdbc.password
=
xxpay
classPathEntry
=
/Users/dingzhiwei/java/repository/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar
\ No newline at end of file
xxpay-mgr/pom.xml
View file @
390da586
...
...
@@ -7,9 +7,8 @@
<artifactId>
xxpay-mgr
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<name>
xxpay-mgr
</name>
<description>
xxpay-m
aste
r
</description>
<description>
xxpay-m
g
r
</description>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
...
...
@@ -24,87 +23,47 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.
3.5
.RELEASE
</version>
<version>
1.
5.6
.RELEASE
</version>
</parent>
<dependencies>
<dependency>
<groupId>
org.xxpay
</groupId>
<artifactId>
xxpay-dal
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
1.3.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<!-- Spring Boot Freemarker 依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-freemarker
</artifactId>
</dependency>
<!-- Spring Boot Web 依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- Spring Boot Test 依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-autoconfigure
</artifactId>
<version>
1.3.6.RELEASE
</version>
</dependency>
</dependencies>
<build>
<finalName>
xxpay-mgr
</finalName>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<includes>
<include>
**/*.*
</include>
</includes>
</resource>
<resource>
<!-- 配置需要被替换的资源文件路径 -->
<directory>
src/main/resources
</directory>
<includes>
<include>
**/*.properties
</include>
<include>
**/*.xml
</include>
</includes>
<filtering>
true
</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
2.4
</version>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/package.xml
</descriptor>
</descriptors>
<finalName>
${project.name}
</finalName>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
xxpay-mgr/src/main/assembly/package.xml
deleted
100644 → 0
View file @
202bbb59
<assembly>
<id>
bin
</id>
<!-- 最终打包成一个用于发布的zip文件 -->
<formats>
<format>
tar.gz
</format>
</formats>
<!-- Adds dependencies to zip package under lib directory -->
<dependencySets>
<dependencySet>
<!-- 不使用项目的artifact,第三方jar不要解压,打包进zip文件的lib目录 -->
<useProjectArtifact>
false
</useProjectArtifact>
<outputDirectory>
lib
</outputDirectory>
<unpack>
false
</unpack>
</dependencySet>
</dependencySets>
<fileSets>
<!-- 把项目相关的说明文件,打包进zip文件的根目录 -->
<fileSet>
<directory>
${project.basedir}
</directory>
<outputDirectory>
/
</outputDirectory>
<includes>
<include>
README*
</include>
<include>
LICENSE*
</include>
<include>
NOTICE*
</include>
</includes>
</fileSet>
<!-- 把项目的配置文件,打包进zip文件的config目录 -->
<!--<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
<outputDirectory>classes</outputDirectory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
</fileSet>-->
<!-- 把项目的脚本文件目录( src/main/scripts )中的启动脚本文件,打包进zip文件的跟目录 -->
<fileSet>
<directory>
${project.build.scriptSourceDirectory}
</directory>
<outputDirectory>
bin
</outputDirectory>
<includes>
<include>
*.*
</include>
</includes>
</fileSet>
<!-- 把项目的脚本文件(除了启动脚本文件),打包进zip文件的script目录 -->
<fileSet>
<directory>
${project.build.scriptSourceDirectory}
</directory>
<outputDirectory></outputDirectory>
<includes>
<include>
startup.*
</include>
</includes>
</fileSet>
<!-- 把项目自己编译出来的jar文件,打包进zip文件的根目录 -->
<!--<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>-->
<fileSet>
<directory>
${project.build.outputDirectory}
</directory>
<outputDirectory>
classes
</outputDirectory>
<includes>
<include>
**/*.class
</include>
<include>
**/*.xml
</include>
<include>
**/*.properties
</include>
</includes>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
xxpay-mgr/src/main/java/org/xxpay/XxPayMgrApplication.java
View file @
390da586
...
...
@@ -3,11 +3,8 @@ package org.xxpay;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.
context.web
.SpringBootServletInitializer
;
import
org.springframework.boot.
web.support
.SpringBootServletInitializer
;
/**
* Created by fyunli on 16/4/1.
*/
@SpringBootApplication
public
class
XxPayMgrApplication
extends
SpringBootServletInitializer
{
...
...
xxpay-mgr/src/main/resources/static/main.html
View file @
390da586
...
...
@@ -18,9 +18,7 @@
[码云]
<a
href=
"https://gitee.com/jmdhappy/xxpay-master"
target=
"_blank"
>
https://gitee.com/jmdhappy/xxpay-master
</a><br/>
[GitHub]
<a
href=
"https://github.com/jmdhappy/xxpay-master"
target=
"_blank"
>
https://github.com/jmdhappy/xxpay-master
</a>
</p>
<p>
建议反馈和问题收集地址:
<a
href=
"http://www.xxpay.org/"
target=
"_blank"
>
http://bbs.xxpay.org/
</a>
</p>
<p>
XxPay'官方交流群:206119456(加群暗号:xxpay交流)
</p>
<p>
QQ:290935762
</p>
<p>
Email:jmdhappy@126.com
</p>
<br/>
...
...
xxpay-mgr/src/main/scripts/mgr.sh
deleted
100755 → 0
View file @
202bbb59
#!/bin/sh
#
#该脚本为Linux下启动java程序的通用脚本。即可以作为开机自启动service脚本被调用,
#也可以作为启动java程序的独立脚本来使用。
#
#JDK所在路径
JAVA_HOME
=
"/usr/local/jdk/jdk1.8.0_121"
#Java程序所在的目录(classes的上一级目录)
APP_HOME
=
/home/xxpay/service/xxpay-mgr
#需要启动的Java主程序(main方法类)
APP_MAINCLASS
=
org.xxpay.XxPayMgrApplication
#拼凑完整的classpath参数,包括指定lib目录下所有的jar
CLASSPATH
=
$APP_HOME
/classes
for
i
in
"
$APP_HOME
"
/lib/
*
.jar
;
do
CLASSPATH
=
"
$CLASSPATH
"
:
"
$i
"
done
#java虚拟机启动参数
JAVA_OPTS
=
"-ms512m -mx512m -Xmn128m -Djava.awt.headless=true -XX:MaxPermSize=64m"
###################################
#(函数)判断程序是否已启动
#
#说明:
#使用JDK自带的JPS命令及grep命令组合,准确查找pid
#jps 加 l 参数,表示显示java的完整包路径
#使用awk,分割出pid ($1部分),及Java程序名称($2部分)
#当jps命令不可用时,使用: ps -ef | grep $APP_MAINCLASS | grep -v "grep" | awk '{print $2}' 代替
###################################
#初始化psid变量(全局)
psid
=
0
checkpid
()
{
javaps
=
`
$JAVA_HOME
/bin/jps
-l
|
grep
$APP_MAINCLASS
`
#javaps=`ps -ef | grep $APP_MAINCLASS | grep -v "grep" | awk '{print $2}'`
if
[
-n
"
$javaps
"
]
;
then
psid
=
`
echo
$javaps
|
awk
'{print $1}'
`
else
psid
=
0
fi
}
###################################
#(函数)启动程序
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则提示程序已启动
#3. 如果程序没有被启动,则执行启动命令行
#4. 启动命令执行后,再次调用checkpid函数
#5. 如果步骤4的结果能够确认程序的pid,则打印[OK],否则打印[Failed]
#注意:echo -n 表示打印字符后,不换行
#注意: "nohup 某命令 >/dev/null 2>&1 &" 的用法
###################################
start
()
{
checkpid
if
[
$psid
-ne
0
]
;
then
echo
"================================"
echo
"warn:
$APP_MAINCLASS
already started! (pid=
$psid
)"
echo
"================================"
else
echo
-n
"Starting
$APP_MAINCLASS
..."
# -DlogFn=active 指的是生产日志文件名为active
nohup
$JAVA_HOME
/bin/java
$JAVA_OPTS
-DlogFn
=
level
-classpath
$CLASSPATH
$APP_MAINCLASS
>
/dev/null 2>&1 &
checkpid
if
[
$psid
-ne
0
]
;
then
echo
"(pid=
$psid
) [OK]"
else
echo
"[Failed]"
fi
fi
}
###################################
#(函数)停止程序
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则开始执行停止,否则,提示程序未运行
#3. 使用kill -9 pid命令进行强制杀死进程
#4. 执行kill命令行紧接其后,马上查看上一句命令的返回值: $?
#5. 如果步骤4的结果$?等于0,则打印[OK],否则打印[Failed]
#6. 为了防止java程序被启动多次,这里增加反复检查进程,反复杀死的处理(递归调用stop)。
#注意:echo -n 表示打印字符后,不换行
#注意: 在shell编程中,"$?" 表示上一句命令或者一个函数的返回值
###################################
stop
()
{
checkpid
if
[
$psid
-ne
0
]
;
then
echo
-n
"Stopping
$APP_MAINCLASS
...(pid=
$psid
) "
kill
-9
$psid
if
[
$?
-eq
0
]
;
then
echo
"[OK]"
else
echo
"[Failed]"
fi
checkpid
if
[
$psid
-ne
0
]
;
then
stop
fi
else
echo
"================================"
echo
"warn:
$APP_MAINCLASS
is not running"
echo
"================================"
fi
}
###################################
#(函数)检查程序运行状态
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则提示正在运行并表示出pid
#3. 否则,提示程序未运行
###################################
status
()
{
checkpid
if
[
$psid
-ne
0
]
;
then
echo
"
$APP_MAINCLASS
is running! (pid=
$psid
)"
else
echo
"
$APP_MAINCLASS
is not running"
fi
}
###################################
#(函数)打印系统环境参数
###################################
info
()
{
echo
"System Information:"
echo
"****************************"
echo
`
head
-n
1 /etc/issue
`
echo
`
uname
-a
`
echo
echo
"JAVA_HOME=
$JAVA_HOME
"
echo
`
$JAVA_HOME
/bin/java
-version
`
echo
echo
"APP_HOME=
$APP_HOME
"
echo
"APP_MAINCLASS=
$APP_MAINCLASS
"
echo
"****************************"
}
###################################
#读取脚本的第一个参数($1),进行判断
#参数取值范围:{start|stop|restart|status|info}
#如参数不在指定范围之内,则打印帮助信息
###################################
case
"
$1
"
in
'start'
)
start
;;
'stop'
)
stop
;;
'restart'
)
stop
start
;;
'status'
)
status
;;
'info'
)
info
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status|info}"
exit
1
esac
exit
0
\ No newline at end of file
xxpay-shop/pom.xml
View file @
390da586
...
...
@@ -7,9 +7,8 @@
<artifactId>
xxpay-shop
</artifactId>
<version>
1.0.0
</version>
<packaging>
jar
</packaging>
<name>
xxpay-shop
</name>
<description>
xxpay-
master
</description>
<description>
xxpay-
shop
</description>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
...
...
@@ -24,41 +23,32 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.
3.5
.RELEASE
</version>
<version>
1.
5.6
.RELEASE
</version>
</parent>
<dependencies>
<dependency>
<groupId>
org.xxpay
</groupId>
<artifactId>
xxpay-common
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<!-- Spring Boot Freemarker 依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-freemarker
</artifactId>
</dependency>
<!-- Spring Boot Web 依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!-- Spring Boot Test 依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
...
...
@@ -79,51 +69,31 @@
<artifactId>
mybatis-generator-core
</artifactId>
<version>
${mybatis.generator.version}
</version>
</dependency>
<!--druid数据库连接池-->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.0.26
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-autoconfigure
</artifactId>
<version>
1.3.6.RELEASE
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
1.
1.1
</version>
<version>
1.
3.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- mybatis 分页插件 -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper
</artifactId>
<version>
4.1.6
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
</dependencies>
<build>
<finalName>
xxpay-shop
</finalName>
<resources>
<resource>
<directory>
src/main/resources
</directory>
...
...
@@ -158,23 +128,11 @@
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
2.4
</version>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/package.xml
</descriptor>
</descriptors>
<finalName>
${project.name}
</finalName>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
xxpay-shop/src/main/assembly/package.xml
deleted
100644 → 0
View file @
202bbb59
<assembly>
<id>
bin
</id>
<!-- 最终打包成一个用于发布的zip文件 -->
<formats>
<format>
tar.gz
</format>
</formats>
<!-- Adds dependencies to zip package under lib directory -->
<dependencySets>
<dependencySet>
<!-- 不使用项目的artifact,第三方jar不要解压,打包进zip文件的lib目录 -->
<useProjectArtifact>
false
</useProjectArtifact>
<outputDirectory>
lib
</outputDirectory>
<unpack>
false
</unpack>
</dependencySet>
</dependencySets>
<fileSets>
<!-- 把项目相关的说明文件,打包进zip文件的根目录 -->
<fileSet>
<directory>
${project.basedir}
</directory>
<outputDirectory>
/
</outputDirectory>
<includes>
<include>
README*
</include>
<include>
LICENSE*
</include>
<include>
NOTICE*
</include>
</includes>
</fileSet>
<!-- 把项目的配置文件,打包进zip文件的config目录 -->
<!--<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
<outputDirectory>classes</outputDirectory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
</fileSet>-->
<!-- 把项目的脚本文件目录( src/main/scripts )中的启动脚本文件,打包进zip文件的跟目录 -->
<fileSet>
<directory>
${project.build.scriptSourceDirectory}
</directory>
<outputDirectory>
bin
</outputDirectory>
<includes>
<include>
*.*
</include>
</includes>
</fileSet>
<!-- 把项目的脚本文件(除了启动脚本文件),打包进zip文件的script目录 -->
<fileSet>
<directory>
${project.build.scriptSourceDirectory}
</directory>
<outputDirectory></outputDirectory>
<includes>
<include>
startup.*
</include>
</includes>
</fileSet>
<!-- 把项目自己编译出来的jar文件,打包进zip文件的根目录 -->
<!--<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>-->
<fileSet>
<directory>
${project.build.outputDirectory}
</directory>
<outputDirectory>
classes
</outputDirectory>
<includes>
<include>
**/*.class
</include>
<include>
**/*.xml
</include>
<include>
**/*.properties
</include>
</includes>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
xxpay-shop/src/main/java/org/xxpay/shop/XxPayShopApplication.java
View file @
390da586
...
...
@@ -3,11 +3,8 @@ package org.xxpay.shop;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.
context.web
.SpringBootServletInitializer
;
import
org.springframework.boot.
web.support
.SpringBootServletInitializer
;
/**
* Created by fyunli on 16/4/1.
*/
@SpringBootApplication
public
class
XxPayShopApplication
extends
SpringBootServletInitializer
{
...
...
xxpay-shop/src/main/java/org/xxpay/shop/controller/GoodsOrderController.java
View file @
390da586
...
...
@@ -38,9 +38,6 @@ public class GoodsOrderController {
@Autowired
private
GoodsOrderService
goodsOrderService
;
@Value
(
"${application.message:Hello World}"
)
private
String
message
=
"Hello World"
;
static
final
String
mchId
=
"20001223"
;
// 加签key
static
final
String
reqKey
=
"M86l522AV6q613Ii4W6u8K48uW8vM1N6bFgyv769220MdYe9u37N4y7rI5mQ"
;
...
...
@@ -173,24 +170,19 @@ public class GoodsOrderController {
@RequestMapping
(
"/openQrPay.html"
)
public
String
openQrPay
(
ModelMap
model
)
{
model
.
put
(
"time"
,
new
Date
());
model
.
put
(
"message"
,
this
.
message
);
return
"openQrPay"
;
}
@RequestMapping
(
"/qrPay.html"
)
public
String
qrPay
(
ModelMap
model
,
HttpServletRequest
request
,
Long
amount
)
{
String
logPrefix
=
"【二维码扫码支付】"
;
String
view
=
"qrPay"
;
_log
.
info
(
"====== 开始接收二维码扫码支付请求 ======"
);
String
ua
=
request
.
getHeader
(
"User-Agent"
);
String
goodsId
=
"G_0001"
;
_log
.
info
(
"{}接收参数:goodsId={},amount={},ua={}"
,
logPrefix
,
goodsId
,
amount
,
ua
);
String
client
=
"alipay"
;
String
channelId
=
"ALIPAY_WAP"
;
if
(
StringUtils
.
isBlank
(
ua
))
{
String
errorMessage
=
"User-Agent为空!"
;
_log
.
info
(
"{}信息:{}"
,
logPrefix
,
errorMessage
);
...
...
@@ -213,7 +205,6 @@ public class GoodsOrderController {
model
.
put
(
"resMsg"
,
errorMessage
);
return
view
;
}
// 先插入订单数据
GoodsOrder
goodsOrder
=
null
;
Map
<
String
,
String
>
orderMap
=
null
;
...
...
xxpay-shop/src/main/java/org/xxpay/shop/demo/PayOrderDemo.java
View file @
390da586
...
...
@@ -19,7 +19,8 @@ public class PayOrderDemo {
// 验签key
static
final
String
repKey
=
"Hpcl522AV6q613KIi46u6g6XuW8vM1N8bFgyv769770MdYe9u37M4y7rIpl8"
;
static
final
String
baseUrl
=
"http://api.xxpay.org/api"
;
//static final String baseUrl = "http://api.xxpay.org/api";
static
final
String
baseUrl
=
"http://localhost:3020/api"
;
static
final
String
notifyUrl
=
"http://www.baidu.com"
;
// 本地环境测试,可到ngrok.cc网站注册
public
static
void
main
(
String
[]
args
)
{
...
...
xxpay-shop/src/main/resources/application.properties
View file @
390da586
...
...
@@ -11,12 +11,6 @@ spring.freemarker.suffix=.ftl
spring.freemarker.templateEncoding
=
UTF-8
spring.freemarker.templateLoaderPath
=
classpath:/templates/
# properties
application.message
:
Hello,Spring Boot
# \u5FAE\u4FE1\u516C\u4F17\u53F7
application.wx.app_id
=
wx077cb62e341f8a5c
application.wx.app_secret
=
e663ea068f3e4f952f143de1432a35c2
#\u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.type
=
com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
...
...
xxpay-shop/src/main/resources/logback.xml
deleted
100755 → 0
View file @
202bbb59
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<Pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\) - %msg%n
</Pattern>
</encoder>
</appender>
<appender
name=
"ROLLING"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
logs/xxpay-shop.%d.log
</fileNamePattern>
<maxHistory>
30
</maxHistory>
</rollingPolicy>
<encoder>
<Pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\) - %msg%n
</Pattern>
</encoder>
</appender>
<logger
name=
"org.springframework"
level=
"WARN"
/>
<logger
name=
"org.apache"
level=
"WARN"
/>
<logger
name=
"freemarker"
level=
"WARN"
/>
<logger
name=
"org.hibernate"
level=
"WARN"
/>
<logger
name=
"org.hibernate.cache"
level=
"WARN"
/>
<logger
name=
"org.hibernate.type"
level=
"WARN"
/>
<logger
name=
"org.hibernate.SQL"
level=
"DEBUG"
/>
<logger
name=
"org.hibernate.type.descriptor.sql.BasicBinder"
level=
"TRACE"
/>
<root
level=
"INFO"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"ROLLING"
/>
</root>
</configuration>
xxpay-shop/src/main/resources/templates/openQrPay.ftl
View file @
390da586
...
...
@@ -28,15 +28,6 @@
<div class="page-header">
<h1>【XxPay】分布式开源聚合支付系统</h1>
</div>
<!--
<div>
Date: $
{
time
?
date
}
<br>
Time: $
{
time
?
time
}
<br>
Message: $
{
message
}
</div>
-->
<div class="main" align="center">
<div class="inwrap">
<h3>#扫码测试#</h3>
...
...
xxpay-shop/src/main/scripts/shop.sh
deleted
100755 → 0
View file @
202bbb59
#!/bin/sh
#
#该脚本为Linux下启动java程序的通用脚本。即可以作为开机自启动service脚本被调用,
#也可以作为启动java程序的独立脚本来使用。
#
#JDK所在路径
JAVA_HOME
=
"/usr/local/jdk/jdk1.8.0_121"
#Java程序所在的目录(classes的上一级目录)
APP_HOME
=
/home/xxpay/service/xxpay-shop
#需要启动的Java主程序(main方法类)
APP_MAINCLASS
=
org.xxpay.shop.XxPayShopApplication
#拼凑完整的classpath参数,包括指定lib目录下所有的jar
CLASSPATH
=
$APP_HOME
/classes
for
i
in
"
$APP_HOME
"
/lib/
*
.jar
;
do
CLASSPATH
=
"
$CLASSPATH
"
:
"
$i
"
done
#java虚拟机启动参数
JAVA_OPTS
=
"-ms1024m -mx1024m -Xmn256m -Djava.awt.headless=true -XX:MaxPermSize=128m"
###################################
#(函数)判断程序是否已启动
#
#说明:
#使用JDK自带的JPS命令及grep命令组合,准确查找pid
#jps 加 l 参数,表示显示java的完整包路径
#使用awk,分割出pid ($1部分),及Java程序名称($2部分)
#当jps命令不可用时,使用: ps -ef | grep $APP_MAINCLASS | grep -v "grep" | awk '{print $2}' 代替
###################################
#初始化psid变量(全局)
psid
=
0
checkpid
()
{
javaps
=
`
$JAVA_HOME
/bin/jps
-l
|
grep
$APP_MAINCLASS
`
#javaps=`ps -ef | grep $APP_MAINCLASS | grep -v "grep" | awk '{print $2}'`
if
[
-n
"
$javaps
"
]
;
then
psid
=
`
echo
$javaps
|
awk
'{print $1}'
`
else
psid
=
0
fi
}
###################################
#(函数)启动程序
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则提示程序已启动
#3. 如果程序没有被启动,则执行启动命令行
#4. 启动命令执行后,再次调用checkpid函数
#5. 如果步骤4的结果能够确认程序的pid,则打印[OK],否则打印[Failed]
#注意:echo -n 表示打印字符后,不换行
#注意: "nohup 某命令 >/dev/null 2>&1 &" 的用法
###################################
start
()
{
checkpid
if
[
$psid
-ne
0
]
;
then
echo
"================================"
echo
"warn:
$APP_MAINCLASS
already started! (pid=
$psid
)"
echo
"================================"
else
echo
-n
"Starting
$APP_MAINCLASS
..."
# -DlogFn=active 指的是生产日志文件名为active
nohup
$JAVA_HOME
/bin/java
$JAVA_OPTS
-DlogFn
=
level
-classpath
$CLASSPATH
$APP_MAINCLASS
>
/dev/null 2>&1 &
checkpid
if
[
$psid
-ne
0
]
;
then
echo
"(pid=
$psid
) [OK]"
else
echo
"[Failed]"
fi
fi
}
###################################
#(函数)停止程序
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则开始执行停止,否则,提示程序未运行
#3. 使用kill -9 pid命令进行强制杀死进程
#4. 执行kill命令行紧接其后,马上查看上一句命令的返回值: $?
#5. 如果步骤4的结果$?等于0,则打印[OK],否则打印[Failed]
#6. 为了防止java程序被启动多次,这里增加反复检查进程,反复杀死的处理(递归调用stop)。
#注意:echo -n 表示打印字符后,不换行
#注意: 在shell编程中,"$?" 表示上一句命令或者一个函数的返回值
###################################
stop
()
{
checkpid
if
[
$psid
-ne
0
]
;
then
echo
-n
"Stopping
$APP_MAINCLASS
...(pid=
$psid
) "
kill
-9
$psid
if
[
$?
-eq
0
]
;
then
echo
"[OK]"
else
echo
"[Failed]"
fi
checkpid
if
[
$psid
-ne
0
]
;
then
stop
fi
else
echo
"================================"
echo
"warn:
$APP_MAINCLASS
is not running"
echo
"================================"
fi
}
###################################
#(函数)检查程序运行状态
#
#说明:
#1. 首先调用checkpid函数,刷新$psid全局变量
#2. 如果程序已经启动($psid不等于0),则提示正在运行并表示出pid
#3. 否则,提示程序未运行
###################################
status
()
{
checkpid
if
[
$psid
-ne
0
]
;
then
echo
"
$APP_MAINCLASS
is running! (pid=
$psid
)"
else
echo
"
$APP_MAINCLASS
is not running"
fi
}
###################################
#(函数)打印系统环境参数
###################################
info
()
{
echo
"System Information:"
echo
"****************************"
echo
`
head
-n
1 /etc/issue
`
echo
`
uname
-a
`
echo
echo
"JAVA_HOME=
$JAVA_HOME
"
echo
`
$JAVA_HOME
/bin/java
-version
`
echo
echo
"APP_HOME=
$APP_HOME
"
echo
"APP_MAINCLASS=
$APP_MAINCLASS
"
echo
"****************************"
}
###################################
#读取脚本的第一个参数($1),进行判断
#参数取值范围:{start|stop|restart|status|info}
#如参数不在指定范围之内,则打印帮助信息
###################################
case
"
$1
"
in
'start'
)
start
;;
'stop'
)
stop
;;
'restart'
)
stop
start
;;
'status'
)
status
;;
'info'
)
info
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status|info}"
exit
1
esac
exit
0
\ No newline at end of file
xxpay4spring-cloud/pom.xml
View file @
390da586
...
...
@@ -5,8 +5,10 @@
<groupId>
org.xxpay
</groupId>
<artifactId>
xxpay4spring-cloud
</artifactId>
<version>
0.0
.1-SNAPSHOT
</version>
<version>
1.
0.0
</version>
<packaging>
pom
</packaging>
<name>
xxpay4spring-cloud
</name>
<description>
xxpay4spring-cloud
</description>
<modules>
<module>
xxpay-server
</module>
...
...
@@ -16,24 +18,45 @@
<module>
xxpay-gateway
</module>
</modules>
<!-- 使用最新的spring-boot版本 -->
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.
4.0
.RELEASE
</version>
<version>
1.
5.6
.RELEASE
</version>
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.xxpay
</groupId>
<artifactId>
xxpay-common
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-config
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
Brix
ton.SR
5
</version>
<version>
Dals
ton.SR
2
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment