diff --git a/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/scheduler/PayNotifyAppJob.java b/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/scheduler/PayNotifyAppJob.java deleted file mode 100644 index 18ab2ebf2..000000000 --- a/pay/pay-application/src/main/java/cn/iocoder/mall/pay/application/scheduler/PayNotifyAppJob.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.iocoder.mall.pay.application.scheduler; - -/** - * TODO - */ -public class PayNotifyAppJob { - - // TODO 需要考虑下是基于 MQ 还是 Job - // TODO 通知频率 - // TODO rpc 泛化回调 - -} \ No newline at end of file diff --git a/pay/pay-service-impl/pom.xml b/pay/pay-service-impl/pom.xml index 0cc2d3487..4b892ecba 100644 --- a/pay/pay-service-impl/pom.xml +++ b/pay/pay-service-impl/pom.xml @@ -19,6 +19,7 @@ com.alibaba dubbo + compile cn.iocoder.mall @@ -66,6 +67,12 @@ jar + + com.xuxueli + xxl-job-core + 2.0.1 + + diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/AbstractPaySDK.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/AbstractPaySDK.java similarity index 82% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/AbstractPaySDK.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/AbstractPaySDK.java index ea2d25e35..1eb738b4e 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/AbstractPaySDK.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/AbstractPaySDK.java @@ -1,8 +1,8 @@ -package cn.iocoder.mall.pay.client; +package cn.iocoder.mall.pay.biz.client; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.pay.dataobject.PayTransactionDO; -import cn.iocoder.mall.pay.dataobject.PayTransactionExtensionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; import java.util.Map; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/PaySDKFactory.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/PaySDKFactory.java similarity index 93% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/PaySDKFactory.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/PaySDKFactory.java index 119bdca61..1efbebfcf 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/PaySDKFactory.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/PaySDKFactory.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.client; +package cn.iocoder.mall.pay.biz.client; import cn.iocoder.mall.pay.api.constant.PayChannelEnum; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/PingxxPaySDK.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/PingxxPaySDK.java similarity index 95% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/PingxxPaySDK.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/PingxxPaySDK.java index 74d838a2e..dd3f57843 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/PingxxPaySDK.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/PingxxPaySDK.java @@ -1,8 +1,8 @@ -package cn.iocoder.mall.pay.client; +package cn.iocoder.mall.pay.biz.client; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.pay.dataobject.PayTransactionDO; -import cn.iocoder.mall.pay.dataobject.PayTransactionExtensionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.common.collect.ImmutableMap; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/TransactionPaySuccessBO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/TransactionPaySuccessBO.java similarity index 96% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/TransactionPaySuccessBO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/TransactionPaySuccessBO.java index 97b420b57..c29e6fa4b 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/client/TransactionPaySuccessBO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/client/TransactionPaySuccessBO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.client; +package cn.iocoder.mall.pay.biz.client; import java.util.Date; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/config/DatabaseConfiguration.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/DatabaseConfiguration.java similarity index 80% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/config/DatabaseConfiguration.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/DatabaseConfiguration.java index 7d7097cea..ceac6e5b5 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/config/DatabaseConfiguration.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/DatabaseConfiguration.java @@ -1,11 +1,11 @@ -package cn.iocoder.mall.pay.config; +package cn.iocoder.mall.pay.biz.config; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Configuration; import org.springframework.transaction.annotation.EnableTransactionManagement; @Configuration -@MapperScan("cn.iocoder.mall.pay.dao") // 扫描对应的 Mapper 接口 +@MapperScan("cn.iocoder.mall.pay.biz.dao") // 扫描对应的 Mapper 接口 @EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600 public class DatabaseConfiguration { diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/config/ServiceExceptionConfiguration.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/ServiceExceptionConfiguration.java similarity index 96% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/config/ServiceExceptionConfiguration.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/ServiceExceptionConfiguration.java index f057ffbc7..d5ec450b3 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/config/ServiceExceptionConfiguration.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/ServiceExceptionConfiguration.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.config; +package cn.iocoder.mall.pay.biz.config; import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.mall.pay.api.constant.PayErrorCodeEnum; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/XxlJobConfiguration.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/XxlJobConfiguration.java new file mode 100644 index 000000000..5d5c84f9f --- /dev/null +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/config/XxlJobConfiguration.java @@ -0,0 +1,45 @@ +package cn.iocoder.mall.pay.biz.config; + +import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class XxlJobConfiguration { + + private Logger logger = LoggerFactory.getLogger(XxlJobConfiguration.class); + + @Value("${xxl.job.admin.addresses}") + private String adminAddresses; + @Value("${xxl.job.executor.appname}") + private String appName; + @Value("${xxl.job.executor.ip}") + private String ip; + @Value("${xxl.job.executor.port}") + private int port; + @Value("${xxl.job.accessToken}") + private String accessToken; + @Value("${xxl.job.executor.logpath}") + private String logPath; + @Value("${xxl.job.executor.logretentiondays}") + private int logRetentionDays; + + @Bean(initMethod = "start", destroyMethod = "destroy") + public XxlJobSpringExecutor xxlJobExecutor() { + logger.info(">>>>>>>>>>> xxl-job config init."); + XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); + xxlJobSpringExecutor.setAdminAddresses(adminAddresses); + xxlJobSpringExecutor.setAppName(appName); + xxlJobSpringExecutor.setIp(ip); + xxlJobSpringExecutor.setPort(port); + xxlJobSpringExecutor.setAccessToken(accessToken); + xxlJobSpringExecutor.setLogPath(logPath); + xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); + + return xxlJobSpringExecutor; + } + +} \ No newline at end of file diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/convert/PayTransactionConvert.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/convert/PayTransactionConvert.java similarity index 80% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/convert/PayTransactionConvert.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/convert/PayTransactionConvert.java index cc801afd6..10c2a395a 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/convert/PayTransactionConvert.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/convert/PayTransactionConvert.java @@ -1,10 +1,10 @@ -package cn.iocoder.mall.pay.convert; +package cn.iocoder.mall.pay.biz.convert; import cn.iocoder.mall.pay.api.bo.PayTransactionBO; import cn.iocoder.mall.pay.api.dto.PayTransactionCreateDTO; import cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO; -import cn.iocoder.mall.pay.dataobject.PayTransactionDO; -import cn.iocoder.mall.pay.dataobject.PayTransactionExtensionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; import org.mapstruct.Mapper; import org.mapstruct.Mappings; import org.mapstruct.factory.Mappers; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayAppMapper.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayAppMapper.java similarity index 68% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayAppMapper.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayAppMapper.java index c8138b027..aa9030ad6 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayAppMapper.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayAppMapper.java @@ -1,6 +1,6 @@ -package cn.iocoder.mall.pay.dao; +package cn.iocoder.mall.pay.biz.dao; -import cn.iocoder.mall.pay.dataobject.PayAppDO; +import cn.iocoder.mall.pay.biz.dataobject.PayAppDO; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionExtensionMapper.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionExtensionMapper.java similarity index 80% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionExtensionMapper.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionExtensionMapper.java index 128e8c042..57608370f 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionExtensionMapper.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionExtensionMapper.java @@ -1,6 +1,6 @@ -package cn.iocoder.mall.pay.dao; +package cn.iocoder.mall.pay.biz.dao; -import cn.iocoder.mall.pay.dataobject.PayTransactionExtensionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionMapper.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionMapper.java similarity index 84% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionMapper.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionMapper.java index 028daec61..0aa61f8d9 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionMapper.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionMapper.java @@ -1,6 +1,6 @@ -package cn.iocoder.mall.pay.dao; +package cn.iocoder.mall.pay.biz.dao; -import cn.iocoder.mall.pay.dataobject.PayTransactionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionNotifyTaskMapper.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionNotifyTaskMapper.java similarity index 67% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionNotifyTaskMapper.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionNotifyTaskMapper.java index cb6097010..13cd11036 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dao/PayTransactionNotifyTaskMapper.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dao/PayTransactionNotifyTaskMapper.java @@ -1,6 +1,6 @@ -package cn.iocoder.mall.pay.dao; +package cn.iocoder.mall.pay.biz.dao; -import cn.iocoder.mall.pay.dataobject.PayTransactionNotifyTaskDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionNotifyTaskDO; import org.springframework.stereotype.Repository; @Repository diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayAppDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayAppDO.java similarity index 95% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayAppDO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayAppDO.java index 3150d82c9..ffe97c920 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayAppDO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayAppDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.dataobject; +package cn.iocoder.mall.pay.biz.dataobject; import cn.iocoder.common.framework.dataobject.BaseDO; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayLogDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayLogDO.java similarity index 88% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayLogDO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayLogDO.java index d9aa2ef99..35ab44c83 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayLogDO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayLogDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.dataobject; +package cn.iocoder.mall.pay.biz.dataobject; /** * 交易日志 DO diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayRefundDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayRefundDO.java new file mode 100644 index 000000000..7f8664bbc --- /dev/null +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayRefundDO.java @@ -0,0 +1,4 @@ +package cn.iocoder.mall.pay.biz.dataobject; + +public class PayRefundDO { +} diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayRepeatTransactionDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayRepeatTransactionDO.java similarity index 74% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayRepeatTransactionDO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayRepeatTransactionDO.java index 23660a7d3..c94ab8810 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayRepeatTransactionDO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayRepeatTransactionDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.dataobject; +package cn.iocoder.mall.pay.biz.dataobject; /** * TODO 重复支付的交易 diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionDO.java similarity index 99% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionDO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionDO.java index 0556f0da4..96603fe33 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionDO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.dataobject; +package cn.iocoder.mall.pay.biz.dataobject; import cn.iocoder.common.framework.dataobject.BaseDO; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionExtensionDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionExtensionDO.java similarity index 98% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionExtensionDO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionExtensionDO.java index b396db16c..7699df12d 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionExtensionDO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionExtensionDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.dataobject; +package cn.iocoder.mall.pay.biz.dataobject; import cn.iocoder.common.framework.dataobject.BaseDO; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionNotifyLogDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionNotifyLogDO.java similarity index 96% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionNotifyLogDO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionNotifyLogDO.java index 3320eab8c..99646ecd1 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionNotifyLogDO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionNotifyLogDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.dataobject; +package cn.iocoder.mall.pay.biz.dataobject; import cn.iocoder.common.framework.dataobject.BaseDO; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionNotifyTaskDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionNotifyTaskDO.java similarity index 98% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionNotifyTaskDO.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionNotifyTaskDO.java index 5ed6d2253..f79475239 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayTransactionNotifyTaskDO.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/dataobject/PayTransactionNotifyTaskDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.dataobject; +package cn.iocoder.mall.pay.biz.dataobject; import cn.iocoder.common.framework.dataobject.BaseDO; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/scheduler/PayNotifyAppJob.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/scheduler/PayNotifyAppJob.java new file mode 100644 index 000000000..2d0a98b14 --- /dev/null +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/scheduler/PayNotifyAppJob.java @@ -0,0 +1,25 @@ +package cn.iocoder.mall.pay.biz.scheduler; + +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.IJobHandler; +import com.xxl.job.core.handler.annotation.JobHandler; +import org.springframework.stereotype.Component; + +/** + * TODO + */ +@Component +@JobHandler(value = "payNotifyAppJob") +public class PayNotifyAppJob extends IJobHandler { + + @Override + public ReturnT execute(String param) throws Exception { + System.out.println("1"); + return null; + } + + // TODO 需要考虑下是基于 MQ 还是 Job + // TODO 通知频率 + // TODO rpc 泛化回调 + +} \ No newline at end of file diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayAppServiceImpl.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayAppServiceImpl.java similarity index 87% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayAppServiceImpl.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayAppServiceImpl.java index 7bdee653f..0046ae678 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayAppServiceImpl.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayAppServiceImpl.java @@ -1,11 +1,11 @@ -package cn.iocoder.mall.pay.service; +package cn.iocoder.mall.pay.biz.service; import cn.iocoder.common.framework.constant.CommonStatusEnum; import cn.iocoder.common.framework.util.ServiceExceptionUtil; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.pay.api.constant.PayErrorCodeEnum; -import cn.iocoder.mall.pay.dao.PayAppMapper; -import cn.iocoder.mall.pay.dataobject.PayAppDO; +import cn.iocoder.mall.pay.biz.dao.PayAppMapper; +import cn.iocoder.mall.pay.biz.dataobject.PayAppDO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayDemoServiceImpl.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayDemoServiceImpl.java similarity index 88% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayDemoServiceImpl.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayDemoServiceImpl.java index b60fd451c..28957e51b 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayDemoServiceImpl.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayDemoServiceImpl.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.service; +package cn.iocoder.mall.pay.biz.service; import cn.iocoder.mall.pay.api.PayDemoService; import org.springframework.stereotype.Service; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayServiceImpl.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayServiceImpl.java similarity index 93% rename from pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayServiceImpl.java rename to pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayServiceImpl.java index 5893010a9..210310240 100644 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/service/PayServiceImpl.java +++ b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/biz/service/PayServiceImpl.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.pay.service; +package cn.iocoder.mall.pay.biz.service; import cn.iocoder.common.framework.util.DateUtil; import cn.iocoder.common.framework.util.MathUtil; @@ -12,17 +12,17 @@ import cn.iocoder.mall.pay.api.constant.PayTransactionNotifyStatusEnum; import cn.iocoder.mall.pay.api.constant.PayTransactionStatusEnum; import cn.iocoder.mall.pay.api.dto.PayTransactionCreateDTO; import cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO; -import cn.iocoder.mall.pay.client.AbstractPaySDK; -import cn.iocoder.mall.pay.client.PaySDKFactory; -import cn.iocoder.mall.pay.client.TransactionPaySuccessBO; -import cn.iocoder.mall.pay.convert.PayTransactionConvert; -import cn.iocoder.mall.pay.dao.PayTransactionExtensionMapper; -import cn.iocoder.mall.pay.dao.PayTransactionMapper; -import cn.iocoder.mall.pay.dao.PayTransactionNotifyTaskMapper; -import cn.iocoder.mall.pay.dataobject.PayAppDO; -import cn.iocoder.mall.pay.dataobject.PayTransactionDO; -import cn.iocoder.mall.pay.dataobject.PayTransactionExtensionDO; -import cn.iocoder.mall.pay.dataobject.PayTransactionNotifyTaskDO; +import cn.iocoder.mall.pay.biz.client.AbstractPaySDK; +import cn.iocoder.mall.pay.biz.client.PaySDKFactory; +import cn.iocoder.mall.pay.biz.client.TransactionPaySuccessBO; +import cn.iocoder.mall.pay.biz.convert.PayTransactionConvert; +import cn.iocoder.mall.pay.biz.dao.PayTransactionExtensionMapper; +import cn.iocoder.mall.pay.biz.dao.PayTransactionMapper; +import cn.iocoder.mall.pay.biz.dao.PayTransactionNotifyTaskMapper; +import cn.iocoder.mall.pay.biz.dataobject.PayAppDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionExtensionDO; +import cn.iocoder.mall.pay.biz.dataobject.PayTransactionNotifyTaskDO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayRefundDO.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayRefundDO.java deleted file mode 100644 index 39f2fe0d6..000000000 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/dataobject/PayRefundDO.java +++ /dev/null @@ -1,4 +0,0 @@ -package cn.iocoder.mall.pay.dataobject; - -public class PayRefundDO { -} diff --git a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/package-info.java b/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/package-info.java deleted file mode 100644 index b8ddbcd3b..000000000 --- a/pay/pay-service-impl/src/main/java/cn/iocoder/mall/pay/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.pay; \ No newline at end of file diff --git a/pay/pay-service-impl/src/main/resources/config/application.yaml b/pay/pay-service-impl/src/main/resources/config/application.yaml index d52a8aa39..2085220c5 100644 --- a/pay/pay-service-impl/src/main/resources/config/application.yaml +++ b/pay/pay-service-impl/src/main/resources/config/application.yaml @@ -10,7 +10,7 @@ spring: mybatis: config-location: classpath:mybatis-config.xml mapper-locations: classpath:mapper/*.xml - type-aliases-package: cn.iocoder.mall.pay.dataobject + type-aliases-package: cn.iocoder.mall.pay.biz.dataobject # dubbo dubbo: @@ -22,4 +22,18 @@ dubbo: port: -1 name: dubbo scan: - base-packages: cn.iocoder.mall.pay.service \ No newline at end of file + base-packages: cn.iocoder.mall.pay.biz.service + +# xxl-job + +xxl: + job: + admin: + addresses: http://127.0.0.1:8080/xxl-job-admin + executor: + appname: pay-job-executor + ip: + port: 0 + logpath: /Users/yunai/logs/xxl-job/ + logretentiondays: 1 + accessToken: \ No newline at end of file diff --git a/pay/pay-service-impl/src/main/resources/mapper/PayAppMapper.xml b/pay/pay-service-impl/src/main/resources/mapper/PayAppMapper.xml index 8d219ee9f..d5d2758e0 100644 --- a/pay/pay-service-impl/src/main/resources/mapper/PayAppMapper.xml +++ b/pay/pay-service-impl/src/main/resources/mapper/PayAppMapper.xml @@ -1,6 +1,6 @@ - + id, name, notify_url, status, create_time diff --git a/pay/pay-service-impl/src/main/resources/mapper/PayTransactionExtensionMapper.xml b/pay/pay-service-impl/src/main/resources/mapper/PayTransactionExtensionMapper.xml index 99363bd22..284b0cbde 100644 --- a/pay/pay-service-impl/src/main/resources/mapper/PayTransactionExtensionMapper.xml +++ b/pay/pay-service-impl/src/main/resources/mapper/PayTransactionExtensionMapper.xml @@ -1,6 +1,6 @@ - + id, transaction_id, pay_channel, transaction_code, extension_data, diff --git a/pay/pay-service-impl/src/main/resources/mapper/PayTransactionMapper.xml b/pay/pay-service-impl/src/main/resources/mapper/PayTransactionMapper.xml index e05647900..661b8c59b 100644 --- a/pay/pay-service-impl/src/main/resources/mapper/PayTransactionMapper.xml +++ b/pay/pay-service-impl/src/main/resources/mapper/PayTransactionMapper.xml @@ -1,6 +1,6 @@ - + id, app_id, create_ip, order_id, order_subject, diff --git a/pay/pay-service-impl/src/main/resources/mapper/PayTransactionNotifyTaskMapper.xml b/pay/pay-service-impl/src/main/resources/mapper/PayTransactionNotifyTaskMapper.xml index 3a5c8ecd7..aa5518426 100644 --- a/pay/pay-service-impl/src/main/resources/mapper/PayTransactionNotifyTaskMapper.xml +++ b/pay/pay-service-impl/src/main/resources/mapper/PayTransactionNotifyTaskMapper.xml @@ -1,6 +1,6 @@ - + id, transaction_id, transaction_extension_id, app_id, order_id,