break 不兼容更新, 包名迁移到.cn.daxpay.single

This commit is contained in:
DaxPay
2024-05-09 10:19:00 +08:00
parent 35724c40b7
commit 8c0888273c
643 changed files with 2672 additions and 22512 deletions

View File

@@ -0,0 +1,87 @@
<?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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>cn.bootx.platform</groupId>
<artifactId>daxpay-single-start</artifactId>
<version>${daxpay.version}</version>
<properties>
<!-- 二方库版本 -->
<bootx-platform.version>1.3.6.2</bootx-platform.version>
<daxpay.version>2.0.5</daxpay.version>
</properties>
<dependencies>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- 支付网关 -->
<dependency>
<groupId>cn.bootx.platform</groupId>
<artifactId>daxpay-single-gateway</artifactId>
<version>${daxpay.version}</version>
</dependency>
<!-- 管理平台 -->
<dependency>
<groupId>cn.bootx.platform</groupId>
<artifactId>daxpay-single-admin</artifactId>
<version>${daxpay.version}</version>
</dependency>
<!-- 定时任务 -->
<dependency>
<groupId>cn.bootx.platform</groupId>
<artifactId>common-starter-quartz</artifactId>
<version>${bootx-platform.version}</version>
</dependency>
<!-- 代码生成模块 -->
<dependency>
<groupId>cn.bootx.platform</groupId>
<artifactId>common-starter-code-gen</artifactId>
<version>${bootx-platform.version}</version>
</dependency>
<!-- 系统监控 -->
<dependency>
<groupId>cn.bootx.platform</groupId>
<artifactId>common-starter-monitor</artifactId>
<version>${bootx-platform.version}</version>
</dependency>
<!-- 支付演示模块 -->
<dependency>
<groupId>cn.bootx.platform</groupId>
<artifactId>daxpay-single-demo</artifactId>
<version>${daxpay.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
<build>
<finalName>daxpay-start</finalName>
<plugins>
<!-- spring-boot -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,40 @@
package cn.daxpay.single.start;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* DaxPay 单商户模式启动类
* @author xxm
* @since 2023/12/15
*/
@Slf4j
@SpringBootApplication
public class DaxpaySingleStart {
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext application = SpringApplication.run(DaxpaySingleStart.class, args);
Environment env = application.getEnvironment();
// 环境变量
String appName = env.getProperty("spring.application.name");
String host = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String contextPath = env.getProperty("server.servlet.context-path", "");
String path = env.getProperty("spring.mvc.servlet.path", "");
// 应用信息栏
String appInfo = StrUtil.format("应用 '{}' 运行成功! \n\t", appName);
// swagger栏
String swagger = StrUtil.format("Swagger文档: \t\thttp://{}:{}{}{}/doc.html\n\t", host, port, contextPath, path);
log.info("\n----------------------------------------------------------\n\t" + "{}{} \n"
+ "----------------------------------------------------------", appInfo, swagger);
}
}

View File

@@ -0,0 +1 @@
cn.daxpay.single.start.DaxpaySingleStart

View File

