parent
202bbb598e
commit
390da5869e
|
|
@ -0,0 +1,4 @@
|
|||
/.idea/
|
||||
*.iml
|
||||
/log/
|
||||
target/
|
||||
32
pom.xml
32
pom.xml
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
generator.jdbc.driver=com.mysql.jdbc.Driver
|
||||
generator.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
|
||||
|
|
@ -7,9 +7,8 @@
|
|||
<artifactId>xxpay-mgr</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>xxpay-mgr</name>
|
||||
<description>xxpay-master</description>
|
||||
<description>xxpay-mgr</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>
|
||||
|
|
|
|||
|
|
@ -1,78 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
|
|
@ -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/>
|
||||
|
|
|
|||
|
|
@ -1,176 +0,0 @@
|
|||
#!/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
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,78 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
<?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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,176 +0,0 @@
|
|||
#!/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
|
||||
|
|
@ -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>Brixton.SR5</version>
|
||||
<version>Dalston.SR2</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -7,22 +7,15 @@
|
|||
<artifactId>xxpay-config</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>xxpay-config</name>
|
||||
<description></description>
|
||||
<description>xxpay-config</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.4.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
<groupId>org.xxpay</groupId>
|
||||
<artifactId>xxpay4spring-cloud</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
|
@ -32,24 +25,8 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-eureka-server</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Camden.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
|
|
|||
|
|
@ -21,3 +21,6 @@ eureka:
|
|||
serviceUrl:
|
||||
defaultZone: http://localhost:2000/eureka/
|
||||
|
||||
logging:
|
||||
file: ./log/xxpay-config.log
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
# \u652F\u4ED8\u5B9D\u56DE\u8C03\u5730\u5740
|
||||
ali.notify_url=http://xxpay.ngrok.cc/notify/pay/aliPayNotifyRes.htm
|
||||
ali.notify_url=http://api.xxpay.org/notify/pay/aliPayNotifyRes.htm
|
||||
|
||||
# \u5FAE\u4FE1\u652F\u4ED8\u56DE\u8C03\u5730\u5740
|
||||
wx.notify_url=http://xxpay.ngrok.cc/notify/pay/wxPayNotifyRes.htm
|
||||
wx.notify_url=http://api.xxpay.org/notify/pay/wxPayNotifyRes.htm
|
||||
|
||||
# \u652F\u4ED8\u8BC1\u4E66\u6839\u8DEF\u5F84
|
||||
cert.root.path=/Users/dingzhiwei/java/tmp/cert
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
# \u652F\u4ED8\u5B9D\u56DE\u8C03\u5730\u5740
|
||||
ali.notify_url=http://api.xxpay.org/notify/aliPayNotifyRes.htm
|
||||
ali.notify_url=http://api.xxpay.org/notify/pay/aliPayNotifyRes.htm
|
||||
|
||||
# \u5FAE\u4FE1\u652F\u4ED8\u56DE\u8C03\u5730\u5740
|
||||
wx.notify_url=http://api.xxpay.org/notify/wxPayNotifyRes.htm
|
||||
wx.notify_url=http://api.xxpay.org/notify/pay/wxPayNotifyRes.htm
|
||||
|
||||
# \u652F\u4ED8\u8BC1\u4E66\u6839\u8DEF\u5F84
|
||||
cert.root.path=/Users/dingzhiwei/java/tmp/cert
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
# \u652F\u4ED8\u5B9D\u56DE\u8C03\u5730\u5740
|
||||
ali.notify_url=http://api.xxpay.org/notify/aliPayNotifyRes.htm
|
||||
ali.notify_url=http://api.xxpay.org/notify/pay/aliPayNotifyRes.htm
|
||||
|
||||
# \u5FAE\u4FE1\u652F\u4ED8\u56DE\u8C03\u5730\u5740
|
||||
wx.notify_url=http://api.xxpay.org/notify/wxPayNotifyRes.htm
|
||||
wx.notify_url=http://api.xxpay.org/notify/pay/wxPayNotifyRes.htm
|
||||
|
||||
# \u652F\u4ED8\u8BC1\u4E66\u6839\u8DEF\u5F84
|
||||
cert.root.path=/Users/dingzhiwei/java/tmp/cert
|
||||
|
|
@ -22,17 +22,15 @@ spring:
|
|||
maxPoolPreparedStatementPerConnectionSize: 20 # 指定每个连接上PSCache的大小
|
||||
filters: stat,wall,log4j # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||
profiles:
|
||||
active: prod
|
||||
|
||||
activemq:
|
||||
broker-url: failover:(tcp://127.0.0.1:61616?wireFormat.maxInactivityDuration=0)
|
||||
in-memory: true
|
||||
pool:
|
||||
enabled: true
|
||||
|
||||
logging:
|
||||
file: ./log/xxpay-service.log
|
||||
|
||||
ali:
|
||||
notify_url: http://xxpay.ngrok.cc/notify/pay/aliPayNotifyRes.htm
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,80 +7,31 @@
|
|||
<artifactId>xxpay-gateway</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>xxpay-gateway</name>
|
||||
<description>xxpay4spring-cloud</description>
|
||||
<description>xxpay-gateway</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
<groupId>org.xxpay</groupId>
|
||||
<artifactId>xxpay4spring-cloud</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<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-zuul</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>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-eureka-server</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Brixton.RELEASE</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>
|
||||
<!--<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<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>-->
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,74 +7,31 @@
|
|||
<artifactId>xxpay-server</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>xxpay-server</name>
|
||||
<description>xxpay4spring-cloud</description>
|
||||
<description>xxpay-server</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
<groupId>org.xxpay</groupId>
|
||||
<artifactId>xxpay4spring-cloud</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-eureka-server</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Brixton.RELEASE</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>
|
||||
<!--<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<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>-->
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,22 +7,15 @@
|
|||
<artifactId>xxpay-service</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>xxpay-service</name>
|
||||
<description>xxpay4spring-cloud</description>
|
||||
<description>xxpay-service</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
<groupId>org.xxpay</groupId>
|
||||
<artifactId>xxpay4spring-cloud</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.xxpay</groupId>
|
||||
|
|
@ -30,27 +23,16 @@
|
|||
<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>
|
||||
<artifactId>spring-boot-starter-activemq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--微信支付依赖-->
|
||||
<!--wx_pay-->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
|
|
@ -71,7 +53,7 @@
|
|||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.7</version>
|
||||
</dependency>
|
||||
<!--alipay依赖-->
|
||||
<!--ali_pay-->
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
|
|
@ -82,68 +64,17 @@
|
|||
<artifactId>jaxen</artifactId>
|
||||
<version>1.1.6</version>
|
||||
</dependency>
|
||||
<!--activeMq-->
|
||||
<!--<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-core</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-pool</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- SpringBoot ActiveMQ依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jms</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Brixton.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<finalName>xxpay-service</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<!--<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<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>-->
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,78 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -3,7 +3,6 @@ package org.xxpay;
|
|||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Description: xxpay支付核心服务,包括:各支付渠道接口,通知处理
|
||||
|
|
|
|||
|
|
@ -4,15 +4,12 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xxpay.common.constant.PayConstant;
|
||||
import org.xxpay.common.util.IPUtility;
|
||||
import org.xxpay.common.util.MyLog;
|
||||
import org.xxpay.common.util.PropertiesFileUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* User: rizenguo
|
||||
|
|
@ -30,14 +27,13 @@ public class Configure {
|
|||
JSONObject paramObj = JSON.parseObject(configParam);
|
||||
this.setMchID(paramObj.getString("mchId"));
|
||||
this.setAppID(paramObj.getString("appId"));
|
||||
this.setCertLocalPath(Configure.class.getClassLoader().getResource(paramObj.getString("certLocalPath")).getPath());
|
||||
this.setCertLocalPath(certRootPath + File.separator + paramObj.getString("certLocalPath"));
|
||||
this.setCertPassword(paramObj.getString("certPassword"));
|
||||
this.setKey(paramObj.getString("key"));
|
||||
this.setIp(IPUtility.getLocalIP());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
// 这个就是自己要保管好的私有Key了(切记只能放在自己的后台代码里,不能放在任何可能被看到源代码的客户端程序中)
|
||||
// 每次自己Post数据给API的时候都要用这个key来对所有字段进行签名,生成的签名会放在Sign这个字段,API收到Post数据的时候也会用同样的签名算法对Post过来的数据进行签名和验证
|
||||
// 收到API的返回的时候也要用这个key来对返回的数据算下签名,跟API的Sign数据进行比较,如果值不一致,有可能数据被第三方给篡改
|
||||
|
|
@ -65,6 +61,9 @@ public class Configure {
|
|||
//机器IP
|
||||
private String ip;
|
||||
|
||||
@Value("${cert.root.path}")
|
||||
private String certRootPath;
|
||||
|
||||
//以下是几个API的路径:
|
||||
//1)被扫支付API
|
||||
public static String PAY_API = "https://api.mch.weixin.qq.com/pay/micropay";
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.springframework.jms.annotation.JmsListener;
|
|||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.jms.core.MessageCreator;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.xxpay.common.util.MyLog;
|
||||
import org.xxpay.service.service.PayOrderService;
|
||||
|
|
@ -36,15 +37,15 @@ import java.util.Date;
|
|||
@Component
|
||||
public class Mq4PayNotify {
|
||||
|
||||
@Autowired
|
||||
private JmsTemplate jmsTemplate;
|
||||
|
||||
@Autowired
|
||||
private Queue payNotifyQueue;
|
||||
|
||||
@Autowired
|
||||
private PayOrderService payOrderService;
|
||||
|
||||
@Autowired
|
||||
private JmsTemplate jmsTemplate;
|
||||
|
||||
private static final MyLog _log = MyLog.getLog(Mq4PayNotify.class);
|
||||
|
||||
public void send(String msg) {
|
||||
|
|
@ -156,6 +157,13 @@ public class Mq4PayNotify {
|
|||
} catch (Exception e) {
|
||||
_log.error(e, "修改订单状态为处理完成异常");
|
||||
}
|
||||
// 修改通知次数
|
||||
try {
|
||||
int result = payOrderService.updateNotify(orderId);
|
||||
_log.info("修改payOrderId={},通知业务系统次数->{}", orderId, result == 1 ? "成功" : "失败");
|
||||
}catch (Exception e) {
|
||||
_log.error(e, "修改通知次数异常");
|
||||
}
|
||||
return ; // 通知成功结束
|
||||
}else {
|
||||
// 通知失败,延时再通知
|
||||
|
|
|
|||
|
|
@ -1,176 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
#该脚本为Linux下启动java程序的通用脚本。即可以作为开机自启动service脚本被调用,
|
||||
#也可以作为启动java程序的独立脚本来使用。
|
||||
#
|
||||
#JDK所在路径
|
||||
JAVA_HOME="/usr/local/jdk/jdk1.8.0_121"
|
||||
|
||||
#Java程序所在的目录(classes的上一级目录)
|
||||
APP_HOME=/home/xxpay/service/xxpay-service
|
||||
|
||||
#需要启动的Java主程序(main方法类)
|
||||
APP_MAINCLASS=org.xxpay.XxPayServiceApplication
|
||||
|
||||
#拼凑完整的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
|
||||
|
|
@ -3,15 +3,12 @@ package org.xxpay.service.dal;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = MockServletContext.class)
|
||||
@WebAppConfiguration
|
||||
public class ApplicationTests {
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
|
@ -15,7 +13,6 @@ import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
|
|||
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = MockServletContext.class)
|
||||
@WebAppConfiguration
|
||||
public class MchInfoTest {
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
|
@ -15,7 +13,6 @@ import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
|
|||
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = MockServletContext.class)
|
||||
@WebAppConfiguration
|
||||
public class PayOrderTest {
|
||||
|
||||
|
|
|
|||
|
|
@ -7,29 +7,21 @@
|
|||
<artifactId>xxpay-web</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>xxpay-web</name>
|
||||
<description>xxpay4spring-cloud</description>
|
||||
<description>xxpay-web</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
<groupId>org.xxpay</groupId>
|
||||
<artifactId>xxpay4spring-cloud</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<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-hystrix</artifactId>
|
||||
|
|
@ -42,60 +34,17 @@
|
|||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-feign</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>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-eureka-server</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Brixton.RELEASE</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>
|
||||
<!--<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<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>-->
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class PayOrderController {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/pay/create_order", method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/pay/create_order")
|
||||
public String payOrder(@RequestParam String params) {
|
||||
ServiceInstance instance = client.getLocalServiceInstance();
|
||||
_log.info("###### 开始接收商户统一下单请求 ######");
|
||||
|
|
@ -243,16 +243,6 @@ public class PayOrderController {
|
|||
return payOrder;
|
||||
}
|
||||
|
||||
/*String makeRetData(Map retMap) {
|
||||
if(retMap.get(PayConstant.RETURN_PARAM_RETCODE).equals(PayConstant.RETURN_VALUE_SUCCESS)) {
|
||||
String repKey = "Hpcl522AV6q613KIi46u6g6XuW8vM1N8bFgyv769770MdYe9u37M4y7rIpl8";
|
||||
String sign = PayDigestUtil.getSign(retMap, repKey, "payParams");
|
||||
retMap.put(PayConstant.RESULT_PARAM_SIGN, sign);
|
||||
}
|
||||
_log.info("生成响应数据:{}", retMap);
|
||||
return JSON.toJSONString(retMap);
|
||||
}*/
|
||||
|
||||
String getJsonParam(String[] names, Object[] values) {
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue