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
JeeSpringCloud
Commits
d3ad3768
"vscode:/vscode.git/clone" did not exist on "47fc1aeda476de4f019d6aa3fd8ef1897156392e"
Commit
d3ad3768
authored
Nov 12, 2018
by
Huang
Browse files
no commit message
parent
b6becbcd
Changes
393
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
20 of 393+
files are displayed.
Plain diff
Email patch
JeeSpringCloud/bin/clean.bat
deleted
100644 → 0
View file @
b6becbcd
@echo
off
rem /**
rem */
echo
.
echo
[
Ϣ
]
ļ
echo
.
pause
echo
.
cd
/d
%~dp0
cd
..
call
mvn
clean
cd
bin
pause
\ No newline at end of file
JeeSpringCloud/bin/eclipse.bat
deleted
100644 → 0
View file @
b6becbcd
@echo
off
rem /**
rem */
echo
.
echo
[
Ϣ
]
Eclipse
ļ
echo
.
cd
/d
%~dp0
cd
..
call
mvn
-Declipse
.workspace
=
%cd%
eclipse
:eclipse
cd
bin
pause
\ No newline at end of file
JeeSpringCloud/bin/idea.bat
deleted
100644 → 0
View file @
b6becbcd
@echo
off
rem /**
rem */
echo
.
echo
[
Ϣ
]
Eclipse
ļ
echo
.
cd
/d
%~dp0
cd
..
call
mvn
idea
:idea
cd
bin
pause
\ No newline at end of file
JeeSpringCloud/bin/package.bat
deleted
100644 → 0
View file @
b6becbcd
@echo
off
rem /**
rem */
echo
.
echo
[
Ϣ
]
package
ļ
echo
.
cd
/d
%~dp0
cd
..
call
mvn
package
cd
bin
pause
\ No newline at end of file
JeeSpringCloud/bin/run.bat
deleted
100644 → 0
View file @
b6becbcd
@echo
off
rem /**
rem */
echo
.
echo
[
Ϣ
]
йļ
echo
.
cd
/d
%~dp0
cd
../target
java
-jar
JeeSpring
-
1
.0.0
-SNAPSHOT
.war
cd
bin
pause
\ No newline at end of file
JeeSpringCloud/pom.xml
deleted
100644 → 0
View file @
b6becbcd
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.jeespring
</groupId>
<artifactId>
JeeSpring
</artifactId>
<name>
JeeSpring
</name>
<description>
JeeSpring
</description>
<version>
1.0.0-SNAPSHOT
</version>
<packaging>
war
</packaging>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.2.RELEASE
</version>
</parent>
<properties>
<shiro.version>
1.4.0-RC2
</shiro.version>
<poi.version>
3.9
</poi.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<commons-lang3.version>
3.3.2
</commons-lang3.version>
<commons-io.version>
2.4
</commons-io.version>
<commons-codec.version>
1.9
</commons-codec.version>
<commons-fileupload.version>
1.3.1
</commons-fileupload.version>
<commons-beanutils.version>
1.9.1
</commons-beanutils.version>
<tomcat.version>
8.0.29
</tomcat.version>
<!--activiti.version>5.19.0.2</activiti.version-->
<activiti.version>
5.22.0
</activiti.version>
<beetl.version>
2.8.5
</beetl.version>
</properties>
<!-- 设定主仓库,按设定顺序进行查找。 -->
<repositories>
<repository>
<id>
jeespring-repos
</id>
<name>
jeespring Repository
</name>
<url>
http://maven.aliyun.com/nexus/content/groups/public/
</url>
</repository>
</repositories>
<!-- 设定插件仓库 -->
<pluginRepositories>
<pluginRepository>
<id>
jeespring-repos
</id>
<name>
jeespring Repository
</name>
<url>
http://maven.aliyun.com/nexus/content/groups/public/
</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-jasper
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-el
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.tomcat
</groupId>
<artifactId>
tomcat-juli
</artifactId>
<version>
${tomcat.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-cache
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
1.3.0
</version>
</dependency>
<!-- SPRING begin -->
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<dependency>
<groupId>
org.yaml
</groupId>
<artifactId>
snakeyaml
</artifactId>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
com.zaxxer
</groupId>
<artifactId>
HikariCP
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.module
</groupId>
<artifactId>
jackson-module-jaxb-annotations
</artifactId>
</dependency>
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
21.0
</version>
</dependency>
<dependency>
<groupId>
taglibs
</groupId>
<artifactId>
standard
</artifactId>
<version>
1.1.2
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
jstl
</artifactId>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
</dependency>
<dependency>
<groupId>
javax.servlet.jsp
</groupId>
<artifactId>
jsp-api
</artifactId>
<version>
2.2
</version>
</dependency>
<dependency>
<groupId>
net.sf.ehcache
</groupId>
<artifactId>
ehcache-core
</artifactId>
<version>
2.6.11
</version>
</dependency>
<dependency>
<groupId>
net.sf.ehcache
</groupId>
<artifactId>
ehcache-web
</artifactId>
<version>
2.0.4
</version>
</dependency>
<dependency>
<groupId>
org.apache.shiro
</groupId>
<artifactId>
shiro-core
</artifactId>
<version>
${shiro.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.shiro
</groupId>
<artifactId>
shiro-spring
</artifactId>
<version>
${shiro.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.shiro
</groupId>
<artifactId>
shiro-cas
</artifactId>
<version>
${shiro.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.shiro
</groupId>
<artifactId>
shiro-web
</artifactId>
<version>
${shiro.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.shiro
</groupId>
<artifactId>
shiro-ehcache
</artifactId>
<version>
${shiro.version}
</version>
</dependency>
<!-- GENERAL UTILS begin -->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-email
</artifactId>
<version>
1.3.2
</version>
</dependency>
<dependency>
<groupId>
commons-codec
</groupId>
<artifactId>
commons-codec
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.5
</version>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.5
</version>
</dependency>
<dependency>
<groupId>
commons-fileupload
</groupId>
<artifactId>
commons-fileupload
</artifactId>
<version>
1.3.2
</version>
</dependency>
<!-- pojo copy -->
<dependency>
<groupId>
net.sf.dozer
</groupId>
<artifactId>
dozer
</artifactId>
<version>
5.5.1
</version>
</dependency>
<!-- poi office -->
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
<version>
${poi.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
${poi.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml-schemas
</artifactId>
<version>
${poi.version}
</version>
</dependency>
<!-- image util -->
<!--dependency> <groupId>com.drewnoakes</groupId> <artifactId>metadata-extractor</artifactId>
<version>2.10.1</version> </dependency -->
<dependency>
<groupId>
javax.mail
</groupId>
<artifactId>
mail
</artifactId>
<version>
1.4.7
</version>
</dependency>
<!-- GENERAL UTILS end -->
<!-- CKFinder begin -->
<dependency>
<groupId>
net.coobird
</groupId>
<artifactId>
thumbnailator
</artifactId>
<version>
0.4.8
</version>
</dependency>
<dependency>
<groupId>
com.ckfinder
</groupId>
<artifactId>
apache-ant-zip
</artifactId>
<version>
2.3
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/src/main/webapp/WEB-INF/lib/apache-ant-zip-2.3.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.ckfinder
</groupId>
<artifactId>
ckfinder
</artifactId>
<version>
2.3
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/src/main/webapp/WEB-INF/lib/ckfinder-2.3.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.ckfinder
</groupId>
<artifactId>
ckfinderplugin-fileeditor
</artifactId>
<version>
2.3
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/src/main/webapp/WEB-INF/lib/ckfinderplugin-fileeditor-2.3.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.ckfinder
</groupId>
<artifactId>
ckfinderplugin-imageresize
</artifactId>
<version>
2.3
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/src/main/webapp/WEB-INF/lib/ckfinderplugin-imageresize-2.3.jar
</systemPath>
</dependency>
<dependency>
<groupId>
com.swetake
</groupId>
<artifactId>
qrcode
</artifactId>
<version>
1.5
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/src/main/webapp/WEB-INF/lib/QRCode-1.5.jar
</systemPath>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.5.1
</version>
</dependency>
<dependency>
<groupId>
com.google.zxing
</groupId>
<artifactId>
core
</artifactId>
<version>
3.3.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-freemarker
</artifactId>
</dependency>
<!--dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId>
<version>2.3.23</version> </dependency -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.0.18
</version>
</dependency>
<dependency>
<groupId>
org.java-websocket
</groupId>
<artifactId>
Java-WebSocket
</artifactId>
<version>
1.3.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.5.0
</version>
</dependency>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.5.0
</version>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.5
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-redis
</artifactId>
<version>
1.4.7.RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.29
</version>
</dependency>
<!-- image util -->
<dependency>
<groupId>
com.drewnoakes
</groupId>
<artifactId>
metadata-extractor
</artifactId>
<version>
2.6.2
</version>
</dependency>
<!-- 条形码、二维码生成 -->
<dependency>
<groupId>
com.google.zxing
</groupId>
<artifactId>
core
</artifactId>
<version>
2.2
</version>
</dependency>
<dependency>
<groupId>
com.google.zxing
</groupId>
<artifactId>
javase
</artifactId>
<version>
2.2
</version>
</dependency>
<!-- email -->
<dependency>
<groupId>
javax.mail
</groupId>
<artifactId>
mail
</artifactId>
<version>
1.4.7
</version>
</dependency>
<dependency>
<groupId>
javax.activation
</groupId>
<artifactId>
activation
</artifactId>
<version>
1.1.1
</version>
</dependency>
<!-- User Agent -->
<dependency>
<groupId>
bitwalker
</groupId>
<artifactId>
UserAgentUtils
</artifactId>
<version>
1.13
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/src/main/webapp/WEB-INF/lib/UserAgentUtils-1.13.jar
</systemPath>
</dependency>
<!-- GENERAL UTILS begin -->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
${commons-lang3.version}
</version>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
${commons-io.version}
</version>
</dependency>
<dependency>
<groupId>
commons-codec
</groupId>
<artifactId>
commons-codec
</artifactId>
<version>
${commons-codec.version}
</version>
</dependency>
<dependency>
<groupId>
commons-fileupload
</groupId>
<artifactId>
commons-fileupload
</artifactId>
<version>
${commons-fileupload.version}
</version>
</dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
<artifactId>
commons-beanutils
</artifactId>
<version>
${commons-beanutils.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- activemq support -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-activemq
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.activemq
</groupId>
<artifactId>
activemq-pool
</artifactId>
<!-- <version>5.7.0</version> -->
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
RELEASE
</version>
</dependency>
<!-- shiro+redis缓存插件 -->
<dependency>
<groupId>
org.crazycake
</groupId>
<artifactId>
shiro-redis
</artifactId>
<version>
2.4.2.1-RELEASE
</version>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
<version>
1.5.0
</version>
</dependency>
<dependency>
<groupId>
org.jolokia
</groupId>
<artifactId>
jolokia-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.fusesource
</groupId>
<artifactId>
sigar
</artifactId>
<version>
1.6.4
</version>
</dependency>
<dependency>
<groupId>
com.github.abel533
</groupId>
<artifactId>
ECharts
</artifactId>
<version>
2.2.7
</version>
</dependency>
<!-- 定时任务 -->
<dependency>
<groupId>
org.quartz-scheduler
</groupId>
<artifactId>
quartz
</artifactId>
<version>
2.3.0
</version>
<exclusions>
<exclusion>
<groupId>
com.mchange
</groupId>
<artifactId>
c3p0
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- dubbo -->
<dependency>
<groupId>
com.alibaba.boot
</groupId>
<artifactId>
dubbo-spring-boot-starter
</artifactId>
<version>
0.1.0
</version>
</dependency>
<dependency>
<groupId>
com.101tec
</groupId>
<artifactId>
zkclient
</artifactId>
<version>
0.10
</version>
</dependency>
<!-- Activiti -->
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-engine
</artifactId>
<version>
${activiti.version}
</version>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-spring
</artifactId>
<version>
${activiti.version}
</version>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-explorer
</artifactId>
<version>
${activiti.version}
</version>
<exclusions>
<exclusion>
<artifactId>
vaadin
</artifactId>
<groupId>
com.vaadin
</groupId>
</exclusion>
<exclusion>
<artifactId>
dcharts-widget
</artifactId>
<groupId>
org.vaadin.addons
</groupId>
</exclusion>
<exclusion>
<artifactId>
activiti-simple-workflow
</artifactId>
<groupId>
org.activiti
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-modeler
</artifactId>
<version>
${activiti.version}
</version>
</dependency>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-diagram-rest
</artifactId>
<version>
${activiti.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-oauth2
</artifactId>
<version>
1.1.3.RELEASE
</version>
</dependency>
<!-- 支持activiti缓存 -->
<!-- <dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>5.1.7.Final</version>
</dependency> -->
<!--dependency>
<groupId>com.ibeetl</groupId>
<artifactId>beetl-framework-starter</artifactId>
<version>1.1.63.RELEASE</version>
</dependency-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<encoding>
UTF-8
</encoding>
<source>
1.8
</source>
<target>
1.8
</target>
<compilerArguments>
<verbose/>
<bootclasspath>
${java.home}/lib/rt.jar;${java.home}/lib/jce.jar
</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<excludeArtifactIds>
slf4j-log4j12
</excludeArtifactIds>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/AssembleTool.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.Map
;
public
class
AssembleTool
{
public
static
String
assembleUrl
(
String
url
,
Map
<
String
,
String
>
params
){
if
(!
url
.
endsWith
(
"?"
)){
url
+=
"?"
;
}
for
(
String
key:
params
.
keySet
()){
try
{
if
(
params
.
get
(
key
)==
null
||
params
.
get
(
key
).
length
()==
0
){
url
+=
key
+
"="
+
params
.
get
(
key
)+
"&"
;
}
else
{
url
+=
key
+
"="
+
URLEncoder
.
encode
(
params
.
get
(
key
),
"utf-8"
)+
"&"
;
}
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
}
return
url
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/BulidUrl.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
cn.com.duiba.credits.sdk.entity.CreditAuditParams
;
import
cn.com.duiba.credits.sdk.entity.CreditConfirmParams
;
import
cn.com.duiba.credits.sdk.entity.ExpressInfo
;
/**
* @author Administrator
* 工具类是开发者构造一些请求的url工具类,仅供参考
*/
public
class
BulidUrl
{
public
static
String
AppKey
=
"7HWwRiKJXPiyh7pF4QnYAieVPQL"
;
//此处填写开发者自己的appKey
public
static
String
AppSecret
=
"4WazdJGJ9PVFVu7vXZozn2Kywaki"
;
//此处填写开发者自己的appSecret
/**
* 构建在兑吧商城自动登录的url地址
* @param uid 用户id
* @param redirect 免登陆接口回传回来 dbredirect参数
* @param credits 用户积分余额
* @return 自动登录的url地址
*/
public
static
String
buildAutoLoginRequest
(
String
uid
,
Long
credits
,
String
redirect
){
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
String
url
=
"https://www.duiba.com.cn/autoLogin/autologin?"
;
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"uid"
,
uid
);
params
.
put
(
"credits"
,
credits
+
""
);
if
(
redirect
!=
null
){
params
.
put
(
"redirect"
,
redirect
);
}
String
autologinUrl
=
tool
.
buildUrlWithSign
(
url
,
params
);
return
autologinUrl
;
}
/**
* 构建向兑吧查询兑换订单状态的url地址
* @param orderNum 兑吧的订单号
* @return
*/
public
static
String
buildCreditOrderStatusRequest
(
String
orderNum
,
String
bizId
){
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
if
(
orderNum
==
null
){
orderNum
=
""
;
}
if
(
bizId
==
null
){
bizId
=
""
;
}
String
url
=
"http://www.duiba.com.cn/status/orderStatus?"
;
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"orderNum"
,
orderNum
);
params
.
put
(
"bizId"
,
bizId
);
String
buildUrl
=
tool
.
buildUrlWithSign
(
url
,
params
);
return
buildUrl
;
}
/**
* 构建开发者审核结果的的方法
* @param params
* @return 发起请求的url
*/
public
static
String
buildCreditAuditRequest
(
CreditAuditParams
params
){
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
String
url
=
"http://www.duiba.com.cn/audit/apiAudit?"
;
Map
<
String
,
String
>
signParams
=
new
HashMap
<
String
,
String
>();
if
(
params
.
getPassOrderNums
()!=
null
&&
params
.
getPassOrderNums
().
size
()>
0
){
String
s
=
null
;
for
(
String
o:
params
.
getPassOrderNums
()){
if
(
s
==
null
){
s
=
o
;
}
else
{
s
+=
","
+
o
;
}
}
signParams
.
put
(
"passOrderNums"
,
s
);
}
else
{
signParams
.
put
(
"passOrderNums"
,
""
);
}
if
(
params
.
getRejectOrderNums
()!=
null
&&
params
.
getRejectOrderNums
().
size
()>
0
){
String
s
=
null
;
for
(
String
o:
params
.
getRejectOrderNums
()){
if
(
s
==
null
){
s
=
o
;
}
else
{
s
+=
","
+
o
;
}
}
signParams
.
put
(
"rejectOrderNums"
,
s
);
}
else
{
signParams
.
put
(
"rejectOrderNums"
,
""
);
}
String
buildUrl
=
tool
.
buildUrlWithSign
(
url
,
signParams
);
return
buildUrl
;
}
/**
* 构建开发者向兑吧发起兑换成功失败的确认通知请求
* @param params
* @return
*/
public
static
String
buildCreditConfirmRequest
(
CreditConfirmParams
p
){
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
String
url
=
"http://www.duiba.com.cn/confirm/confirm?"
;
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"success"
,
p
.
isSuccess
()+
""
);
params
.
put
(
"errorMessage"
,
p
.
getErrorMessage
());
params
.
put
(
"orderNum"
,
p
.
getOrderNum
());
String
bulidurl
=
tool
.
buildUrlWithSign
(
url
,
params
);
return
bulidurl
;
}
/**
* 前置商品查询URL
* @param count 查询返回的商品数量,最大支持50个
* @return
*/
public
static
String
queryForFrontItem
(
String
count
)
{
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"count"
,
count
);
String
url
=
tool
.
buildUrlWithSign
(
"http://www.duiba.com.cn/queryForFrontItem/query?"
,
params
);
return
url
;
}
/**
* 构建向兑吧请求增加活动次数的url地址
* @param uid :用户id activityId:活动id, times:增加活动次数, bizId:本次请求开发者订单号,保证唯一性
* @return
*/
public
static
String
getActivityTimes
(
String
uid
,
String
activityId
,
String
times
,
String
bizId
)
{
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"uid"
,
uid
);
params
.
put
(
"bizId"
,
bizId
);
params
.
put
(
"activityId"
,
activityId
);
params
.
put
(
"times"
,
times
);
String
url
=
tool
.
buildUrlWithSign
(
"https://activity.m.duiba.com.cn/activityVist/addTimes?"
,
params
);
return
url
;
}
/**
* 自有商品批量取消发货
* @param
* orderNums 最大支持100个
* 方法中,对于超过100的会自动截取前100个
* @return
*/
public
static
String
batchCancel
(
List
<
String
>
orderNums
)
{
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
if
(
orderNums
.
size
()>
100
){
orderNums
=
orderNums
.
subList
(
0
,
100
);
}
params
.
put
(
"orderNums"
,
orderNums
.
toString
().
substring
(
1
,
orderNums
.
toString
().
length
()-
1
));
String
url
=
tool
.
buildUrlWithSign
(
"http://www.duiba.com.cn/sendObject/batchCancel?"
,
params
);
return
url
;
}
/**
* 自有商品批量发货
* @params info 格式如下
* 发货的数量,每次请求不超过100个
* 方法中,对于超过100的会自动截取前100个
* @return
*/
public
static
String
batchSend
(
List
<
ExpressInfo
>
infos
)
{
CreditTool
tool
=
new
CreditTool
(
AppKey
,
AppSecret
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
StringBuffer
expressInfo
=
new
StringBuffer
();
if
(
infos
.
size
()>
100
){
infos
=
infos
.
subList
(
0
,
100
);
}
for
(
ExpressInfo
info:
infos
)
{
expressInfo
.
append
(
info
);
}
expressInfo
.
deleteCharAt
(
expressInfo
.
length
()-
1
);
params
.
put
(
"expressInfo"
,
expressInfo
.
toString
());
String
url
=
tool
.
buildUrlWithSign
(
"http://www.duiba.com.cn/sendObject/batchSend?"
,
params
);
return
url
;
}
}
\ No newline at end of file
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/CreditTool.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
cn.com.duiba.credits.sdk.entity.AddCreditsParams
;
import
cn.com.duiba.credits.sdk.entity.CreditConsumeParams
;
import
cn.com.duiba.credits.sdk.entity.CreditNeedAuditParams
;
import
cn.com.duiba.credits.sdk.entity.CreditNotifyParams
;
import
cn.com.duiba.credits.sdk.entity.VirtualParams
;
public
class
CreditTool
{
private
String
appKey
;
private
String
appSecret
;
public
CreditTool
(
String
appKey
,
String
appSecret
){
this
.
appKey
=
appKey
;
this
.
appSecret
=
appSecret
;
}
/**
* 通用的url生成方法
* @param url
* @param params
* @return
*/
public
String
buildUrlWithSign
(
String
url
,
Map
<
String
,
String
>
params
){
Map
<
String
,
String
>
newparams
=
new
HashMap
<
String
,
String
>(
params
);
newparams
.
put
(
"appKey"
,
appKey
);
newparams
.
put
(
"appSecret"
,
appSecret
);
if
(
newparams
.
get
(
"timestamp"
)==
null
){
newparams
.
put
(
"timestamp"
,
System
.
currentTimeMillis
()+
""
);
}
String
sign
=
SignTool
.
sign
(
newparams
);
newparams
.
put
(
"sign"
,
sign
);
newparams
.
remove
(
"appSecret"
);
return
AssembleTool
.
assembleUrl
(
url
,
newparams
);
}
/**
* 积分消耗请求的解析方法
* @param request
* @return
* @throws Exception
*/
public
CreditConsumeParams
parseCreditConsume
(
HttpServletRequest
request
)
throws
Exception
{
if
(!
appKey
.
equals
(
request
.
getParameter
(
"appKey"
))){
throw
new
Exception
(
"appKey不匹配"
);
}
if
(
request
.
getParameter
(
"timestamp"
)==
null
){
throw
new
Exception
(
"请求中没有带时间戳"
);
}
boolean
verify
=
SignTool
.
signVerify
(
appSecret
,
request
);
if
(!
verify
){
throw
new
Exception
(
"签名验证失败"
);
}
CreditConsumeParams
params
=
new
CreditConsumeParams
();
params
.
setAppKey
(
appKey
);
params
.
setUid
(
request
.
getParameter
(
"uid"
));
params
.
setCredits
(
Long
.
valueOf
(
request
.
getParameter
(
"credits"
)));
params
.
setTimestamp
(
new
Date
(
Long
.
valueOf
(
request
.
getParameter
(
"timestamp"
))));
params
.
setDescription
(
request
.
getParameter
(
"description"
));
params
.
setOrderNum
(
request
.
getParameter
(
"orderNum"
));
params
.
setType
(
request
.
getParameter
(
"type"
));
if
(
request
.
getParameter
(
"facePrice"
)!=
null
){
params
.
setFacePrice
(
Integer
.
valueOf
(
request
.
getParameter
(
"facePrice"
)));
}
if
(
request
.
getParameter
(
"actualPrice"
)!=
null
){
params
.
setActualPrice
(
Integer
.
valueOf
(
request
.
getParameter
(
"actualPrice"
)));
}
if
(
request
.
getParameter
(
"itemCode"
)!=
null
){
params
.
setItemCode
(
request
.
getParameter
(
"itemCode"
));
}
params
.
setAlipay
(
request
.
getParameter
(
"alipay"
));
params
.
setPhone
(
request
.
getParameter
(
"phone"
));
params
.
setQq
(
request
.
getParameter
(
"qq"
));
if
(
request
.
getParameter
(
"waitAudit"
)!=
null
){
params
.
setWaitAudit
(
Boolean
.
valueOf
(
request
.
getParameter
(
"waitAudit"
)));
}
params
.
setIp
(
request
.
getParameter
(
"ip"
));
params
.
setParams
(
request
.
getParameter
(
"params"
));
return
params
;
}
/**
* 积分消耗结果通知请求 的解析方法
* @param request
* @return
* @throws Exception
*/
public
CreditNotifyParams
parseCreditNotify
(
HttpServletRequest
request
)
throws
Exception
{
if
(!
appKey
.
equals
(
request
.
getParameter
(
"appKey"
))){
throw
new
Exception
(
"appKey不匹配"
);
}
if
(
request
.
getParameter
(
"timestamp"
)==
null
){
throw
new
Exception
(
"请求中没有带时间戳"
);
}
boolean
verify
=
SignTool
.
signVerify
(
appSecret
,
request
);
if
(!
verify
){
throw
new
Exception
(
"签名验证失败"
);
}
CreditNotifyParams
params
=
new
CreditNotifyParams
();
params
.
setSuccess
(
Boolean
.
valueOf
(
request
.
getParameter
(
"success"
)));
params
.
setErrorMessage
(
request
.
getParameter
(
"errorMessage"
));
params
.
setBizId
(
request
.
getParameter
(
"bizId"
));
params
.
setUid
(
request
.
getParameter
(
"uid"
));
params
.
setAppKey
(
request
.
getParameter
(
"appKey"
));
params
.
setTimestamp
(
new
Date
(
Long
.
valueOf
(
request
.
getParameter
(
"timestamp"
))));
params
.
setOrderNum
(
request
.
getParameter
(
"orderNum"
));
return
params
;
}
/**
* 需要审核的兑换 的解析方法
* @param request
* @return
* @throws Exception
*/
public
CreditNeedAuditParams
parseCreditAudit
(
HttpServletRequest
request
)
throws
Exception
{
if
(!
appKey
.
equals
(
request
.
getParameter
(
"appKey"
))){
throw
new
Exception
(
"appKey不匹配"
);
}
if
(
request
.
getParameter
(
"timestamp"
)==
null
){
throw
new
Exception
(
"请求中没有带时间戳"
);
}
boolean
verify
=
SignTool
.
signVerify
(
appSecret
,
request
);
if
(!
verify
){
throw
new
Exception
(
"签名验证失败"
);
}
CreditNeedAuditParams
params
=
new
CreditNeedAuditParams
();
params
.
setAppKey
(
appKey
);
params
.
setTimestamp
(
new
Date
(
Long
.
valueOf
(
request
.
getParameter
(
"timestamp"
))));
params
.
setBizId
(
request
.
getParameter
(
"bizId"
));
return
params
;
}
/**
* 虚拟商品充值解析
* @param request
* @return
* @throws Exception
*/
public
VirtualParams
virtualConsume
(
HttpServletRequest
request
)
throws
Exception
{
if
(!
appKey
.
equals
(
request
.
getParameter
(
"appKey"
))){
throw
new
Exception
(
"appKey不匹配"
);
}
if
(
request
.
getParameter
(
"timestamp"
)==
null
){
throw
new
Exception
(
"请求中没有带时间戳"
);
}
boolean
verify
=
SignTool
.
signVerify
(
appSecret
,
request
);
if
(!
verify
){
throw
new
Exception
(
"签名验证失败"
);
}
VirtualParams
params
=
new
VirtualParams
();
params
.
setAppKey
(
appKey
);
params
.
setUid
(
request
.
getParameter
(
"uid"
));
params
.
setSupplierBizId
(
request
.
getParameter
(
"supplierBizId"
));
params
.
setTimestamp
(
new
Date
(
Long
.
valueOf
(
request
.
getParameter
(
"timestamp"
))));
params
.
setDescription
(
request
.
getParameter
(
"description"
));
params
.
setOrderNum
(
request
.
getParameter
(
"orderNum"
));
if
(
request
.
getParameter
(
"account"
)!=
null
){
params
.
setAccount
(
request
.
getParameter
(
"account"
));
}
params
.
setParams
(
request
.
getParameter
(
"params"
));
return
params
;
}
/**
* 加积分接口解析
* @param request
* @return
* @throws Exception
*/
public
AddCreditsParams
parseaddCredits
(
HttpServletRequest
request
)
throws
Exception
{
if
(!
appKey
.
equals
(
request
.
getParameter
(
"appKey"
))){
throw
new
Exception
(
"appKey不匹配"
);
}
if
(
request
.
getParameter
(
"timestamp"
)==
null
){
throw
new
Exception
(
"请求中没有带时间戳"
);
}
boolean
verify
=
SignTool
.
signVerify
(
appSecret
,
request
);
if
(!
verify
){
throw
new
Exception
(
"签名验证失败"
);
}
AddCreditsParams
params
=
new
AddCreditsParams
();
params
.
setAppKey
(
appKey
);
params
.
setUid
(
request
.
getParameter
(
"uid"
));
params
.
setCredits
(
Long
.
valueOf
(
request
.
getParameter
(
"credits"
)));
params
.
setTimestamp
(
new
Date
(
Long
.
valueOf
(
request
.
getParameter
(
"timestamp"
))));
params
.
setDescription
(
request
.
getParameter
(
"description"
));
params
.
setOrderNum
(
request
.
getParameter
(
"orderNum"
));
params
.
setType
(
request
.
getParameter
(
"type"
));
if
(
request
.
getParameter
(
"transfer"
)!=
null
){
params
.
setTransfer
(
request
.
getParameter
(
"transfer"
));
}
return
params
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/SignTool.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk
;
import
java.nio.charset.Charset
;
import
java.security.MessageDigest
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
public
class
SignTool
{
public
static
boolean
signVerify
(
String
appSecret
,
HttpServletRequest
request
){
Map
<
String
,
String
[]>
map
=
request
.
getParameterMap
();
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
for
(
String
key:
map
.
keySet
()){
data
.
put
(
key
,
map
.
get
(
key
)[
0
]);
}
return
signVerify
(
appSecret
,
data
);
}
public
static
boolean
signVerify
(
String
appSecret
,
Map
<
String
,
String
>
params
){
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"appSecret"
,
appSecret
);
for
(
String
key:
params
.
keySet
()){
if
(!
key
.
equals
(
"sign"
)){
map
.
put
(
key
,
params
.
get
(
key
));
}
}
String
sign
=
sign
(
map
);
if
(
sign
.
equals
(
params
.
get
(
"sign"
))){
return
true
;
}
return
false
;
}
private
static
String
toHexValue
(
byte
[]
messageDigest
)
{
if
(
messageDigest
==
null
)
return
""
;
StringBuilder
hexValue
=
new
StringBuilder
();
for
(
byte
aMessageDigest
:
messageDigest
)
{
int
val
=
0xFF
&
aMessageDigest
;
if
(
val
<
16
)
{
hexValue
.
append
(
"0"
);
}
hexValue
.
append
(
Integer
.
toHexString
(
val
));
}
return
hexValue
.
toString
();
}
/**
*
* @param params
* @return
*/
public
static
String
sign
(
Map
<
String
,
String
>
params
){
List
<
String
>
keys
=
new
ArrayList
<
String
>(
params
.
keySet
());
Collections
.
sort
(
keys
);
String
string
=
""
;
for
(
String
s:
keys
){
string
+=
params
.
get
(
s
);
}
String
sign
=
""
;
try
{
sign
=
toHexValue
(
encryptMD5
(
string
.
getBytes
(
Charset
.
forName
(
"utf-8"
))));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"md5 error"
);
}
return
sign
;
}
private
static
byte
[]
encryptMD5
(
byte
[]
data
)
throws
Exception
{
MessageDigest
md5
=
MessageDigest
.
getInstance
(
"MD5"
);
md5
.
update
(
data
);
return
md5
.
digest
();
}
public
static
void
main
(
String
[]
args
)
{
String
appKey
=
"key"
;
String
appSecret
=
"secret"
;
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
params
.
put
(
"appKey"
,
appKey
);
params
.
put
(
"appSecret"
,
appSecret
);
params
.
put
(
"date"
,
new
Date
().
getTime
()+
""
);
String
sign
=
sign
(
params
);
params
.
put
(
"sign"
,
sign
);
System
.
out
.
println
(
signVerify
(
appSecret
,
params
));
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/AddCreditsParams.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
import
java.util.Date
;
public
class
AddCreditsParams
{
private
String
appKey
;
private
Date
timestamp
;
//时间戳
private
Long
credits
;
//增加积分值
private
String
orderNum
=
""
;
//兑吧订单号
private
String
description
=
""
;
private
String
type
=
""
;
//积分活类型,活动和签到
private
String
uid
=
""
;
private
String
ip
=
""
;
//用户兑换时使用的ip地址,有可能为空
private
String
transfer
=
""
;
//非必须参数
public
Long
getCredits
()
{
return
credits
;
}
public
void
setCredits
(
Long
credits
)
{
this
.
credits
=
credits
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getAppKey
()
{
return
appKey
;
}
public
void
setAppKey
(
String
appKey
)
{
this
.
appKey
=
appKey
;
}
public
Date
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
Date
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
public
String
getUid
()
{
return
uid
;
}
public
void
setUid
(
String
uid
)
{
this
.
uid
=
uid
;
}
public
String
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
String
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getIp
()
{
return
ip
;
}
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
public
String
getTransfer
()
{
return
transfer
;
}
public
void
setTransfer
(
String
transfer
)
{
this
.
transfer
=
transfer
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/CreditAuditParams.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 开发者向兑吧发起请求,通知兑吧,订单的审核结果的参数
*
* 兑吧产生的部分订单,出于安全的考虑,会要求开发者进行审核,审核通过后才会继续执行兑换操作
*
* 如果开发者要告知兑吧审核结果,可以向兑吧发起请求,构建这个 CreditAuditParams对象,将此对象发送给兑吧即可
*
* @author xuhengfei
*
*/
public
class
CreditAuditParams
{
//审核通过的订单列表
private
List
<
String
>
passOrderNums
=
new
ArrayList
<
String
>();
//审核不通过的订单列表
private
List
<
String
>
rejectOrderNums
=
new
ArrayList
<
String
>();
public
List
<
String
>
getPassOrderNums
()
{
return
passOrderNums
;
}
public
void
setPassOrderNums
(
List
<
String
>
passOrderNums
)
{
this
.
passOrderNums
=
passOrderNums
;
}
public
List
<
String
>
getRejectOrderNums
()
{
return
rejectOrderNums
;
}
public
void
setRejectOrderNums
(
List
<
String
>
rejectOrderNums
)
{
this
.
rejectOrderNums
=
rejectOrderNums
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/CreditConfirmParams.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
import
java.util.Date
;
/**
* 开发者向兑吧发起请求,确认兑换成功失败的参数
*
* 目前仅限于虚拟商品,需要使用
* @author xuhengfei
*
*/
public
class
CreditConfirmParams
{
private
boolean
success
=
true
;
private
String
errorMessage
=
""
;
private
String
orderNum
=
""
;
public
String
getErrorMessage
()
{
return
errorMessage
;
}
public
void
setErrorMessage
(
String
errorMessage
)
{
this
.
errorMessage
=
errorMessage
;
}
public
boolean
isSuccess
()
{
return
success
;
}
public
void
setSuccess
(
boolean
success
)
{
this
.
success
=
success
;
}
public
String
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
String
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/CreditConsumeParams.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
cn.com.duiba.credits.sdk.SignTool
;
public
class
CreditConsumeParams
{
private
String
appKey
;
private
Date
timestamp
;
//时间戳
private
Long
credits
;
//消耗积分数
private
String
orderNum
=
""
;
//兑吧订单号
private
String
description
=
""
;
private
String
itemCode
=
""
;
//商品编码,非必须参数
private
String
type
=
""
;
//类型:QB,Phonebill,Alipay,Coupon 所有类型不区分大小写
private
Integer
facePrice
=
0
;
//面值,分为单位
private
Integer
actualPrice
=
0
;
//实际扣款,分为单位
private
String
alipay
=
""
;
//已废弃,请使用params
private
String
phone
=
""
;
//已废弃,请使用params
private
String
qq
=
""
;
//已废弃,请使用params
private
String
uid
=
""
;
private
boolean
waitAudit
=
false
;
//是否等待审核, 如果返回true,表示此订单需要审核,审核通过后才会继续下去。 如果返回false表示此订单无须审核,会直接继续兑换流程
private
String
ip
=
""
;
//用户兑换时使用的ip地址,有可能为空
private
String
params
=
""
;
//参数,根据不同的type,有不同的含义,参见在线文档
private
String
transfer
=
""
;
public
Map
<
String
,
String
>
toRequestMap
(
String
appSecret
){
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"credits"
,
credits
+
""
);
map
.
put
(
"description"
,
description
);
map
.
put
(
"uid"
,
uid
);
map
.
put
(
"appKey"
,
appKey
);
map
.
put
(
"waitAudit"
,
waitAudit
+
""
);
map
.
put
(
"appSecret"
,
appSecret
);
map
.
put
(
"timestamp"
,
timestamp
.
getTime
()+
""
);
map
.
put
(
"orderNum"
,
orderNum
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"facePrice"
,
facePrice
+
""
);
map
.
put
(
"actualPrice"
,
actualPrice
+
""
);
map
.
put
(
"ip"
,
ip
);
map
.
put
(
"params"
,
params
);
putIfNotEmpty
(
map
,
"itemCode"
,
itemCode
);
putIfNotEmpty
(
map
,
"transfer"
,
transfer
);
putIfNotEmpty
(
map
,
"qq"
,
qq
);
putIfNotEmpty
(
map
,
"alipay"
,
alipay
);
putIfNotEmpty
(
map
,
"phone"
,
phone
);
String
sign
=
SignTool
.
sign
(
map
);
map
.
remove
(
"appSecret"
);
map
.
put
(
"sign"
,
sign
);
return
map
;
}
private
void
putIfNotEmpty
(
Map
<
String
,
String
>
map
,
String
key
,
String
value
){
if
(
value
==
null
||
value
.
length
()==
0
){
return
;
}
map
.
put
(
key
,
value
);
}
public
Long
getCredits
()
{
return
credits
;
}
public
void
setCredits
(
Long
credits
)
{
this
.
credits
=
credits
;
}
public
String
getItemCode
()
{
return
itemCode
;
}
public
void
setItemCode
(
String
itemCode
)
{
this
.
itemCode
=
itemCode
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getAppKey
()
{
return
appKey
;
}
public
void
setAppKey
(
String
appKey
)
{
this
.
appKey
=
appKey
;
}
public
Date
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
Date
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
public
String
getUid
()
{
return
uid
;
}
public
void
setUid
(
String
uid
)
{
this
.
uid
=
uid
;
}
public
String
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
String
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
boolean
isWaitAudit
()
{
return
waitAudit
;
}
public
void
setWaitAudit
(
boolean
waitAudit
)
{
this
.
waitAudit
=
waitAudit
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Integer
getFacePrice
()
{
return
facePrice
;
}
public
void
setFacePrice
(
Integer
facePrice
)
{
this
.
facePrice
=
facePrice
;
}
public
Integer
getActualPrice
()
{
return
actualPrice
;
}
public
void
setActualPrice
(
Integer
actualPrice
)
{
this
.
actualPrice
=
actualPrice
;
}
public
String
getAlipay
()
{
return
alipay
;
}
public
void
setAlipay
(
String
alipay
)
{
this
.
alipay
=
alipay
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getQq
()
{
return
qq
;
}
public
void
setQq
(
String
qq
)
{
this
.
qq
=
qq
;
}
public
String
getIp
()
{
return
ip
;
}
public
void
setIp
(
String
ip
)
{
this
.
ip
=
ip
;
}
public
String
getParams
()
{
return
params
;
}
public
void
setParams
(
String
params
)
{
this
.
params
=
params
;
}
public
String
getTransfer
()
{
return
transfer
;
}
public
void
setTransfer
(
String
transfer
)
{
this
.
transfer
=
transfer
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/CreditNeedAuditParams.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
cn.com.duiba.credits.sdk.SignTool
;
public
class
CreditNeedAuditParams
{
private
String
appKey
;
private
String
bizId
=
""
;
private
Date
timestamp
;
public
CreditNeedAuditParams
(){
}
public
String
getBizId
()
{
return
bizId
;
}
public
void
setBizId
(
String
bizId
)
{
this
.
bizId
=
bizId
;
}
public
Date
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
Date
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
public
String
getAppKey
()
{
return
appKey
;
}
public
void
setAppKey
(
String
appKey
)
{
this
.
appKey
=
appKey
;
}
public
Map
<
String
,
String
>
toRequestMap
(
String
appSecret
){
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"bizId"
,
bizId
+
""
);
map
.
put
(
"appKey"
,
appKey
+
""
);
map
.
put
(
"appSecret"
,
appSecret
+
""
);
map
.
put
(
"timestamp"
,
timestamp
.
getTime
()+
""
);
String
sign
=
SignTool
.
sign
(
map
);
map
.
remove
(
"appSecret"
);
map
.
put
(
"sign"
,
sign
);
return
map
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/CreditNotifyParams.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
cn.com.duiba.credits.sdk.SignTool
;
public
class
CreditNotifyParams
{
private
boolean
success
;
private
String
bizId
=
""
;
private
String
errorMessage
=
""
;
private
String
orderNum
=
""
;
private
Date
timestamp
=
new
Date
();
private
String
appKey
;
private
String
uid
=
""
;
public
boolean
isSuccess
()
{
return
success
;
}
public
void
setSuccess
(
boolean
success
)
{
this
.
success
=
success
;
}
public
String
getErrorMessage
()
{
return
errorMessage
;
}
public
void
setErrorMessage
(
String
errorMessage
)
{
this
.
errorMessage
=
errorMessage
;
}
public
String
getBizId
()
{
return
bizId
;
}
public
void
setBizId
(
String
bizId
)
{
this
.
bizId
=
bizId
;
}
public
Date
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
Date
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
public
String
getAppKey
()
{
return
appKey
;
}
public
void
setAppKey
(
String
appKey
)
{
this
.
appKey
=
appKey
;
}
public
Map
<
String
,
String
>
toRequestMap
(
String
appSecret
){
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"success"
,
success
+
""
);
map
.
put
(
"errorMessage"
,
getString
(
errorMessage
));
map
.
put
(
"bizId"
,
getString
(
bizId
));
map
.
put
(
"appKey"
,
getString
(
appKey
));
map
.
put
(
"appSecret"
,
getString
(
appSecret
));
map
.
put
(
"timestamp"
,
getString
(
timestamp
.
getTime
()));
map
.
put
(
"uid"
,
getString
(
uid
));
map
.
put
(
"orderNum"
,
getString
(
orderNum
));
String
sign
=
SignTool
.
sign
(
map
);
map
.
remove
(
"appSecret"
);
map
.
put
(
"sign"
,
sign
);
return
map
;
}
private
String
getString
(
Object
o
){
if
(
o
==
null
){
return
""
;
}
return
o
.
toString
();
}
public
void
setUid
(
String
uid
)
{
this
.
uid
=
uid
;
}
public
String
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
String
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/ExpressInfo.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
/**
* 构建开发者批量发货的发货信息
* @author Yang-yudong
*
*/
public
class
ExpressInfo
{
private
String
orderNum
;
//兑吧订单号
private
String
expressNum
;
//快递单号
private
String
expressType
;
//快递类型
public
String
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
String
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
String
getExpressNum
()
{
return
expressNum
;
}
public
void
setExpressNum
(
String
expressNum
)
{
this
.
expressNum
=
expressNum
;
}
public
String
getExpressType
()
{
return
expressType
;
}
public
void
setExpressType
(
String
expressType
)
{
this
.
expressType
=
expressType
;
}
/**
* 构建发货信息的toString方法
*/
@Override
public
String
toString
()
{
return
orderNum
+
"|"
+
expressType
+
"|"
+
expressNum
+
","
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/entity/VirtualParams.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.entity
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
cn.com.duiba.credits.sdk.SignTool
;
/**
*
* @author yangyudong
*
*/
public
class
VirtualParams
{
private
String
appKey
;
//应用标示appKey
private
Date
timestamp
;
//时间戳,当前时间毫秒值
private
Long
credits
;
//积分
private
String
supplierBizId
=
""
;
//充值流水号
private
String
uid
=
""
;
//用户id
private
String
description
=
""
;
//虚拟商品标示符
private
String
orderNum
=
""
;
//兑吧订单号
private
String
account
=
""
;
//虚拟商品充值账号,非必须参数
public
String
getAccount
()
{
return
account
;
}
public
void
setAccount
(
String
account
)
{
this
.
account
=
account
;
}
private
String
params
=
""
;
public
Long
getCredits
()
{
return
credits
;
}
public
void
setCredits
(
Long
credits
)
{
this
.
credits
=
credits
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getAppKey
()
{
return
appKey
;
}
public
void
setAppKey
(
String
appKey
)
{
this
.
appKey
=
appKey
;
}
public
Date
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
Date
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
public
Map
<
String
,
String
>
toRequestMap
(
String
appSecret
){
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"description"
,
description
);
map
.
put
(
"uid"
,
uid
);
map
.
put
(
"appKey"
,
appKey
);
map
.
put
(
"supplierBizId"
,
supplierBizId
);
map
.
put
(
"appSecret"
,
appSecret
);
map
.
put
(
"timestamp"
,
timestamp
.
getTime
()+
""
);
map
.
put
(
"orderNum"
,
orderNum
);
map
.
put
(
"params"
,
params
);
String
sign
=
SignTool
.
sign
(
map
);
map
.
remove
(
"appSecret"
);
map
.
put
(
"sign"
,
sign
);
return
map
;
}
public
String
getUid
()
{
return
uid
;
}
public
void
setUid
(
String
uid
)
{
this
.
uid
=
uid
;
}
public
String
getOrderNum
()
{
return
orderNum
;
}
public
void
setOrderNum
(
String
orderNum
)
{
this
.
orderNum
=
orderNum
;
}
public
String
getSupplierBizId
()
{
return
supplierBizId
;
}
public
void
setSupplierBizId
(
String
supplierBizId
)
{
this
.
supplierBizId
=
supplierBizId
;
}
public
String
getParams
()
{
return
params
;
}
public
void
setParams
(
String
params
)
{
this
.
params
=
params
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/result/AddCreditResult.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.result
;
public
class
AddCreditResult
{
private
boolean
success
;
private
String
errorMessage
=
""
;
private
String
bizId
=
""
;
private
Long
credits
=-
1L
;
//用户积分余额
public
AddCreditResult
(
boolean
success
){
this
.
success
=
success
;
}
public
String
toString
(){
if
(
success
){
return
"{'status':'ok','errorMessage':'','bizId':'"
+
bizId
+
"','credits':'"
+
credits
+
"'}"
;
}
else
{
return
"{'status':'fail','errorMessage':'"
+
errorMessage
+
"','credits':'"
+
credits
+
"'}"
;
}
}
public
String
getErrorMessage
()
{
return
errorMessage
;
}
public
void
setErrorMessage
(
String
errorMessage
)
{
this
.
errorMessage
=
errorMessage
;
}
public
String
getBizId
()
{
return
bizId
;
}
public
void
setBizId
(
String
bizId
)
{
this
.
bizId
=
bizId
;
}
public
Long
getCredits
()
{
return
credits
;
}
public
void
setCredits
(
Long
credits
)
{
this
.
credits
=
credits
;
}
}
JeeSpringCloud/src/main/java/cn/com/duiba/credits/sdk/result/CreditConsumeResult.java
deleted
100644 → 0
View file @
b6becbcd
package
cn.com.duiba.credits.sdk.result
;
public
class
CreditConsumeResult
{
private
boolean
success
;
private
String
errorMessage
=
""
;
private
String
bizId
=
""
;
private
Long
credits
=-
1L
;
//用户积分余额
public
CreditConsumeResult
(
boolean
success
){
this
.
success
=
success
;
}
public
String
toString
(){
if
(
success
){
return
"{'status':'ok','errorMessage':'','bizId':'"
+
bizId
+
"','credits':'"
+
credits
+
"'}"
;
}
else
{
return
"{'status':'fail','errorMessage':'"
+
errorMessage
+
"','credits':'"
+
credits
+
"'}"
;
}
}
public
String
getErrorMessage
()
{
return
errorMessage
;
}
public
void
setErrorMessage
(
String
errorMessage
)
{
this
.
errorMessage
=
errorMessage
;
}
public
String
getBizId
()
{
return
bizId
;
}
public
void
setBizId
(
String
bizId
)
{
this
.
bizId
=
bizId
;
}
public
Long
getCredits
()
{
return
credits
;
}
public
void
setCredits
(
Long
credits
)
{
this
.
credits
=
credits
;
}
}
Prev
1
2
3
4
5
…
20
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