@@ -0,0 +1,182 @@
server:
port: 9000
spring:
datasource:
dynamic:
primary: master
datasource:
# 默认数据源
master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/dax-pay?serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&useSSL=false&nullCatalogMeansCurrent=true
username: root
password: root
hikari:
# 30 秒, 心跳检测
keepalive-time: 30000
# 300 分钟, 连接最大存活时间
max-lifetime: 18000000
redis:
host: 127.0.0.1
port: 6379
database: 1
lettuce:
cluster:
refresh:
# 自适应拓扑刷新
adaptive: true
# 群集拓扑刷新周期
period: 60s
#静态资源加载配置
mvc:
static-path-pattern: /**
web:
resources:
static-locations: classpath:/static/,classpath:/public/
thymeleaf:
cache: false
# 定时任务
quartz:
# 持久化方式
job-store-type: jdbc
#定时任务启动开关true-开 false-关
auto-startup: true
#启动时更新己存在的Job
overwrite-existing-jobs: true
properties:
org:
quartz:
scheduler:
instanceName: quartzScheduler
instanceId: AUTO
threadPool:
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
# swagger openapi 接口文档配置
springdoc:
# 自动展开参数
default-flat-param-object: true
# 开发时显示debug日志
logging:
level:
cn.bootx.**: debug
org.springframework.jdbc.core: debug
# 项目配置
bootx:
common:
# 接口文档
swagger:
enabled: true
author: bootx
version: 2.0.5
title: 开源支付平台-单商户
description: 开源支付平台-单商户版
# 多模块扫码
base-packages:
"[支付网关API]": cn.bootx.platform.daxpay.gateway
"[支付管理接口]": cn.bootx.platform.daxpay.admin
"[支付演示模块]": cn.bootx.platform.daxpay.demo
"[BootxPlatform接口]":
- cn.bootx.platform.common
- cn.bootx.platform.starter
- cn.bootx.platform.iam
- cn.bootx.platform.baseapi
- cn.bootx.platform.notice
# 缓存
cache:
# 默认超时时间 30分钟
default-ttl: 1800
# 序列生成器
sequence:
# 生成方式
type: jdbc
# 序列生成器起始值
range-start: 1
# 序列生成器区间, 设置1每次都会操作数据库
range-step: 1
# 步长
step: 1
# 异常
exception:
# 显示详细异常
show-full-message: true
starter:
# 认证
auth:
enable-admin: true
default-password: 123456
ignore-urls:
- '/actuator/**'
- '/v3/api-docs/**'
- '/doc.html'
- '/swagger-resources/**'
- '/token/**'
- '/ws/**'
- '/demo/**'
- '/test/**'
- '/webjars/**'
- '/front/**'
- '/h5/**'
- '/css/**'
- '/error'
- '/favicon.ico'
# 审计日志
audit-log:
# 审计日志存储
store: jdbc
# ip归属地
ip2region:
# 数据文件路径
file-path: /data/ip2region/ip2region.xdb
# 查询方式
search-type: cache
# 数据权限
data-perm:
# 需要符合AES密钥的要求
field-decrypt-key: "UCrtxSCwYZNCIlav"
# 文件上传
file-upload:
server-url: http://127.0.0.1:9000
# 自动建表 生产环境关闭
table-modify:
update-type: update
database-type: mysql
fail-fast: true
scan-package: cn.bootx.platform.daxpay
dromara:
#文件存储配置,
x-file-storage:
#默认使用的存储平台
default-platform: local
#缩略图后缀,例如【.min.jpg】【.png】
thumbnail-suffix: ".min.jpg"
local-plus:
# 不启用自带的访问映射, 使用自定义的访问实现
# 存储平台标识
- platform: local
enableStorage: true
# 文件存储路径
storage-path: D:/data/files/
# 支付系统配置
dax-pay:
# 服务地址
server-url: http://localhost:9000
# 前端h5地址
front-h5-url: http://pay1.bootx.cn/h5/#
# 前端web地址
front-web-url: http://localhost:9000/#
# 机器号码
machine-no: 63
# 当前环境,会影响订单号的生成
env: DEV
# 演示模块
demo:
# 网关地址
server-url: http://localhost:9000
# 前端h5地址
front-h5-url: http://pay1.bootx.cn/h5/#
# 签名秘钥, 需要与系统中配置一致
sign-secret: 123456
# 签名方式
sign-type: hmac_sha256

View File

@@ -0,0 +1,161 @@
server:
port: 9000
spring:
datasource:
dynamic:
primary: master
datasource:
# 默认数据源
master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/dax-pay?serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&useSSL=false&nullCatalogMeansCurrent=true
username: root
password: root
hikari:
# 30 秒, 心跳检测
keepalive-time: 30000
# 300 分钟, 连接最大存活时间
max-lifetime: 18000000
redis:
host: 127.0.0.1
port: 6379
database: 1
lettuce:
cluster:
refresh:
# 自适应拓扑刷新
adaptive: true
# 群集拓扑刷新周期
period: 60s
#静态资源加载配置
mvc:
static-path-pattern: /**
web:
resources:
static-locations: classpath:/static/,classpath:/public/
thymeleaf:
cache: false
# 定时任务
quartz:
# 持久化方式
job-store-type: jdbc
#定时任务启动开关true-开 false-关
auto-startup: true
#启动时更新己存在的Job
overwrite-existing-jobs: true
properties:
org:
quartz:
scheduler:
instanceName: quartzScheduler
instanceId: AUTO
threadPool:
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
knife4j:
# 开启增强配置
enable: true
# 开启生产环境屏蔽
production: true
# 项目配置
bootx:
common:
# 接口文档
swagger:
enabled: false
author: bootx
version: 2.0.5
title: 开源支付平台-单商户
description: 开源支付平台-单商户版
# 缓存
cache:
# 默认超时时间 30分钟
default-ttl: 1800
# 序列生成器
sequence:
# 生成方式
type: jdbc
# 序列生成器起始值
range-start: 1
# 序列生成器区间, 设置1每次都会操作数据库
range-step: 1
# 步长
step: 1
# 异常
exception:
# 显示详细异常
show-full-message: true
starter:
# 认证
auth:
default-password: 123456
# 关闭超级管理员登录
enable-admin: false
ignore-urls:
- '/actuator/**'
- '/v3/api-docs/**'
- '/doc.html'
- '/swagger-resources/**'
- '/token/**'
- '/ws/**'
- '/demo/**'
- '/test/**'
- '/webjars/**'
- '/front/**'
- '/h5/**'
- '/css/**'
- '/error'
- '/favicon.ico'
# 审计日志
audit-log:
# 审计日志存储
store: jdbc
# ip归属地
ip2region:
# 数据文件路径
file-path: /data/ip2region/ip2region.xdb
# 查询方式
search-type: cache
# 数据权限
data-perm:
# 需要符合AES密钥的要求
field-decrypt-key: "UCrtxSCwYZNCIlav"
# 文件上传
file-upload:
server-url: http://127.0.0.1:9000
# 自动建表 生产环境关闭
table-modify:
update-type: none
dromara:
#文件存储配置,
x-file-storage:
#默认使用的存储平台
default-platform: local
#缩略图后缀,例如【.min.jpg】【.png】
thumbnail-suffix: ".min.jpg"
local-plus:
# 不启用自带的访问映射, 使用自定义的访问实现
# 存储平台标识
- platform: local
enableStorage: true
# 文件存储路径
storage-path: D:/data/files/
# 支付系统配置
dax-pay:
# 服务地址
server-url: http://pay1.bootx.cn
# 前端h5地址
front-h5-url: http://pay1.bootx.cn/h5/#
# 前端web地址
front-web-url: http://pay1.bootx.cn/#
# 演示模块
demo:
# 网关地址
server-url: http://pay1.bootx.cn/server
# 前端h5地址
front-h5-url: http://pay1.bootx.cn/h5/#
# 签名秘钥
sign-secret: 123456
# 签名方式
sign-type: hmac_sha256

View File

@@ -0,0 +1,35 @@
spring:
application:
name: dax-pay-single
profiles:
active: dev
config:
use-legacy-processing: true
activate:
on-profile: dev
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
enabled: true
thymeleaf:
mode: LEGACYHTML5
# mp配置
mybatis-plus:
mapper-locations: classpath*:mapper/**/*Mapper.xml
global-config:
banner: false
db-config:
logic-delete-value: 1
logic-not-delete-value: 0
id-type: ASSIGN_ID
# 安全框架配置
sa-token:
is-print: false
token-name: AccessToken
# 短信配置
sms:
# 是否使用redis进行缓存 默认false
redis-cache: true
# 打印banner
is-print: false

