mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-09 14:36:00 +08:00
refactor(payment): 拆分 admin/gateway/merchant 三端独立 Maven 模块
- 新建 daxpay-payment-admin(运营管理端:23 controller + 12 admin service) - 新建 daxpay-payment-gateway(网关端:3 controller + 4 service) - 新建 daxpay-payment-merchant(商户自助端:9 controller) - 每端模块自带 @AutoConfiguration + @ComponentScan 装配,自包含可独立部署 - 公共层 daxpay-payment-common 瘦身为共享内核(交易引擎/主数据/商户领域模型) - 三端互不依赖,单向依赖公共层;daxpay-start 显式依赖三端模块 - MerchantAccessQueryService 上移到 common.service.query,消除 common→merchant 反向依赖 - WxVerifyGatewayController 改包名到 gateway.controller,让 gateway 模块自包含
This commit is contained in:
33
daxpay-payment/daxpay-payment-admin/pom.xml
Normal file
33
daxpay-payment/daxpay-payment-admin/pom.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment</artifactId>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>daxpay-payment-admin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>运营管理端(控制器 + 管理服务),依赖支付公共底座</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- lombok(provided 不传递,需显式声明) -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 支付公共底座(传递获得 spring-boot-starter-web / mapstruct / validation / platform 各模块) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package cn.daxpay.open.payment.admin;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/// # 运营管理端装配入口
|
||||
///
|
||||
/// 扫描 `cn.daxpay.open.payment.admin` 及其子包,注册管理端控制器与服务。
|
||||
/// 本模块依赖 `daxpay-payment-common` 公共底座,不反向被公共层依赖。
|
||||
@AutoConfiguration
|
||||
@ComponentScan
|
||||
public class DaxpayAdminApp {
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import cn.daxpay.open.payment.device.qrcode.param.DeviceQrCodeBindMerchantParam;
|
||||
import cn.daxpay.open.payment.device.qrcode.param.DeviceQrCodeParam;
|
||||
import cn.daxpay.open.payment.device.qrcode.param.DeviceQrCodeQuery;
|
||||
import cn.daxpay.open.payment.device.qrcode.result.DeviceQrCodeResult;
|
||||
import cn.daxpay.open.payment.merchant.dto.MchAppInfoAccessInfo;
|
||||
import cn.daxpay.open.payment.common.dto.MchAppInfoAccessInfo;
|
||||
import cn.daxpay.open.platform.common.mybatisplus.util.MpUtil;
|
||||
import cn.daxpay.open.platform.common.translate.service.TransService;
|
||||
import cn.daxpay.open.platform.core.code.CommonCode;
|
||||
@@ -0,0 +1 @@
|
||||
cn.daxpay.open.payment.admin.DaxpayAdminApp
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.daxpay.open.payment.merchant.dto;
|
||||
package cn.daxpay.open.payment.common.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.daxpay.open.payment.merchant.dto;
|
||||
package cn.daxpay.open.payment.common.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -7,7 +7,7 @@ import cn.daxpay.open.platform.capability.auth.entity.AuthInfoResult;
|
||||
import cn.daxpay.open.platform.capability.auth.entity.LoginAuthContext;
|
||||
import cn.daxpay.open.platform.capability.auth.exception.LoginFailureException;
|
||||
import cn.daxpay.open.platform.core.code.CommonCode;
|
||||
import cn.daxpay.open.payment.merchant.service.query.MerchantAccessQueryService;
|
||||
import cn.daxpay.open.payment.common.service.query.MerchantAccessQueryService;
|
||||
import cn.daxpay.open.payment.merchant.service.user.MerchantUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -9,9 +9,9 @@ import cn.daxpay.open.platform.core.exception.BizInfoException;
|
||||
import cn.daxpay.open.platform.core.exception.config.ConfigNotEnableException;
|
||||
import cn.daxpay.open.platform.iam.service.client.ClientCodeService;
|
||||
import cn.daxpay.open.payment.common.runtime.PaymentContext;
|
||||
import cn.daxpay.open.payment.merchant.dto.MchAppInfoAccessInfo;
|
||||
import cn.daxpay.open.payment.merchant.dto.MerchantAccessInfo;
|
||||
import cn.daxpay.open.payment.merchant.service.query.MerchantAccessQueryService;
|
||||
import cn.daxpay.open.payment.common.dto.MchAppInfoAccessInfo;
|
||||
import cn.daxpay.open.payment.common.dto.MerchantAccessInfo;
|
||||
import cn.daxpay.open.payment.common.service.query.MerchantAccessQueryService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -7,7 +7,7 @@ import cn.daxpay.open.platform.core.exception.business.VerifySignFailedException
|
||||
import cn.daxpay.open.payment.common.result.DaxResult;
|
||||
import cn.daxpay.open.payment.common.runtime.PaymentContext;
|
||||
import cn.daxpay.open.payment.common.util.PaySignUtil;
|
||||
import cn.daxpay.open.payment.merchant.service.query.MerchantAccessQueryService;
|
||||
import cn.daxpay.open.payment.common.service.query.MerchantAccessQueryService;
|
||||
import cn.daxpay.open.payment.unipay.param.PaymentCommonParam;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.daxpay.open.payment.merchant.service.query;
|
||||
package cn.daxpay.open.payment.common.service.query;
|
||||
|
||||
import cn.daxpay.open.payment.merchant.dto.MchAppInfoAccessInfo;
|
||||
import cn.daxpay.open.payment.merchant.dto.MerchantAccessInfo;
|
||||
import cn.daxpay.open.payment.common.dto.MchAppInfoAccessInfo;
|
||||
import cn.daxpay.open.payment.common.dto.MerchantAccessInfo;
|
||||
import cn.daxpay.open.payment.merchant.dao.appinfo.MchAppInfoManager;
|
||||
import cn.daxpay.open.payment.merchant.dao.config.MerchantCredentialManager;
|
||||
import cn.daxpay.open.payment.merchant.dao.info.MerchantInfoManager;
|
||||
@@ -21,7 +21,9 @@ import org.springframework.stereotype.Service;
|
||||
@RequiredArgsConstructor
|
||||
public class MerchantAccessQueryService {
|
||||
private final MerchantInfoManager merchantInfoManager;
|
||||
|
||||
private final MchAppInfoManager mchAppInfoManager;
|
||||
|
||||
private final MerchantCredentialManager merchantCredentialManager;
|
||||
|
||||
/// 根据商户号查询商户接入信息(引导用,忽略租户)
|
||||
@@ -4,8 +4,8 @@ import cn.daxpay.open.payment.device.enums.QrCodeStatusEnum;
|
||||
import cn.daxpay.open.payment.device.qrcode.dao.DeviceQrCodeManager;
|
||||
import cn.daxpay.open.payment.device.qrcode.entity.DeviceQrCode;
|
||||
import cn.daxpay.open.payment.device.qrcode.result.CodePayInfoResult;
|
||||
import cn.daxpay.open.payment.merchant.dto.MerchantAccessInfo;
|
||||
import cn.daxpay.open.payment.merchant.service.query.MerchantAccessQueryService;
|
||||
import cn.daxpay.open.payment.common.dto.MerchantAccessInfo;
|
||||
import cn.daxpay.open.payment.common.service.query.MerchantAccessQueryService;
|
||||
import cn.daxpay.open.platform.core.exception.DataNotExistException;
|
||||
import cn.daxpay.open.platform.core.exception.operation.OperationFailException;
|
||||
import cn.daxpay.open.platform.core.code.CommonCode;
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
/// # 商户API配置服务(配置态)
|
||||
///
|
||||
/// 管理端/商户端凭证查询与更新。须在已有租户上下文(登录 Filter / 运营端 ignoreTable)下调用。
|
||||
/// 网关验签取公钥请走 [cn.daxpay.open.payment.merchant.service.query.MerchantAccessQueryService]。
|
||||
/// 网关验签取公钥请走 [cn.daxpay.open.payment.common.service.query.MerchantAccessQueryService]。
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
|
||||
33
daxpay-payment/daxpay-payment-gateway/pom.xml
Normal file
33
daxpay-payment/daxpay-payment-gateway/pom.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment</artifactId>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>daxpay-payment-gateway</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>支付网关端(下单/退款/转账/查询/聚合支付的控制器与编排服务),依赖支付公共底座</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- lombok(provided 不传递,需显式声明) -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 支付公共底座(传递获得 spring-boot-starter-web / mapstruct / validation / platform 各模块) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package cn.daxpay.open.payment.gateway;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/// # 支付网关端装配入口
|
||||
///
|
||||
/// 扫描 `cn.daxpay.open.payment.gateway` 及其子包,注册网关端控制器与编排服务。
|
||||
/// 本模块依赖 `daxpay-payment-common` 公共底座,不反向被公共层依赖。
|
||||
@AutoConfiguration
|
||||
@ComponentScan
|
||||
public class DaxpayGatewayApp {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.daxpay.open.payment.merchant.controller.gateway;
|
||||
package cn.daxpay.open.payment.gateway.controller;
|
||||
|
||||
import cn.daxpay.open.payment.merchant.service.wxverify.WxDomainVerifyService;
|
||||
import cn.daxpay.open.platform.core.annotation.IgnoreAuth;
|
||||
@@ -0,0 +1 @@
|
||||
cn.daxpay.open.payment.gateway.DaxpayGatewayApp
|
||||
33
daxpay-payment/daxpay-payment-merchant/pom.xml
Normal file
33
daxpay-payment/daxpay-payment-merchant/pom.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment</artifactId>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>daxpay-payment-merchant</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<description>商户自助端(商户管理自己资源/订单的控制器),依赖支付公共底座</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- lombok(provided 不传递,需显式声明) -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 支付公共底座(传递获得 spring-boot-starter-web / mapstruct / validation / platform 各模块) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.daxpay.open.payment.merchant;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/// # 商户自助端装配入口
|
||||
///
|
||||
/// 扫描 `cn.daxpay.open.payment.merchant` 及其子包,注册商户自助控制器(controller/mch)。
|
||||
/// 本模块依赖 `daxpay-payment-common` 公共底座;商户领域 entity/dao/service 留公共层共享,
|
||||
/// 此处仅负责商户端 HTTP 接口的装配。
|
||||
@AutoConfiguration
|
||||
@ComponentScan
|
||||
public class DaxpayMerchantApp {
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
cn.daxpay.open.payment.merchant.DaxpayMerchantApp
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
<modules>
|
||||
<module>daxpay-payment-common</module>
|
||||
<module>daxpay-payment-admin</module>
|
||||
<module>daxpay-payment-gateway</module>
|
||||
<module>daxpay-payment-merchant</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -37,13 +37,34 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 支付服务和通用控制器(核心底座 + 运营端 + 商户端单模块) -->
|
||||
<!-- 支付公共底座(核心交易引擎 + 商户领域共享内核 + 网关订单模型) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 运营管理端(控制器 + 管理服务) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment-admin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 支付网关端(下单/退款/转账/查询/聚合支付) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment-gateway</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 商户自助端(商户管理自己资源/订单的控制器) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
<artifactId>daxpay-payment-merchant</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 功能演示模块(需隔离时注释此依赖即可从产物中剔除) -->
|
||||
<dependency>
|
||||
<groupId>cn.daxpay.open</groupId>
|
||||
|
||||
Reference in New Issue
Block a user