Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
dm_project
Commits
8510edc7
Commit
8510edc7
authored
Dec 02, 2020
by
zhangc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit api网关代码
parent
1ea71617
Changes
84
Show whitespace changes
Inline
Side-by-side
Showing
84 changed files
with
395 additions
and
1075 deletions
+395
-1075
pom.xml
jz-dm-apigateway/pom.xml
+33
-72
ApiGatewayApplication.java
...ateway/src/main/java/com/jz/dm/ApiGatewayApplication.java
+24
-0
GatewayException.java
...ain/java/com/jz/dm/common/exception/GatewayException.java
+2
-2
MessageDigestException.java
...va/com/jz/dm/common/exception/MessageDigestException.java
+2
-2
NotifyException.java
...main/java/com/jz/dm/common/exception/NotifyException.java
+2
-2
OpenApiException.java
...ain/java/com/jz/dm/common/exception/OpenApiException.java
+2
-2
SecretException.java
...main/java/com/jz/dm/common/exception/SecretException.java
+2
-2
SignatureException.java
...n/java/com/jz/dm/common/exception/SignatureException.java
+2
-2
ArrayUtil.java
...ateway/src/main/java/com/jz/dm/common/util/ArrayUtil.java
+1
-1
Base64.java
...pigateway/src/main/java/com/jz/dm/common/util/Base64.java
+1
-1
ClassUtil.java
...ateway/src/main/java/com/jz/dm/common/util/ClassUtil.java
+1
-1
Constants.java
...ateway/src/main/java/com/jz/dm/common/util/Constants.java
+1
-1
HddHashMap.java
...teway/src/main/java/com/jz/dm/common/util/HddHashMap.java
+1
-1
JSONWriter.java
...teway/src/main/java/com/jz/dm/common/util/JSONWriter.java
+1
-1
JsonUtil.java
...gateway/src/main/java/com/jz/dm/common/util/JsonUtil.java
+1
-1
LogUtil.java
...igateway/src/main/java/com/jz/dm/common/util/LogUtil.java
+1
-1
NotifyResultCode.java
...src/main/java/com/jz/dm/common/util/NotifyResultCode.java
+1
-1
ObjectUtil.java
...teway/src/main/java/com/jz/dm/common/util/ObjectUtil.java
+1
-1
OpenApiRequest.java
...y/src/main/java/com/jz/dm/common/util/OpenApiRequest.java
+2
-2
OpenApiResponse.java
.../src/main/java/com/jz/dm/common/util/OpenApiResponse.java
+1
-1
OpenApiResultCode.java
...rc/main/java/com/jz/dm/common/util/OpenApiResultCode.java
+1
-1
RSA.java
...m-apigateway/src/main/java/com/jz/dm/common/util/RSA.java
+3
-2
RSAUtils.java
...gateway/src/main/java/com/jz/dm/common/util/RSAUtils.java
+4
-2
ResultCode.java
...teway/src/main/java/com/jz/dm/common/util/ResultCode.java
+1
-1
SignType.java
...gateway/src/main/java/com/jz/dm/common/util/SignType.java
+1
-1
SignatureUtil.java
...ay/src/main/java/com/jz/dm/common/util/SignatureUtil.java
+3
-3
StreamUtil.java
...teway/src/main/java/com/jz/dm/common/util/StreamUtil.java
+1
-1
StringUtil.java
...teway/src/main/java/com/jz/dm/common/util/StringUtil.java
+1
-1
TtpayUtils.java
...teway/src/main/java/com/jz/dm/common/util/TtpayUtils.java
+1
-1
WebUtils.java
...gateway/src/main/java/com/jz/dm/common/util/WebUtils.java
+1
-1
MybatisPlusConfig.java
...way/src/main/java/com/jz/dm/config/MybatisPlusConfig.java
+34
-0
Constants.java
...pigateway/src/main/java/com/jz/dm/constant/Constants.java
+1
-1
LoggingConstants.java
...ay/src/main/java/com/jz/dm/constant/LoggingConstants.java
+1
-1
GatewayController.java
...src/main/java/com/jz/dm/controller/GatewayController.java
+6
-6
AbstractFilter.java
...ateway/src/main/java/com/jz/dm/filter/AbstractFilter.java
+4
-6
CheckArgsFilter.java
...teway/src/main/java/com/jz/dm/filter/CheckArgsFilter.java
+9
-9
CheckPostSizeFilter.java
...y/src/main/java/com/jz/dm/filter/CheckPostSizeFilter.java
+8
-8
CheckTimestampFilter.java
.../src/main/java/com/jz/dm/filter/CheckTimestampFilter.java
+7
-8
Filter.java
jz-dm-apigateway/src/main/java/com/jz/dm/filter/Filter.java
+3
-3
FilterChain.java
...pigateway/src/main/java/com/jz/dm/filter/FilterChain.java
+4
-3
FilterChainFactory.java
...ay/src/main/java/com/jz/dm/filter/FilterChainFactory.java
+1
-1
FilterChainImpl.java
...teway/src/main/java/com/jz/dm/filter/FilterChainImpl.java
+7
-7
FilterFactory.java
...gateway/src/main/java/com/jz/dm/filter/FilterFactory.java
+1
-1
InvokeRouteFilter.java
...way/src/main/java/com/jz/dm/filter/InvokeRouteFilter.java
+9
-9
SignatureFilter.java
...teway/src/main/java/com/jz/dm/filter/SignatureFilter.java
+8
-9
VerifySignFilter.java
...eway/src/main/java/com/jz/dm/filter/VerifySignFilter.java
+9
-7
ApiGatewayApplication.java
...rc/main/java/com/jz/dm/gateway/ApiGatewayApplication.java
+0
-23
DefaultOpenApiDispatcher.java
...main/java/com/jz/dm/gateway/DefaultOpenApiDispatcher.java
+9
-8
GatewayService.java
...teway/src/main/java/com/jz/dm/gateway/GatewayService.java
+14
-0
OpenApiDispatcher.java
...ay/src/main/java/com/jz/dm/gateway/OpenApiDispatcher.java
+2
-2
OpenApiService.java
...teway/src/main/java/com/jz/dm/gateway/OpenApiService.java
+4
-3
DatabaseConfig.java
...rc/main/java/com/jz/dm/gateway/config/DatabaseConfig.java
+0
-254
ApiWhiteServiceImpl.java
...main/java/com/jz/dm/gateway/impl/ApiWhiteServiceImpl.java
+1
-9
GatewayServiceImpl.java
.../main/java/com/jz/dm/gateway/impl/GatewayServiceImpl.java
+8
-7
DataGoodsApiDao.java
...c/main/java/com/jz/dm/gateway/mapper/DataGoodsApiDao.java
+0
-18
DataGoodsApiParamsDao.java
.../java/com/jz/dm/gateway/mapper/DataGoodsApiParamsDao.java
+0
-16
Test.java
...gateway/src/main/java/com/jz/dm/gateway/service/Test.java
+0
-14
DispatchContext.java
...ateway/src/main/java/com/jz/dm/model/DispatchContext.java
+1
-1
GatewayRequest.java
...gateway/src/main/java/com/jz/dm/model/GatewayRequest.java
+3
-2
GatewayResponse.java
...ateway/src/main/java/com/jz/dm/model/GatewayResponse.java
+1
-1
OpenApi.java
jz-dm-apigateway/src/main/java/com/jz/dm/model/OpenApi.java
+3
-2
RequestContext.java
...gateway/src/main/java/com/jz/dm/model/RequestContext.java
+1
-1
Format.java
...pigateway/src/main/java/com/jz/dm/model/enums/Format.java
+1
-1
GatewayResultCode.java
...rc/main/java/com/jz/dm/model/enums/GatewayResultCode.java
+2
-2
RouteType.java
...ateway/src/main/java/com/jz/dm/model/enums/RouteType.java
+1
-1
Md5.java
...pigateway/src/main/java/com/jz/dm/model/signtype/Md5.java
+1
-1
SHA1WithRSA.java
...y/src/main/java/com/jz/dm/model/signtype/SHA1WithRSA.java
+2
-2
SHA256WithRSA.java
...src/main/java/com/jz/dm/model/signtype/SHA256WithRSA.java
+3
-3
AccountAddService.java
...ay/src/main/java/com/jz/dm/service/AccountAddService.java
+24
-0
ParamName.java
...way/src/main/java/com/jz/dm/web/annotation/ParamName.java
+1
-1
ParamNameAnnotationBinder.java
.../java/com/jz/dm/web/binder/ParamNameAnnotationBinder.java
+1
-1
ParamNameAnnotationResolver.java
...ava/com/jz/dm/web/binder/ParamNameAnnotationResolver.java
+3
-2
application-dev.yml
jz-dm-apigateway/src/main/resources/application-dev.yml
+0
-61
application-pro.yml
jz-dm-apigateway/src/main/resources/application-pro.yml
+0
-33
application-test.yml
jz-dm-apigateway/src/main/resources/application-test.yml
+80
-0
application.yml
jz-dm-apigateway/src/main/resources/application.yml
+14
-27
logback.xml
jz-dm-apigateway/src/main/resources/logback.xml
+0
-131
DataGoodsApiDao.xml
...-apigateway/src/main/resources/mapper/DataGoodsApiDao.xml
+0
-28
DataGoodsApiParamsDao.xml
...teway/src/main/resources/mapper/DataGoodsApiParamsDao.xml
+0
-20
Property.java
...-apigateway/src/test/java/com/jz/dm/gateway/Property.java
+1
-1
SpringTestCase.java
...teway/src/test/java/com/jz/dm/gateway/SpringTestCase.java
+1
-1
TestApplicationContextInitializer.java
.../com/jz/dm/gateway/TestApplicationContextInitializer.java
+2
-2
PushSdkLocalhostTest1.java
...pigateway/src/test/java/domian/PushSdkLocalhostTest1.java
+0
-170
GatewayTest.java
...-apigateway/src/test/java/domian/TestApi/GatewayTest.java
+0
-36
No files found.
jz-dm-apigateway/pom.xml
View file @
8510edc7
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<?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>
<parent>
<groupId>
com.jz.dm
</groupId>
<artifactId>
jz-dm-parent
</artifactId>
<groupId>
com.jz.dm
</groupId>
<version>
0.0.1-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
jz-dm-apigateway
</artifactId>
<name>
jz-dm-apigateway
</name>
<description>
jz-dm-apigateway
</description>
<dependencies>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.5.6
</version>
</dependency>
<dependency>
<groupId>
org.springframework.session
</groupId>
<artifactId>
spring-session
</artifactId>
<version>
1.3.0.RELEASE
</version>
<scope>
compile
</scope>
</dependency>
<!-- spring-boot 相关依赖 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<!-- spring-boot -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-freemarker
</artifactId>
</dependency>
<!--Redis集中存储Session-->
<dependency>
<groupId>
org.springframework.session
</groupId>
<artifactId>
spring-session-data-redis
</artifactId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<!-- fastjson -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- spring boot 和mybatis -->
<!--<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>-->
<!-- mybatis plus -->
<!--mybatis-plus自动的维护了mybatis以及mybatis-spring的依赖,
在springboot中这三者不能同时的出现,避免版本的冲突,表示:跳进过这个坑-->
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.1.1
</version>
</dependency>
<!--mybatis分页插件 -->
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper
</artifactId>
</dependency>
<!-- druid数据库连接池 -->
<!-- 引入Druid依赖,阿里巴巴所提供的数据源 -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.0.29
</version>
</dependency>
<!--
mysql连接
-->
<!--
提供mysql驱动
-->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.38
</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.5.6
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter
</artifactId>
<version>
RELEASE
</version>
<scope>
test
</scope>
</dependency>
<!-- swagger2接口文档 -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
swagger-bootstrap-ui
</artifactId>
</dependency>
<!--工具类-->
<!--lang3工具类-->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<!--fastJson包-->
<dependency>
<groupId>
com.jz.common
</groupId>
<artifactId>
jz-dm-common
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.16
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
jz-dm-apigateway/src/main/java/com/jz/dm/ApiGatewayApplication.java
0 → 100644
View file @
8510edc7
package
com
.
jz
.
dm
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm
* @PROJECT_NAME: jz-dm-parent
* @NAME: ApiGatewayApplication
* @USER: key
* @DATE: 2020-12-2/16:03
* @DAY_NAME_SHORT: 周三
* @Description:
**/
@SpringBootApplication
//@ComponentScan(basePackages = {"com.jz"})
@MapperScan
(
"com.jz.dm.mapper"
)
public
class
ApiGatewayApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ApiGatewayApplication
.
class
,
args
);
}
}
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/exception/GatewayException.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/exception/GatewayException.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
exception
;
package
com
.
jz
.
dm
.
common
.
exception
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.common.util.ResultCode
;
/**
* 网关异常
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/exception/MessageDigestException.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/exception/MessageDigestException.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
exception
;
package
com
.
jz
.
dm
.
common
.
exception
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.common.util.ResultCode
;
/**
* 信息摘要异常
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/exception/NotifyException.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/exception/NotifyException.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
exception
;
package
com
.
jz
.
dm
.
common
.
exception
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.common.util.ResultCode
;
/**
* 通知异常
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/exception/OpenApiException.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/exception/OpenApiException.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
exception
;
package
com
.
jz
.
dm
.
common
.
exception
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.common.util.ResultCode
;
/**
* openapi异常
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/exception/SecretException.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/exception/SecretException.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
exception
;
package
com
.
jz
.
dm
.
common
.
exception
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.common.util.ResultCode
;
/**
* 加密异常
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/exception/SignatureException.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/exception/SignatureException.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
exception
;
package
com
.
jz
.
dm
.
common
.
exception
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.common.util.ResultCode
;
/**
* 签名异常
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/ArrayUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/ArrayUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/Base64.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/Base64.java
View file @
8510edc7
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
org.apache.commons.codec.BinaryDecoder
;
import
org.apache.commons.codec.BinaryEncoder
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/ClassUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/ClassUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.lang.reflect.Array
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/Constants.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/Constants.java
View file @
8510edc7
/**
* Copyright (c) 2011-2014 All Rights Reserved.
*/
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
/**
* @author Admin
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/HddHashMap.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/HddHashMap.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.util.HashMap
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/JSONWriter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/JSONWriter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.beans.BeanInfo
;
import
java.beans.IntrospectionException
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/JsonUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/JsonUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/LogUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/LogUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
org.slf4j.Logger
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/NotifyResultCode.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/NotifyResultCode.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/ObjectUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/ObjectUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.io.Serializable
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/OpenApiRequest.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/OpenApiRequest.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.dm.
gateway.
common.exception.OpenApiException
;
import
com.jz.dm.common.exception.OpenApiException
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/OpenApiResponse.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/OpenApiResponse.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/OpenApiResultCode.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/OpenApiResultCode.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/RSA.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/RSA.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
org.apache.commons.codec.binary.Base64
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.apache.commons.codec.binary.Base64
;
import
javax.crypto.Cipher
;
import
java.io.ByteArrayOutputStream
;
import
java.io.UnsupportedEncodingException
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/RSAUtils.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/RSAUtils.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
org.apache.tomcat.util.http.fileupload.IOUtils
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.tomcat.util.http.fileupload.IOUtils
;
import
javax.crypto.Cipher
;
import
java.io.ByteArrayOutputStream
;
import
java.security.*
;
...
...
@@ -12,6 +13,7 @@ import java.security.spec.PKCS8EncodedKeySpec;
import
java.security.spec.X509EncodedKeySpec
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
RSAUtils
{
public
static
final
String
CHARSET
=
"UTF-8"
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/ResultCode.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/ResultCode.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
/**
* 结果码
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/SignType.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/SignType.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
/**
* 签名类型
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/SignatureUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/SignatureUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
com.alibaba.fastjson.PropertyNamingStrategy
;
import
com.jz.dm.
gateway.
common.exception.SignatureException
;
import
com.jz.dm.
gateway.
model.signtype.Md5
;
import
com.jz.dm.common.exception.SignatureException
;
import
com.jz.dm.model.signtype.Md5
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/StreamUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/StreamUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.io.*
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/StringUtil.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/StringUtil.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
java.util.ArrayList
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/TtpayUtils.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/TtpayUtils.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
org.apache.commons.lang3.StringUtils
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
common/util/WebUtils.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/common/util/WebUtils.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
common
.
util
;
package
com
.
jz
.
dm
.
common
.
util
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.*
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
config/MybatisPlusConfig.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/config/MybatisPlusConfig.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
config
;
package
com
.
jz
.
dm
.
config
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize
;
...
...
@@ -15,20 +15,20 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
*/
@EnableTransactionManagement
@Configuration
@MapperScan
(
"com.jz.dm.
gateway.
mapper"
)
@MapperScan
(
"com.jz.dm.mapper"
)
public
class
MybatisPlusConfig
{
@Bean
public
PaginationInterceptor
paginationInterceptor
()
{
PaginationInterceptor
paginationInterceptor
=
new
PaginationInterceptor
();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
// paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
paginationInterceptor
.
setLimit
(
500
);
// 开启 count 的 join 优化,只针对部分 left join
paginationInterceptor
.
setCountSqlParser
(
new
JsqlParserCountOptimize
(
true
));
return
paginationInterceptor
;
}
//
@Bean
//
public PaginationInterceptor paginationInterceptor() {
//
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
//
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
//
// paginationInterceptor.setOverflow(false);
//
// 设置最大单页限制数量,默认 500 条,-1 不受限制
//
paginationInterceptor.setLimit(500);
//
// 开启 count 的 join 优化,只针对部分 left join
//
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
//
return paginationInterceptor;
//
}
}
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
constant/Constants.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/constant/Constants.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
constant
;
package
com
.
jz
.
dm
.
constant
;
/**
* 常量
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
constant/LoggingConstants.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/constant/LoggingConstants.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
constant
;
package
com
.
jz
.
dm
.
constant
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
controller/GatewayController.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/controller/GatewayController.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
controller
;
package
com
.
jz
.
dm
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.PropertyNamingStrategy
;
import
com.jz.dm.
gateway.
common.util.JsonUtil
;
import
com.jz.dm.gateway.
gateway.
GatewayService
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.
gateway.
model.RequestContext
;
import
com.jz.dm.common.util.JsonUtil
;
import
com.jz.dm.gateway.GatewayService
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.RequestContext
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/AbstractFilter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/AbstractFilter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.
gateway.
model.RequestContext
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.RequestContext
;
import
org.springframework.core.Ordered
;
/**
* 抽象过滤器
* @author key
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/CheckArgsFilter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/CheckArgsFilter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.
gateway.
common.exception.GatewayException
;
import
com.jz.dm.
gateway.
common.util.SignType
;
import
com.jz.dm.
gateway.
common.util.StringUtil
;
import
com.jz.dm.
gateway.
constant.Constants
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.
gateway.
model.enums.Format
;
import
com.jz.dm.
gateway.
model.enums.GatewayResultCode
;
import
com.jz.dm.common.exception.GatewayException
;
import
com.jz.dm.common.util.SignType
;
import
com.jz.dm.common.util.StringUtil
;
import
com.jz.dm.constant.Constants
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.enums.Format
;
import
com.jz.dm.model.enums.GatewayResultCode
;
import
org.springframework.stereotype.Component
;
import
java.nio.charset.Charset
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/CheckPostSizeFilter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/CheckPostSizeFilter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
import
com.jz.dm.
gateway.
common.exception.GatewayException
;
import
com.jz.dm.
gateway.
constant.Constants
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.
gateway.
model.RequestContext
;
import
com.jz.dm.
gateway.
model.enums.GatewayResultCode
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.common.exception.GatewayException
;
import
com.jz.dm.constant.Constants
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.RequestContext
;
import
com.jz.dm.model.enums.GatewayResultCode
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/CheckTimestampFilter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/CheckTimestampFilter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
import
com.jz.dm.gateway.common.exception.GatewayException
;
import
com.jz.dm.gateway.constant.Constants
;
import
com.jz.dm.gateway.model.GatewayRequest
;
import
com.jz.dm.gateway.model.GatewayResponse
;
import
com.jz.dm.gateway.model.enums.GatewayResultCode
;
import
org.springframework.beans.factory.annotation.Value
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.common.exception.GatewayException
;
import
com.jz.dm.constant.Constants
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.enums.GatewayResultCode
;
import
org.springframework.stereotype.Component
;
/**
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/Filter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/Filter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
/**
* 过滤器
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/FilterChain.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/FilterChain.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.gateway.model.GatewayRequest
;
import
com.jz.dm.gateway.model.GatewayResponse
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
/**
* 请求过滤链
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/FilterChainFactory.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/FilterChainFactory.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/FilterChainImpl.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/FilterChainImpl.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.
gateway.
common.exception.OpenApiException
;
import
com.jz.dm.
gateway.
common.util.LogUtil
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.
gateway.
model.enums.GatewayResultCode
;
import
com.jz.dm.common.exception.OpenApiException
;
import
com.jz.dm.common.util.LogUtil
;
import
com.jz.dm.common.util.ResultCode
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.enums.GatewayResultCode
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/FilterFactory.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/FilterFactory.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/InvokeRouteFilter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/InvokeRouteFilter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.dm.
gateway.
common.exception.GatewayException
;
import
com.jz.dm.
gateway.
common.util.LogUtil
;
import
com.jz.dm.
gateway.
constant.Constants
;
import
com.jz.dm.
gateway.
constant.LoggingConstants
;
import
com.jz.dm.gateway.
gateway.
DefaultOpenApiDispatcher
;
import
com.jz.dm.
gateway.model.*
;
import
com.jz.dm.
gateway.model.enums.GatewayResultCod
e
;
import
com.jz.dm.
gateway.model.enums.RouteType
;
import
com.jz.dm.common.exception.GatewayException
;
import
com.jz.dm.common.util.LogUtil
;
import
com.jz.dm.constant.Constants
;
import
com.jz.dm.constant.LoggingConstants
;
import
com.jz.dm.gateway.DefaultOpenApiDispatcher
;
import
com.jz.dm.
model.enums.GatewayResultCode
;
import
com.jz.dm.
model.enums.RouteTyp
e
;
import
com.jz.dm.
model.*
;
import
org.slf4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/SignatureFilter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/SignatureFilter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
package
com
.
jz
.
dm
.
filter
;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.PropertyNamingStrategy
;
import
com.jz.dm.gateway.common.util.StringUtil
;
import
com.jz.dm.gateway.common.exception.SignatureException
;
import
com.jz.dm.gateway.common.util.*
;
import
com.jz.dm.gateway.model.GatewayRequest
;
import
com.jz.dm.gateway.model.GatewayResponse
;
import
com.jz.dm.gateway.model.enums.GatewayResultCode
;
import
com.jz.dm.common.util.*
;
import
com.jz.dm.common.exception.SignatureException
;
import
com.jz.dm.common.util.StringUtil
;
import
com.jz.dm.constant.Constants
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.enums.GatewayResultCode
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.jz.dm.gateway.constant.Constants
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
filter/VerifySignFilter.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/filter/VerifySignFilter.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
filter
;
import
com.jz.dm.gateway.common.util.HddHashMap
;
import
com.jz.dm.gateway.common.util.RSAUtils
;
import
com.jz.dm.gateway.constant.Constants
;
import
com.jz.dm.gateway.model.*
;
import
com.jz.dm.gateway.model.enums.RouteType
;
package
com
.
jz
.
dm
.
filter
;
import
com.jz.dm.common.util.HddHashMap
;
import
com.jz.dm.common.util.RSAUtils
;
import
com.jz.dm.constant.Constants
;
import
com.jz.dm.model.enums.RouteType
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
com.jz.dm.model.OpenApi
;
import
com.jz.dm.model.RequestContext
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.security.interfaces.RSAPublicKey
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/ApiGatewayApplication.java
deleted
100644 → 0
View file @
1ea71617
package
com
.
jz
.
dm
.
gateway
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.context.annotation.ComponentScan
;
/**
* @author key
*/
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
})
@ComponentScan
(
basePackages
=
{
"com.jz.dm"
})
@MapperScan
(
"com.jz.dm.gateway.mapper"
)
public
class
ApiGatewayApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ApiGatewayApplication
.
class
,
args
);
}
}
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/
gateway/
DefaultOpenApiDispatcher.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/DefaultOpenApiDispatcher.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
gateway
;
package
com
.
jz
.
dm
.
gateway
;
import
com.alibaba.fastjson.JSON
;
import
com.jz.dm.
gateway.common.util.StringUtil
;
import
com.jz.dm.
gateway.common.exception.OpenApiException
;
import
com.jz.dm.
gateway.common.util.OpenApiRequest
;
import
com.jz.dm.
gateway.common.util.OpenApiRespons
e
;
import
com.jz.dm.
gateway.common.util.OpenApiResultCode
;
import
com.jz.dm.
gateway.
model.DispatchContext
;
import
com.jz.dm.
common.exception.OpenApiException
;
import
com.jz.dm.
common.util.OpenApiRequest
;
import
com.jz.dm.
common.util.OpenApiResponse
;
import
com.jz.dm.
common.util.OpenApiResultCod
e
;
import
com.jz.dm.
common.util.StringUtil
;
import
com.jz.dm.model.DispatchContext
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
...
...
@@ -19,8 +19,9 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* 默认openapi分发器
*
* @author key
*/
@Component
@Component
(
"defaultOpenApiDispatcher"
)
public
class
DefaultOpenApiDispatcher
implements
OpenApiDispatcher
{
private
static
final
Logger
LOGGER
=
LoggerFactory
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/
gateway/
GatewayService.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/GatewayService.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
gateway
;
package
com
.
jz
.
dm
.
gateway
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
/**
* GatewayService
* @author key
*/
public
interface
GatewayService
{
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/
gateway/
OpenApiDispatcher.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/OpenApiDispatcher.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
gateway
;
package
com
.
jz
.
dm
.
gateway
;
import
com.jz.dm.
gateway.
model.DispatchContext
;
import
com.jz.dm.model.DispatchContext
;
/**
* openapi分发器
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/
gateway/
OpenApiService.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/OpenApiService.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
gateway
;
package
com
.
jz
.
dm
.
gateway
;
import
com.jz.dm.gateway.common.util.OpenApiRequest
;
import
com.jz.dm.gateway.common.util.OpenApiResponse
;
import
com.jz.dm.common.util.OpenApiRequest
;
import
com.jz.dm.common.util.OpenApiResponse
;
/**
* openapi服务
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/config/DatabaseConfig.java
deleted
100644 → 0
View file @
1ea71617
package
com
.
jz
.
dm
.
gateway
.
config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionFactoryBean
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
javax.sql.DataSource
;
import
java.sql.SQLException
;
/**
* @ProjectName zhaxinle
* @Author: zeroJun
* @Date: 2018/8/16 16:49
* @Description: 主数据源配置类
*/
@Configuration
// 前缀为primary.datasource.druid的配置信息
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
@MapperScan
(
basePackages
=
DatabaseConfig
.
PACKAGE
,
sqlSessionFactoryRef
=
"sqlSessionFactory"
)
public
class
DatabaseConfig
{
/**
* dao层的包路径
*/
static
final
String
PACKAGE
=
"com.jz.dm.gateway.mapper"
;
/**
* mapper文件的相对路径
*/
private
static
final
String
MAPPER_LOCATION
=
"classpath:/mapper/*.xml"
;
private
String
filters
;
private
String
url
;
private
String
username
;
private
String
password
;
private
String
driverClassName
;
private
int
initialSize
;
private
int
minIdle
;
private
int
maxActive
;
private
long
maxWait
;
private
long
timeBetweenEvictionRunsMillis
;
private
long
minEvictableIdleTimeMillis
;
private
String
validationQuery
;
private
boolean
testWhileIdle
;
private
boolean
testOnBorrow
;
private
boolean
testOnReturn
;
private
boolean
poolPreparedStatements
;
private
int
maxPoolPreparedStatementPerConnectionSize
;
// 主数据源使用@Primary注解进行标识
//@Primary
@Bean
(
name
=
"dataSource"
)
public
DataSource
dataSource
()
throws
SQLException
{
DruidDataSource
druid
=
new
DruidDataSource
();
// 监控统计拦截的filters
druid
.
setFilters
(
filters
);
// 配置基本属性
druid
.
setDriverClassName
(
driverClassName
);
druid
.
setUsername
(
username
);
druid
.
setPassword
(
password
);
druid
.
setUrl
(
url
);
//初始化时建立物理连接的个数
druid
.
setInitialSize
(
initialSize
);
//最大连接池数量
druid
.
setMaxActive
(
maxActive
);
//最小连接池数量
druid
.
setMinIdle
(
minIdle
);
//获取连接时最大等待时间,单位毫秒。
druid
.
setMaxWait
(
maxWait
);
//间隔多久进行一次检测,检测需要关闭的空闲连接
druid
.
setTimeBetweenEvictionRunsMillis
(
timeBetweenEvictionRunsMillis
);
//一个连接在池中最小生存的时间
druid
.
setMinEvictableIdleTimeMillis
(
minEvictableIdleTimeMillis
);
//用来检测连接是否有效的sql
druid
.
setValidationQuery
(
validationQuery
);
//建议配置为true,不影响性能,并且保证安全性。
druid
.
setTestWhileIdle
(
testWhileIdle
);
//申请连接时执行validationQuery检测连接是否有效
druid
.
setTestOnBorrow
(
testOnBorrow
);
druid
.
setTestOnReturn
(
testOnReturn
);
//是否缓存preparedStatement,也就是PSCache,oracle设为true,mysql设为false。分库分表较多推荐设置为false
druid
.
setPoolPreparedStatements
(
poolPreparedStatements
);
// 打开PSCache时,指定每个连接上PSCache的大小
druid
.
setMaxPoolPreparedStatementPerConnectionSize
(
maxPoolPreparedStatementPerConnectionSize
);
return
druid
;
}
// 创建该数据源的事务管理
@Primary
@Bean
(
name
=
"transactionManager"
)
public
DataSourceTransactionManager
transactionManager
()
throws
SQLException
{
return
new
DataSourceTransactionManager
(
dataSource
());
}
// 创建Mybatis的连接会话工厂实例
@Primary
@Bean
(
name
=
"sqlSessionFactory"
)
public
SqlSessionFactory
sqlSessionFactory
(
@Qualifier
(
"dataSource"
)
DataSource
dataSource
)
throws
Exception
{
final
SqlSessionFactoryBean
sessionFactory
=
new
SqlSessionFactoryBean
();
sessionFactory
.
setDataSource
(
dataSource
);
// 设置数据源bean
sessionFactory
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
()
.
getResources
(
DatabaseConfig
.
MAPPER_LOCATION
));
// 设置mapper文件路径
return
sessionFactory
.
getObject
();
}
public
String
getFilters
()
{
return
filters
;
}
public
void
setFilters
(
String
filters
)
{
this
.
filters
=
filters
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getDriverClassName
()
{
return
driverClassName
;
}
public
void
setDriverClassName
(
String
driverClassName
)
{
this
.
driverClassName
=
driverClassName
;
}
public
int
getInitialSize
()
{
return
initialSize
;
}
public
void
setInitialSize
(
int
initialSize
)
{
this
.
initialSize
=
initialSize
;
}
public
int
getMinIdle
()
{
return
minIdle
;
}
public
void
setMinIdle
(
int
minIdle
)
{
this
.
minIdle
=
minIdle
;
}
public
int
getMaxActive
()
{
return
maxActive
;
}
public
void
setMaxActive
(
int
maxActive
)
{
this
.
maxActive
=
maxActive
;
}
public
long
getMaxWait
()
{
return
maxWait
;
}
public
void
setMaxWait
(
long
maxWait
)
{
this
.
maxWait
=
maxWait
;
}
public
long
getTimeBetweenEvictionRunsMillis
()
{
return
timeBetweenEvictionRunsMillis
;
}
public
void
setTimeBetweenEvictionRunsMillis
(
long
timeBetweenEvictionRunsMillis
)
{
this
.
timeBetweenEvictionRunsMillis
=
timeBetweenEvictionRunsMillis
;
}
public
long
getMinEvictableIdleTimeMillis
()
{
return
minEvictableIdleTimeMillis
;
}
public
void
setMinEvictableIdleTimeMillis
(
long
minEvictableIdleTimeMillis
)
{
this
.
minEvictableIdleTimeMillis
=
minEvictableIdleTimeMillis
;
}
public
String
getValidationQuery
()
{
return
validationQuery
;
}
public
void
setValidationQuery
(
String
validationQuery
)
{
this
.
validationQuery
=
validationQuery
;
}
public
boolean
isTestWhileIdle
()
{
return
testWhileIdle
;
}
public
void
setTestWhileIdle
(
boolean
testWhileIdle
)
{
this
.
testWhileIdle
=
testWhileIdle
;
}
public
boolean
isTestOnBorrow
()
{
return
testOnBorrow
;
}
public
void
setTestOnBorrow
(
boolean
testOnBorrow
)
{
this
.
testOnBorrow
=
testOnBorrow
;
}
public
boolean
isTestOnReturn
()
{
return
testOnReturn
;
}
public
void
setTestOnReturn
(
boolean
testOnReturn
)
{
this
.
testOnReturn
=
testOnReturn
;
}
public
boolean
isPoolPreparedStatements
()
{
return
poolPreparedStatements
;
}
public
void
setPoolPreparedStatements
(
boolean
poolPreparedStatements
)
{
this
.
poolPreparedStatements
=
poolPreparedStatements
;
}
public
int
getMaxPoolPreparedStatementPerConnectionSize
()
{
return
maxPoolPreparedStatementPerConnectionSize
;
}
public
void
setMaxPoolPreparedStatementPerConnectionSize
(
int
maxPoolPreparedStatementPerConnectionSize
)
{
this
.
maxPoolPreparedStatementPerConnectionSize
=
maxPoolPreparedStatementPerConnectionSize
;
}
}
\ No newline at end of file
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/
gateway/
impl/ApiWhiteServiceImpl.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/impl/ApiWhiteServiceImpl.java
View file @
8510edc7
/**
* Copyright (c) 2011-2019 All Rights Reserved.
*/
package
com
.
jz
.
dm
.
gateway
.
gateway
.
impl
;
package
com
.
jz
.
dm
.
gateway
.
impl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
/**
* API白名单表 服务实现类
*
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/
gateway/
impl/GatewayServiceImpl.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/impl/GatewayServiceImpl.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
gateway
.
impl
;
package
com
.
jz
.
dm
.
gateway
.
impl
;
import
com.jz.dm.
gateway.
filter.FilterChain
;
import
com.jz.dm.
gateway.
filter.FilterChainFactory
;
import
com.jz.dm.gateway.
gateway.
GatewayService
;
import
com.jz.dm.
gateway.
model.GatewayRequest
;
import
com.jz.dm.
gateway.
model.GatewayResponse
;
import
com.jz.dm.filter.FilterChain
;
import
com.jz.dm.filter.FilterChainFactory
;
import
com.jz.dm.gateway.GatewayService
;
import
com.jz.dm.model.GatewayRequest
;
import
com.jz.dm.model.GatewayResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* 网关服务
*
* @author key
*/
@Service
@Service
(
"gatewayService"
)
public
class
GatewayServiceImpl
implements
GatewayService
{
@Autowired
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/mapper/DataGoodsApiDao.java
deleted
100644 → 0
View file @
1ea71617
package
com
.
jz
.
dm
.
gateway
.
mapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.common.entity.DataGoodsApi
;
import
java.util.List
;
/**
* api商品(TDataGoodsApi)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
public
interface
DataGoodsApiDao
extends
BaseMapper
<
DataGoodsApi
>
{
List
<
DataGoodsApi
>
findAll
();
}
\ No newline at end of file
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/mapper/DataGoodsApiParamsDao.java
deleted
100644 → 0
View file @
1ea71617
package
com
.
jz
.
dm
.
gateway
.
mapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.common.entity.DataGoodsApiParams
;
/**
* api商品参数配置(TDataGoodsApiParams)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
public
interface
DataGoodsApiParamsDao
extends
BaseMapper
<
DataGoodsApiParams
>
{
}
\ No newline at end of file
jz-dm-apigateway/src/main/java/com/jz/dm/gateway/service/Test.java
deleted
100644 → 0
View file @
1ea71617
package
com
.
jz
.
dm
.
gateway
.
service
;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.gateway.service
* @PROJECT_NAME: jz-dm-parent
* @NAME: Test
* @USER: key
* @DATE: 2020-11-24/16:21
* @DAY_NAME_SHORT: 周二
* @Description:
**/
public
class
Test
{
}
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/DispatchContext.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/DispatchContext.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
;
package
com
.
jz
.
dm
.
model
;
import
java.io.Serializable
;
import
java.util.HashMap
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/GatewayRequest.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/GatewayRequest.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
;
package
com
.
jz
.
dm
.
model
;
import
com.jz.dm.gateway.web.annotation.ParamName
;
import
com.jz.dm.web.annotation.ParamName
;
import
java.io.Serializable
;
import
java.util.HashMap
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/GatewayResponse.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/GatewayResponse.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
;
package
com
.
jz
.
dm
.
model
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.alibaba.fastjson.annotation.JSONType
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/OpenApi.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/OpenApi.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
;
package
com
.
jz
.
dm
.
model
;
import
com.alibaba.fastjson.JSON
;
import
com.jz.dm.
gateway.
model.enums.RouteType
;
import
com.jz.dm.model.enums.RouteType
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/RequestContext.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/RequestContext.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
;
package
com
.
jz
.
dm
.
model
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/enums/Format.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/enums/Format.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
.
enums
;
package
com
.
jz
.
dm
.
model
.
enums
;
/**
* 数据格式
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/enums/GatewayResultCode.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/enums/GatewayResultCode.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
.
enums
;
package
com
.
jz
.
dm
.
model
.
enums
;
import
com.jz.dm.
gateway.
common.util.ResultCode
;
import
com.jz.dm.common.util.ResultCode
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/enums/RouteType.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/enums/RouteType.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
.
enums
;
package
com
.
jz
.
dm
.
model
.
enums
;
/**
* 路由类型
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/signtype/Md5.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/signtype/Md5.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
.
signtype
;
package
com
.
jz
.
dm
.
model
.
signtype
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/signtype/SHA1WithRSA.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/signtype/SHA1WithRSA.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
.
signtype
;
package
com
.
jz
.
dm
.
model
.
signtype
;
import
com.jz.dm.
gateway.
constant.Constants
;
import
com.jz.dm.constant.Constants
;
import
com.sun.org.apache.xerces.internal.impl.dv.util.Base64
;
import
javax.crypto.Cipher
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
model/signtype/SHA256WithRSA.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/model/signtype/SHA256WithRSA.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
model
.
signtype
;
package
com
.
jz
.
dm
.
model
.
signtype
;
import
com.jz.dm.
gateway.
common.util.Base64
;
import
com.jz.dm.
gateway.
common.util.StreamUtil
;
import
com.jz.dm.common.util.Base64
;
import
com.jz.dm.common.util.StreamUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.*
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/service/trade/Trade
AddService.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/
service/Account
AddService.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
service
.
trad
e
;
package
com
.
jz
.
dm
.
servic
e
;
import
com.jz.dm.gateway.common.util.OpenApiRequest
;
import
com.jz.dm.gateway.common.util.OpenApiResponse
;
import
com.jz.dm.gateway.gateway.OpenApiService
;
import
lombok.extern.slf4j.Slf4j
;
import
com.jz.dm.common.util.OpenApiRequest
;
import
com.jz.dm.common.util.OpenApiResponse
;
import
com.jz.dm.gateway.OpenApiService
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
public
class
TradeAddService
implements
OpenApiService
{
public
class
AccountAddService
implements
OpenApiService
{
@Override
public
String
getOpenApiMethod
()
{
return
"
bal.query
"
;
return
"
account.add
"
;
}
@Override
...
...
@@ -24,6 +19,6 @@ public class TradeAddService implements OpenApiService {
@Override
public
void
doService
(
OpenApiRequest
request
,
OpenApiResponse
response
)
{
System
.
out
.
println
(
"
~~~~~~~~~~~~请求到接口~~~~~~~~~~~~
"
);
System
.
out
.
println
(
"
请求过来了。。。。。
"
);
}
}
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
web/annotation/ParamName.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/web/annotation/ParamName.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
web
.
annotation
;
package
com
.
jz
.
dm
.
web
.
annotation
;
import
java.lang.annotation.*
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
web/binder/ParamNameAnnotationBinder.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/web/binder/ParamNameAnnotationBinder.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
web
.
binder
;
package
com
.
jz
.
dm
.
web
.
binder
;
import
org.springframework.beans.MutablePropertyValues
;
import
org.springframework.web.servlet.mvc.method.annotation.ExtendedServletRequestDataBinder
;
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/
gateway/
web/binder/ParamNameAnnotationResolver.java
→
jz-dm-apigateway/src/main/java/com/jz/dm/web/binder/ParamNameAnnotationResolver.java
View file @
8510edc7
package
com
.
jz
.
dm
.
gateway
.
web
.
binder
;
package
com
.
jz
.
dm
.
web
.
binder
;
import
com.jz.dm.gateway.web.annotation.ParamName
;
import
com.jz.dm.web.annotation.ParamName
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.context.request.NativeWebRequest
;
...
...
jz-dm-apigateway/src/main/resources/application-dev.yml
deleted
100644 → 0
View file @
1ea71617
#开发环境配置
spring
:
#缓存会话
redis
:
#database: 0
#host: 119.23.13.83
#port: 8007
#timeout: 5000
cluster
:
nodes
:
-
192.168.31.167:6379
-
192.168.31.167:6380
-
192.168.31.167:6381
-
192.168.31.167:6382
-
192.168.31.167:6383
-
192.168.31.167:6384
session
:
store-type
:
none
#数据库
datasource
:
url
:
jdbc:mysql://rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com:3306/wj-mkt-project?characterEncoding=utf8&useSSL=false
driverClassName
:
com.mysql.jdbc.Driver
username
:
root
password
:
I%ou$buy!ok
type
:
com.alibaba.druid.pool.DruidDataSource
#监控统计拦截的filters
filters
:
stat
#配置初始化大小/最小/最大
initialSize
:
1
minIdle
:
1
maxActive
:
20
#获取连接等待超时时间
maxWait
:
60000
#间隔多久进行一次检测,检测需要关闭的空闲连接
timeBetweenEvictionRunsMillis
:
60000
#一个连接在池中最小生存的时间
minEvictableIdleTimeMillis
:
300000
validationQuery
:
SELECT 'x'
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
#打开PSCache,并指定每个连接上PSCache的大小。
#oracle设为true,mysql设为false。分库分表较多推荐设置为false
poolPreparedStatements
:
false
maxPoolPreparedStatementPerConnectionSize
:
20
# 跳过签名
api
:
skipFilter
:
false
skipIpLimit
:
true
maxPostSize
:
1048576
supplierId
:
200314008093
# 代发三要素校验定时任务
validCron
:
0/1 * * * * *
jz-dm-apigateway/src/main/resources/application-pro.yml
deleted
100644 → 0
View file @
1ea71617
##测试环境配置
#spring:
#
# #缓存会话
# redis:
# host: r-wz9cnvxpbfm2ir35dh.redis.rds.aliyuncs.com
# password: hdd2020@888
# port: 6379
# timeout: 10000
# lettuce:
# pool:
# max-active: 100 #连接池最大连接数(使用负值表示没有限制)
# max-idle: 100 #连接池中的最大空闲连接
# min-idle: 50 #连接池中的最小空闲连接
# max-wait: 6000 #连接池最大阻塞等待时间(使用负值表示没有限制)
#
# #数据库
# datasource:
# url: jdbc:mysql://172.18.126.216:3306/btcpaydb?serverTimezone=GMT%2B8&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false
# username: root
# password: hdd2020@888
# type: com.zaxxer.hikari.HikariDataSource
# driver-class-name: com.mysql.cj.jdbc.Driver
# hikari:
# minimum-idle: 20
# maximum-pool-size: 100
# auto-commit: true
# idle-timeout: 30000
# pool-name: MyHikariCP
# max-lifetime: 1800000
# connection-timeout: 30000
# connection-test-query: SELECT 1
jz-dm-apigateway/src/main/resources/application-test.yml
0 → 100644
View file @
8510edc7
#数据源
spring
:
security
:
basic
:
enabled
:
false
datasource
:
url
:
jdbc:mysql://rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com:3306/wj-mkt-project?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
username
:
root
password
:
I%ou$buy!ok
driver-class-name
:
com.mysql.jdbc.Driver
druid
:
# 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
initialSize
:
1
# 最小连接池数量
minIdle
:
1
# 最大连接池数量
maxActive
:
10
# 配置获取连接等待超时的时间
maxWait
:
10000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis
:
60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis
:
300000
# 验证连接有效与否的SQL,不同的数据配置不同
validationQuery
:
select 1
# 建议配置为true,不影响性能,并且保证安全性。
# 申请连接的时候检测,如果空闲时间大于
# timeBetweenEvictionRunsMillis,
# 执行validationQuery检测连接是否有效。
testWhileIdle
:
true
# 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
# 这里建议配置为TRUE,防止取到的连接不可用
testOnBorrow
:
true
# 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能
testOnReturn
:
false
# 是否缓存preparedStatement,也就是PSCache。
# PSCache对支持游标的数据库性能提升巨大,比如说oracle。
# 在mysql5.5以下的版本中没有PSCache功能,建议关闭掉。
# 作者在5.5版本中使用PSCache,通过监控界面发现PSCache有缓存命中率记录,
# 该应该是支持PSCache。
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements
:
true
maxPoolPreparedStatementPerConnectionSize
:
20
# 属性类型是字符串,通过别名的方式配置扩展插件,
# 常用的插件有:
# 监控统计用的filter:stat
# 日志用的filter:log4j
# 防御sql注入的filter:wall
filters
:
stat
# ====================MybatisPlus====================
mybatis-plus
:
# 如果是放在src/main/java目录下 classpath:/com/yourpackage/*/mapper/*Mapper.xml
# 如果是放在resource目录 classpath:/mapper/*Mapper.xml
mapper-locations
:
classpath*:com/frame/**/**.xml,classpath*:mapping/**/**.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage
:
com.frame.**.entity,com.frame.**.dto
global-config
:
#刷新mapper 调试神器
db-config
:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
id-type
:
UUID
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
field-strategy
:
2
#驼峰下划线转换
column-underline
:
false
#数据库大写下划线转换
# capital-mode: true
#逻辑删除配置
logic-delete-value
:
1
logic-not-delete-value
:
0
refresh
:
true
configuration
:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case
:
true
cache-enabled
:
false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null
:
'
null'
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
database-id
:
mysql
\ No newline at end of file
jz-dm-apigateway/src/main/resources/application.yml
View file @
8510edc7
...
...
@@ -3,12 +3,6 @@ server:
port
:
8088
servlet
:
context-path
:
/
#Djasypt.encryptor.password
jasypt
:
encryptor
:
password
:
btcpay.com
#日志打印
logging
:
level
:
...
...
@@ -22,29 +16,22 @@ spring:
aop
:
proxy-target-class
:
true
profiles
:
active
:
dev
#默认使用的配置文件
active
:
test
#默认使用的配置文件
http
:
encoding
:
charset
:
UTF-8
jackson
:
time-zone
:
GMT+8
date-format
:
yyyy-MM-dd HH:mm:ss
default-property-inclusion
:
NON_NULL
#MyBatis
mybatis-plus
:
mapper-locations
:
classpath:/mapper/**/*.xml
typeAliasesPackage
:
com.jz.common.entity
#type-handlers-package: com.btcpay.commons.typehandler
global-config
:
id-type
:
1
field-strategy
:
2
db-column-underline
:
true
refresh-mapper
:
true
configuration
:
map-underscore-to-camel-case
:
true
cache-enabled
:
false
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#
mybatis-plus:
#
mapper-locations: classpath:/mapper/**/*.xml
#
typeAliasesPackage: com.jz.common.entity
#
#type-handlers-package: com.btcpay.commons.typehandler
#
global-config:
#
id-type: 1
#
field-strategy: 2
#
db-column-underline: true
#
refresh-mapper: true
#
configuration:
#
map-underscore-to-camel-case: true
#
cache-enabled: false
#
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
jz-dm-apigateway/src/main/resources/logback.xml
deleted
100644 → 0
View file @
1ea71617
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<substitutionProperty
name=
"log.proj"
value=
"gateway"
/>
<!-- 服务器 -->
<substitutionProperty
name=
"log.base"
value=
"/logs/${log.proj}"
/>
<!-- 本地 -->
<!-- <substitutionProperty name="log.base" value="/Users/luoyichang/Desktop/hdd/logs/${log.proj}" />-->
<substitutionProperty
name=
"max.size"
value=
"100MB"
/>
<jmxConfigurator
/>
<appender
name=
"stdout"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
%date [${log.proj}:%thread] %-5level %logger{80} - %msg%n
</pattern>
</layout>
</appender>
<appender
name=
"file.debug"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- All Log Info -->
<File>
${log.base}/${log.proj}.log
</File>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${log.base}/${log.proj}_%d{yyyy-MM-dd}.%i.log
</FileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${max.size}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
%date [%thread] %-5level %logger{80} - %msg%n
</pattern>
</layout>
</appender>
<appender
name=
"file.info"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- <File>${log.base}/${log.proj}_info.log</File> -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${log.base}/${log.proj}_info_%d{yyyy-MM-dd}.%i.log
</FileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${max.size}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
%date [%thread] %-5level %logger{80} - %msg%n
</pattern>
</layout>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
INFO
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<appender
name=
"file.error"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${log.base}/${log.proj}_error_%d{yyyy-MM-dd}.%i.log
</FileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${max.size}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
%date [%thread] %-5level %logger{80} - %msg%n
</pattern>
</layout>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<appender
name=
"file.warn"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<FileNamePattern>
${log.base}/${log.proj}_warn_%d{yyyy-MM-dd}.%i.log
</FileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
${max.size}
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
%date [%thread] %-5level %logger{80} - %msg%n
</pattern>
</layout>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<!-- 临界值过滤器,过滤掉低于指定临界值的日志 -->
<level>
WARN
</level>
</filter>
</appender>
<!--异步输出 -->
<appender
name=
"async.file.info"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
256
</queueSize>
<appender-ref
ref=
"file.info"
/>
</appender>
<appender
name=
"async.file.debug"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
256
</queueSize>
<appender-ref
ref=
"file.debug"
/>
</appender>
<appender
name=
"async.file.warn"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
256
</queueSize>
<appender-ref
ref=
"file.warn"
/>
</appender>
<appender
name=
"async.file.error"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
256
</queueSize>
<appender-ref
ref=
"file.error"
/>
</appender>
<root
level=
"info"
additivity=
"false"
>
<appender-ref
ref=
"stdout"
/>
<!-- <appender-ref ref="async.file.debug" /> -->
<appender-ref
ref=
"async.file.info"
/>
<appender-ref
ref=
"async.file.error"
/>
<!-- <appender-ref ref="async.file.warn" /> -->
</root>
<logger
name=
"io.lettuce.core.protocol.ConnectionWatchdog"
additivity=
"false"
>
<appender-ref
ref=
"stdout"
/>
<level
value=
"ERROR"
/>
</logger>
<logger
name=
"io.lettuce.core.protocol.ReconnectionHandler"
additivity=
"false"
>
<appender-ref
ref=
"stdout"
/>
<level
value=
"ERROR"
/>
</logger>
</configuration>
\ No newline at end of file
jz-dm-apigateway/src/main/resources/mapper/DataGoodsApiDao.xml
deleted
100644 → 0
View file @
1ea71617
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jz.dm.gateway.mapper.DataGoodsApiDao"
>
<resultMap
type=
"com.jz.common.entity.DataGoodsApi"
id=
"TDataGoodsApiMap"
>
<result
property=
"goodsApi"
column=
"goods_api"
jdbcType=
"INTEGER"
/>
<result
property=
"dataGoodsId"
column=
"data_goods_id"
jdbcType=
"INTEGER"
/>
<result
property=
"apiName"
column=
"api_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"requestType"
column=
"request_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"apiUrl"
column=
"api_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"apiMethod"
column=
"api_method"
jdbcType=
"VARCHAR"
/>
<result
property=
"apiProtocl"
column=
"api_protocl"
jdbcType=
"VARCHAR"
/>
<result
property=
"returnDataExample"
column=
"return_data_example"
jdbcType=
"VARCHAR"
/>
<result
property=
"requestExample"
column=
"request_example"
jdbcType=
"VARCHAR"
/>
<result
property=
"returnType"
column=
"return_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"apiKey"
column=
"api_key"
jdbcType=
"VARCHAR"
/>
<result
property=
"creTime"
column=
"cre_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"crePerson"
column=
"cre_person"
jdbcType=
"VARCHAR"
/>
<result
property=
"uptPerson"
column=
"upt_person"
jdbcType=
"VARCHAR"
/>
<result
property=
"uptTime"
column=
"upt_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"delFlag"
column=
"del_flag"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"findAll"
resultType=
"com.jz.common.entity.DataGoodsApi"
>
select * from t_data_goods_api
</select>
</mapper>
\ No newline at end of file
jz-dm-apigateway/src/main/resources/mapper/DataGoodsApiParamsDao.xml
deleted
100644 → 0
View file @
1ea71617
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jz.dm.gateway.mapper.DataGoodsApiParamsDao"
>
<resultMap
type=
"com.jz.common.entity.DataGoodsApiParams"
id=
"TDataGoodsApiParamsMap"
>
<result
property=
"apiParamsId"
column=
"api_params_id"
jdbcType=
"INTEGER"
/>
<result
property=
"goodsApi"
column=
"goods_api"
jdbcType=
"INTEGER"
/>
<result
property=
"paramsDiff"
column=
"params_diff"
jdbcType=
"VARCHAR"
/>
<result
property=
"paramsName"
column=
"params_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"paramsType"
column=
"params_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"paramsDesc"
column=
"params_desc"
jdbcType=
"VARCHAR"
/>
<result
property=
"defaultValue"
column=
"default_value"
jdbcType=
"VARCHAR"
/>
<result
property=
"remark"
column=
"remark"
jdbcType=
"VARCHAR"
/>
<result
property=
"ifRequird"
column=
"if_requird"
jdbcType=
"VARCHAR"
/>
<result
property=
"delFlag"
column=
"del_flag"
jdbcType=
"VARCHAR"
/>
<result
property=
"creTime"
column=
"cre_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"uptTime"
column=
"upt_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</mapper>
\ No newline at end of file
jz-dm-apigateway/src/test/java/
domian
/Property.java
→
jz-dm-apigateway/src/test/java/
com/jz/dm/gateway
/Property.java
View file @
8510edc7
/**
* Copyright (c) 2011-2014 All Rights Reserved.
*/
package
domian
;
package
com
.
jz
.
dm
.
gateway
;
/**
*
...
...
jz-dm-apigateway/src/test/java/
domian
/SpringTestCase.java
→
jz-dm-apigateway/src/test/java/
com/jz/dm/gateway
/SpringTestCase.java
View file @
8510edc7
package
domian
;
package
com
.
jz
.
dm
.
gateway
;
import
com.jz.dm.gateway.ApiGatewayApplication
;
...
...
jz-dm-apigateway/src/test/java/
domian
/TestApplicationContextInitializer.java
→
jz-dm-apigateway/src/test/java/
com/jz/dm/gateway
/TestApplicationContextInitializer.java
View file @
8510edc7
package
domian
;
package
com
.
jz
.
dm
.
gateway
;
...
...
@@ -24,7 +24,7 @@ public class TestApplicationContextInitializer implements ApplicationContextInit
private
Properties
props
=
null
;
/**
* @see
org.springframework.context.
ApplicationContextInitializer#initialize(org.springframework.context.ConfigurableApplicationContext)
* @see ApplicationContextInitializer#initialize(org.springframework.context.ConfigurableApplicationContext)
*/
@Override
public
void
initialize
(
GenericApplicationContext
context
)
{
...
...
jz-dm-apigateway/src/test/java/domian/PushSdkLocalhostTest1.java
deleted
100644 → 0
View file @
1ea71617
package
domian
;
/**
* Copyright (c) 2011-2018 All Rights Reserved.
*/
import
com.alibaba.fastjson.JSON
;
import
com.jz.dm.gateway.common.util.TtpayUtils
;
import
com.jz.dm.gateway.common.util.WebUtils
;
import
com.jz.dm.gateway.model.signtype.Md5
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
*
*
* @author Admin
* @version $Id: PushSdkTest.java 2018年4月12日 下午4:31:31 $
*/
public
class
PushSdkLocalhostTest1
{
private
static
String
uri
=
"http://localhost:8088/gateway"
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// 余额查询接口
balQuery
();
//委托订单查询
//orderQuery();
//取消订单
//cancelOrder();
//账户信息查询
//accQuery();
//代发订单详情
//orderDetail();
}
protected
static
void
balQuery
()
{
try
{
Map
<
String
,
String
>
data
=
new
HashMap
<>();
data
.
put
(
"appId"
,
"200316008117"
);
data
.
put
(
"method"
,
"bal.query"
);
data
.
put
(
"charset"
,
"UTF-8"
);
data
.
put
(
"signType"
,
"MD5"
);
data
.
put
(
"timestamp"
,
String
.
valueOf
(
System
.
currentTimeMillis
()));
data
.
put
(
"version"
,
"1.0.0"
);
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"account_no"
,
"5845342722900679704"
);
params
.
put
(
"account_type"
,
"WBANK"
);
data
.
put
(
"params"
,
JSON
.
toJSONString
(
params
));
String
dataStr
=
TtpayUtils
.
createLinkString
(
TtpayUtils
.
filter
(
data
));
String
sign
=
Md5
.
encrypt
(
dataStr
,
"fP6R7cSvQj8JwThFvP1RrOomkHXydHx3"
,
"UTF-8"
);
data
.
put
(
"sign"
,
sign
);
System
.
out
.
println
(
data
);
String
rsp
=
WebUtils
.
post
(
uri
,
data
);
System
.
out
.
println
(
rsp
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
//protected static void orderQuery() {
// try {
// Map<String, String> data = new HashMap<>();
// data.put("app_id", "200314008093");
// data.put("method", "trade.query");
// data.put("charset", "UTF-8");
// data.put("sign_type", "MD5");
//
// data.put("timestamp", String.valueOf(System.currentTimeMillis()));
// data.put("version", "1.0.0");
//
// Map<String, String> params = new HashMap<>();
// //商户订单号
// params.put("out_trade_no", "YW202003040013");
// //银行卡号(非必填)
// //params.put("card_no", "6214806601002512988");
// data.put("params", JSON.toJSONString(params));
// String dataStr = TtpayUtils.createLinkString(TtpayUtils.filter(data));
// String sign = Md5.encrypt(dataStr, "fP6R7cSvQj8JwThFvP1RrOomkHXydHx3", "UTF-8");
// data.put("sign", sign);
//
// String rsp = WebUtils.post(uri, data);
// System.out.println(rsp);
// } catch (Exception e) {
// e.printStackTrace();
// }
//}
//
//protected static void cancelOrder() {
// try {
// Map<String, String> data = new HashMap<>();
// data.put("app_id", "200314008092");
// data.put("method", "trade.cancel");
// data.put("charset", "UTF-8");
// data.put("sign_type", "MD5");
//
// data.put("timestamp", String.valueOf(System.currentTimeMillis()));
// data.put("version", "1.0.0");
//
// Map<String, String> params = new HashMap<>();
// params.put("remark", "订单取消");
// //商户订单号
// params.put("out_trade_no", "2020031410810730003");
// data.put("params", JSON.toJSONString(params));
//
// String dataStr = TtpayUtils.createLinkString(TtpayUtils.filter(data));
// String sign = Md5.encrypt(dataStr, "fP6R7cSvQj8JwThFvP1RrOomkHXydHx3", "UTF-8");
// data.put("sign", sign);
//
// String rsp = WebUtils.post(uri, data);
// System.out.println(rsp);
// } catch (Exception e) {
// e.printStackTrace();
// }
//}
//protected static void accQuery() {
// try {
// Map<String, String> data = new HashMap<>();
// data.put("app_id", "200314008092");
// data.put("method", "acc.query");
// data.put("charset", "UTF-8");
// data.put("sign_type", "MD5");
//
// data.put("timestamp", String.valueOf(System.currentTimeMillis()));
// data.put("version", "1.0.0");
//
// Map<String, String> params = new HashMap<>();
// //params.put("remark", "订单取消");
// //商户订单号
// //params.put("out_trade_no", "2020031410810730003");
// data.put("params", JSON.toJSONString(params));
//
// String dataStr = TtpayUtils.createLinkString(TtpayUtils.filter(data));
// String sign = Md5.encrypt(dataStr, "fP6R7cSvQj8JwThFvP1RrOomkHXydHx3", "UTF-8");
// data.put("sign", sign);
//
// String rsp = WebUtils.post(uri, data);
// System.out.println(rsp);
// } catch (Exception e) {
// e.printStackTrace();
// }
//}
//protected static void orderDetail() {
// try {
// Map<String, String> data = new HashMap<>();
// data.put("app_id", "200314008093");
// data.put("method", "trade.detail");
// data.put("charset", "UTF-8");
// data.put("sign_type", "MD5");
//
// data.put("timestamp", String.valueOf(System.currentTimeMillis()));
// data.put("version", "1.0.0");
//
// Map<String, String> params = new HashMap<>();
// //商户订单号
// params.put("out_trade_no", "YW202003040012");
// data.put("params", JSON.toJSONString(params));
//
// String dataStr = TtpayUtils.createLinkString(TtpayUtils.filter(data));
// String sign = Md5.encrypt(dataStr, "fP6R7cSvQj8JwThFvP1RrOomkHXydHx3", "UTF-8");
// data.put("sign", sign);
//
// String rsp = WebUtils.post(uri, data);
// System.out.println(rsp);
// } catch (Exception e) {
// e.printStackTrace();
// }
//}
}
jz-dm-apigateway/src/test/java/domian/TestApi/GatewayTest.java
deleted
100644 → 0
View file @
1ea71617
package
domian
.
TestApi
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.jz.common.entity.DataGoodsApi
;
import
com.jz.dm.gateway.mapper.DataGoodsApiDao
;
import
domian.SpringTestCase
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @author ZC
* @PACKAGE_NAME: domian.TestApi
* @PROJECT_NAME: jz-dm-parent
* @NAME: GatewayTest
* @USER: key
* @DATE: 2020-12-2/11:53
* @DAY_NAME_SHORT: 周三
* @Description:
**/
public
class
GatewayTest
extends
SpringTestCase
{
@Autowired
private
DataGoodsApiDao
dataGoodsApiDao
;
@Test
public
void
Test
(){
//List<DataGoodsApi> list= dataGoodsApiDao.findAll();
// System.out.println(list);
QueryWrapper
<
DataGoodsApi
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"goods_api"
,
1
);
DataGoodsApi
dataGoodsApi
=
dataGoodsApiDao
.
selectOne
(
wrapper
);
}
}
Write
Preview
Markdown
is supported
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