View File

@@ -0,0 +1,12 @@
${AnsiColor.CYAN}
_ _
| | | |
| |__ ___ ___ | |_ __ __
| '_ \ / _ \ / _ \ | __|\ \/ /
| |_) || (_) || (_) || |_ > <
|_.__/ \___/ \___/ \__|/_/\_\
${AnsiColor.MAGENTA}
Service: dax-pay 支付开发平台
Spring Boot Version: ${spring-boot.version}
${AnsiColor.BLACK}

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<!--项目名称-->
<property name="appname" value="dax-pay-single"/>
<!--日志位置-->
<property name="logdir" value="logs"/>
<!-- 导入 -->
<include resource="cn/bootx/platform/common/log/logback-sensitive.xml"/>
<include resource="cn/bootx/platform/common/log/logback-console.xml"/>
<include resource="cn/bootx/platform/common/log/logback-log-file.xml"/>
<!-- plumelog Redis方式日志收集 -->
<!-- <appender name="plumelog" class="com.plumelog.logback.appender.LiteAppender">-->
<!-- <appName>${appname}</appName>-->
<!-- <plumelogHost>127.0.0.1</plumelogHost>-->
<!-- </appender>-->
<!-- 开发输出级别 -->
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="fileInfoLog"/>
</root>
</configuration>

View File

@@ -0,0 +1,43 @@
import cn.daxpay.single.service.core.order.pay.dao.PayOrderMapper;
import cn.daxpay.single.service.core.order.pay.entity.PayOrder;
import cn.daxpay.single.start.DaxpaySingleStart;
import cn.hutool.core.util.IdUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = DaxpaySingleStart.class)
@WebAppConfiguration
public class SprintBootAppTest {
@Resource
private PayOrderMapper payOrderMapper;
@Test
public void test2() {
long time = System.currentTimeMillis();
for (int a = 0; a < 10; a++) {
List<PayOrder> list = new ArrayList<>();
for (int i = 0; i <= 5000; i++) {
PayOrder payOrder = new PayOrder();
payOrder.setVersion(1);
payOrder.setDeleted(false);
payOrder.setStatus("fail");
payOrder.setId(IdUtil.getSnowflakeNextId());
list.add(payOrder);
}
payOrderMapper.insertList(list);
}
log.info("耗时:{}秒", (double) (System.currentTimeMillis() - time) / 1000);
}
}