feat 增加基础管理

This commit is contained in:
nws
2024-01-08 10:44:44 +08:00
parent 19296ffb15
commit a35c7010fc
47 changed files with 515 additions and 72 deletions

View File

@@ -51,6 +51,6 @@
- [ ] 支付平台全局性配置 - [ ] 支付平台全局性配置
- [ ] 微信消息通知相关配置 - [ ] 微信消息通知相关配置
- [ ] 钉钉消息通知配置 - [ ] 钉钉消息通知配置
- 支付宝接口升级为V3接口 - [ ] 支付宝接口升级为V3接口
- 微信支付接口更新为V3接口 - [ ] 微信支付接口更新为V3接口
- - [ ] 增加验签调试等功能的页面

View File

@@ -2,9 +2,9 @@ package cn.bootx.platform.daxpay.admin.controller.system;
import cn.bootx.platform.common.core.rest.Res; import cn.bootx.platform.common.core.rest.Res;
import cn.bootx.platform.common.core.rest.ResResult; import cn.bootx.platform.common.core.rest.ResResult;
import cn.bootx.platform.daxpay.service.core.system.service.PayApiConfigService; import cn.bootx.platform.daxpay.service.core.system.config.service.PayApiConfigService;
import cn.bootx.platform.daxpay.service.dto.system.PayApiConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.PayApiConfigDto;
import cn.bootx.platform.daxpay.service.param.system.PayApiConfigParam; import cn.bootx.platform.daxpay.service.param.system.config.PayApiConfigParam;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;

View File

@@ -0,0 +1,20 @@
package cn.bootx.platform.daxpay.admin.controller.system;
import cn.bootx.platform.daxpay.service.core.system.payinfo.service.PayChannelInfoService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Tag(name = "")
@RestController
@RequestMapping("/")
@RequiredArgsConstructor
public class PayChannelInfoController {
private final PayChannelInfoService payChannelInfoService;
}

View File

@@ -0,0 +1,20 @@
package cn.bootx.platform.daxpay.admin.controller.system;
import cn.bootx.platform.daxpay.service.core.system.payinfo.service.PayWayInfoService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Tag(name = "")
@RestController
@RequestMapping("/")
@RequiredArgsConstructor
public class PayWayInfoController {
private final PayWayInfoService payWayInfoService;
}

View File

@@ -2,9 +2,9 @@ package cn.bootx.platform.daxpay.admin.controller.system;
import cn.bootx.platform.common.core.rest.Res; import cn.bootx.platform.common.core.rest.Res;
import cn.bootx.platform.common.core.rest.ResResult; import cn.bootx.platform.common.core.rest.ResResult;
import cn.bootx.platform.daxpay.service.core.system.service.PlatformConfigService; import cn.bootx.platform.daxpay.service.core.system.config.service.PlatformConfigService;
import cn.bootx.platform.daxpay.service.dto.system.PlatformConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.PlatformConfigDto;
import cn.bootx.platform.daxpay.service.param.system.PlatformConfigParam; import cn.bootx.platform.daxpay.service.param.system.config.PlatformConfigParam;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;

View File

@@ -2,9 +2,9 @@ package cn.bootx.platform.daxpay.admin.controller.system;
import cn.bootx.platform.common.core.rest.Res; import cn.bootx.platform.common.core.rest.Res;
import cn.bootx.platform.common.core.rest.ResResult; import cn.bootx.platform.common.core.rest.ResResult;
import cn.bootx.platform.daxpay.service.core.system.service.WechatNoticeConfigService; import cn.bootx.platform.daxpay.service.core.system.config.service.WechatNoticeConfigService;
import cn.bootx.platform.daxpay.service.dto.system.WechatNoticeConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.WechatNoticeConfigDto;
import cn.bootx.platform.daxpay.service.param.system.WechatNoticeConfigParam; import cn.bootx.platform.daxpay.service.param.system.config.WechatNoticeConfigParam;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;

View File

@@ -33,7 +33,7 @@ public class AliPayCloseService {
* 关闭支付 此处使用交易关闭接口, 支付宝支持 交易关闭 和 交易撤销 两种关闭订单的方式, 区别如下 * 关闭支付 此处使用交易关闭接口, 支付宝支持 交易关闭 和 交易撤销 两种关闭订单的方式, 区别如下
* 交易关闭: 只有订单在未支付的状态下才可以进行关闭, 商户不需要额外申请就有此接口的权限 * 交易关闭: 只有订单在未支付的状态下才可以进行关闭, 商户不需要额外申请就有此接口的权限
* 交易撤销: 如果用户支付成功,会将此订单资金退还给用户. 限制时间为1天过了24小时该接口无法再使用。可以视为一个特殊的接口, 需要专门签约这个接口的权限 * 交易撤销: 如果用户支付成功,会将此订单资金退还给用户. 限制时间为1天过了24小时该接口无法再使用。可以视为一个特殊的接口, 需要专门签约这个接口的权限
* * <p>
* 1. 如果未查询到支付单,视为支付关闭, * 1. 如果未查询到支付单,视为支付关闭,
* 2. 如果返回"当前交易状态不支持此操作", 同步网关支付状态, 判断网关是否已经被关闭 * 2. 如果返回"当前交易状态不支持此操作", 同步网关支付状态, 判断网关是否已经被关闭
* *

View File

@@ -26,7 +26,7 @@ public class PaymentVerifySignAop {
private final PaymentSignService paymentSignService; private final PaymentSignService paymentSignService;
@Before("@annotation(paymentApi)") @Before("@annotation(paymentApi)")
public void beforeMethod(JoinPoint joinPoint, PaymentApi paymentApi) throws Throwable { public void beforeMethod(JoinPoint joinPoint, PaymentApi paymentApi) {
Object[] args = joinPoint.getArgs(); Object[] args = joinPoint.getArgs();
if (args.length == 0){ if (args.length == 0){
throw new PayFailureException("支付方法至少有一个参数,并且需要签名支付参数需要放在第一位"); throw new PayFailureException("支付方法至少有一个参数,并且需要签名支付参数需要放在第一位");

View File

@@ -4,8 +4,8 @@ import cn.bootx.platform.common.core.code.CommonCode;
import cn.bootx.platform.daxpay.service.common.context.PlatformLocal; import cn.bootx.platform.daxpay.service.common.context.PlatformLocal;
import cn.bootx.platform.daxpay.service.common.context.RequestLocal; import cn.bootx.platform.daxpay.service.common.context.RequestLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.system.entity.PlatformConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PlatformConfig;
import cn.bootx.platform.daxpay.service.core.system.service.PlatformConfigService; import cn.bootx.platform.daxpay.service.core.system.config.service.PlatformConfigService;
import cn.bootx.platform.daxpay.param.pay.PayCommonParam; import cn.bootx.platform.daxpay.param.pay.PayCommonParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@@ -1,8 +1,8 @@
package cn.bootx.platform.daxpay.service.core.system.convert; package cn.bootx.platform.daxpay.service.core.system.config.convert;
import cn.bootx.platform.daxpay.service.core.system.entity.PayApiConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PayApiConfig;
import cn.bootx.platform.daxpay.service.dto.system.PayApiConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.PayApiConfigDto;
import cn.bootx.platform.daxpay.service.param.system.PayApiConfigParam; import cn.bootx.platform.daxpay.service.param.system.config.PayApiConfigParam;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;

View File

@@ -1,7 +1,7 @@
package cn.bootx.platform.daxpay.service.core.system.convert; package cn.bootx.platform.daxpay.service.core.system.config.convert;
import cn.bootx.platform.daxpay.service.core.system.entity.PlatformConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PlatformConfig;
import cn.bootx.platform.daxpay.service.dto.system.PlatformConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.PlatformConfigDto;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;

View File

@@ -1,7 +1,7 @@
package cn.bootx.platform.daxpay.service.core.system.convert; package cn.bootx.platform.daxpay.service.core.system.config.convert;
import cn.bootx.platform.daxpay.service.core.system.entity.WechatNoticeConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.WechatNoticeConfig;
import cn.bootx.platform.daxpay.service.dto.system.WechatNoticeConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.WechatNoticeConfigDto;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;

View File

@@ -1,7 +1,7 @@
package cn.bootx.platform.daxpay.service.core.system.dao; package cn.bootx.platform.daxpay.service.core.system.config.dao;
import cn.bootx.platform.common.mybatisplus.impl.BaseManager; import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
import cn.bootx.platform.daxpay.service.core.system.entity.PayApiConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PayApiConfig;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;

View File

@@ -1,6 +1,6 @@
package cn.bootx.platform.daxpay.service.core.system.dao; package cn.bootx.platform.daxpay.service.core.system.config.dao;
import cn.bootx.platform.daxpay.service.core.system.entity.PayApiConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PayApiConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;

View File

@@ -1,7 +1,7 @@
package cn.bootx.platform.daxpay.service.core.system.dao; package cn.bootx.platform.daxpay.service.core.system.config.dao;
import cn.bootx.platform.common.mybatisplus.impl.BaseManager; import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
import cn.bootx.platform.daxpay.service.core.system.entity.PlatformConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PlatformConfig;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;

View File

@@ -1,6 +1,6 @@
package cn.bootx.platform.daxpay.service.core.system.dao; package cn.bootx.platform.daxpay.service.core.system.config.dao;
import cn.bootx.platform.daxpay.service.core.system.entity.PlatformConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PlatformConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;

View File

@@ -1,7 +1,7 @@
package cn.bootx.platform.daxpay.service.core.system.dao; package cn.bootx.platform.daxpay.service.core.system.config.dao;
import cn.bootx.platform.common.mybatisplus.impl.BaseManager; import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
import cn.bootx.platform.daxpay.service.core.system.entity.WechatNoticeConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.WechatNoticeConfig;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;

View File

@@ -1,6 +1,6 @@
package cn.bootx.platform.daxpay.service.core.system.dao; package cn.bootx.platform.daxpay.service.core.system.config.dao;
import cn.bootx.platform.daxpay.service.core.system.entity.WechatNoticeConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.WechatNoticeConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.core.system.entity; package cn.bootx.platform.daxpay.service.core.system.config.entity;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.annotation.DbTable;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.core.system.entity; package cn.bootx.platform.daxpay.service.core.system.config.entity;
import cn.bootx.platform.common.mybatisplus.base.MpCreateEntity; import cn.bootx.platform.common.mybatisplus.base.MpCreateEntity;
import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.annotation.DbTable;

View File

@@ -1,9 +1,9 @@
package cn.bootx.platform.daxpay.service.core.system.entity; package cn.bootx.platform.daxpay.service.core.system.config.entity;
import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.core.function.EntityBaseFunction;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
import cn.bootx.platform.daxpay.service.core.system.convert.PayApiConfigConvert; import cn.bootx.platform.daxpay.service.core.system.config.convert.PayApiConfigConvert;
import cn.bootx.platform.daxpay.service.dto.system.PayApiConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.PayApiConfigDto;
import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbColumn;
import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.annotation.DbTable;
import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.FieldStrategy;

View File

@@ -1,10 +1,10 @@
package cn.bootx.platform.daxpay.service.core.system.entity; package cn.bootx.platform.daxpay.service.core.system.config.entity;
import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.core.function.EntityBaseFunction;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
import cn.bootx.platform.daxpay.code.PaySignTypeEnum; import cn.bootx.platform.daxpay.code.PaySignTypeEnum;
import cn.bootx.platform.daxpay.service.core.system.convert.PlatformConfigConvert; import cn.bootx.platform.daxpay.service.core.system.config.convert.PlatformConfigConvert;
import cn.bootx.platform.daxpay.service.dto.system.PlatformConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.PlatformConfigDto;
import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbColumn;
import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.annotation.DbTable;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;

View File

@@ -1,9 +1,9 @@
package cn.bootx.platform.daxpay.service.core.system.entity; package cn.bootx.platform.daxpay.service.core.system.config.entity;
import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.core.function.EntityBaseFunction;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
import cn.bootx.platform.daxpay.service.core.system.convert.WechatNoticeConfigConvert; import cn.bootx.platform.daxpay.service.core.system.config.convert.WechatNoticeConfigConvert;
import cn.bootx.platform.daxpay.service.dto.system.WechatNoticeConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.WechatNoticeConfigDto;
import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbColumn;
import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.annotation.DbTable;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;

View File

@@ -1,13 +1,13 @@
package cn.bootx.platform.daxpay.service.core.system.service; package cn.bootx.platform.daxpay.service.core.system.config.service;
import cn.bootx.platform.common.core.exception.DataNotExistException; import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.common.core.util.ResultConvertUtil; import cn.bootx.platform.common.core.util.ResultConvertUtil;
import cn.bootx.platform.daxpay.service.common.context.ApiInfoLocal; import cn.bootx.platform.daxpay.service.common.context.ApiInfoLocal;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.system.dao.PayApiConfigManager; import cn.bootx.platform.daxpay.service.core.system.config.dao.PayApiConfigManager;
import cn.bootx.platform.daxpay.service.core.system.entity.PayApiConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PayApiConfig;
import cn.bootx.platform.daxpay.service.dto.system.PayApiConfigDto; import cn.bootx.platform.daxpay.service.dto.system.config.PayApiConfigDto;
import cn.bootx.platform.daxpay.service.param.system.PayApiConfigParam; import cn.bootx.platform.daxpay.service.param.system.config.PayApiConfigParam;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@@ -1,9 +1,9 @@
package cn.bootx.platform.daxpay.service.core.system.service; package cn.bootx.platform.daxpay.service.core.system.config.service;
import cn.bootx.platform.common.core.exception.DataNotExistException; import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.daxpay.service.core.system.dao.PlatformConfigManager; import cn.bootx.platform.daxpay.service.core.system.config.entity.PlatformConfig;
import cn.bootx.platform.daxpay.service.core.system.entity.PlatformConfig; import cn.bootx.platform.daxpay.service.core.system.config.dao.PlatformConfigManager;
import cn.bootx.platform.daxpay.service.param.system.PlatformConfigParam; import cn.bootx.platform.daxpay.service.param.system.config.PlatformConfigParam;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@@ -1,9 +1,9 @@
package cn.bootx.platform.daxpay.service.core.system.service; package cn.bootx.platform.daxpay.service.core.system.config.service;
import cn.bootx.platform.common.core.exception.DataNotExistException; import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.daxpay.service.core.system.dao.WechatNoticeConfigManager; import cn.bootx.platform.daxpay.service.core.system.config.entity.WechatNoticeConfig;
import cn.bootx.platform.daxpay.service.core.system.entity.WechatNoticeConfig; import cn.bootx.platform.daxpay.service.core.system.config.dao.WechatNoticeConfigManager;
import cn.bootx.platform.daxpay.service.param.system.WechatNoticeConfigParam; import cn.bootx.platform.daxpay.service.param.system.config.WechatNoticeConfigParam;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@@ -0,0 +1,21 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.convert;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayChannelInfo;
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayChannelInfoDto;
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayChannelInfoParam;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Mapper
public interface PayChannelInfoConvert {
PayChannelInfoConvert CONVERT = Mappers.getMapper(PayChannelInfoConvert.class);
PayChannelInfo convert(PayChannelInfoParam in);
PayChannelInfoDto convert(PayChannelInfo in);
}

View File

@@ -0,0 +1,21 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.convert;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayWayInfo;
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayWayInfoDto;
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayWayInfoParam;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Mapper
public interface PayWayInfoConvert {
PayWayInfoConvert CONVERT = Mappers.getMapper(PayWayInfoConvert.class);
PayWayInfo convert(PayWayInfoParam in);
PayWayInfoDto convert(PayWayInfo in);
}

View File

@@ -0,0 +1,18 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.dao;
import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayChannelInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Slf4j
@Repository
@RequiredArgsConstructor
public class PayChannelInfoManager extends BaseManager<PayChannelInfoMapper, PayChannelInfo> {
}

View File

@@ -0,0 +1,14 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.dao;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayChannelInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Mapper
public interface PayChannelInfoMapper extends BaseMapper<PayChannelInfo> {
}

View File

@@ -0,0 +1,18 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.dao;
import cn.bootx.platform.common.mybatisplus.impl.BaseManager;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayWayInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Slf4j
@Repository
@RequiredArgsConstructor
public class PayWayInfoManager extends BaseManager<PayWayInfoMapper, PayWayInfo> {
}

View File

@@ -0,0 +1,14 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.dao;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayWayInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Mapper
public interface PayWayInfoMapper extends BaseMapper<PayWayInfo> {
}

View File

@@ -0,0 +1,64 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.entity;
import cn.bootx.platform.common.core.function.EntityBaseFunction;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
import cn.bootx.platform.daxpay.service.core.system.payinfo.convert.PayChannelInfoConvert;
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayChannelInfoDto;
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayChannelInfoParam;
import cn.bootx.table.modify.annotation.DbColumn;
import cn.bootx.table.modify.annotation.DbTable;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 支付通道
* 都是在代码中定义好的,界面上只做展示和部分信息的修改用,不可以进行增删相关的操作
* @author xxm
* @since 2024/1/8
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@DbTable(comment = "支付通道信息")
@TableName("pay_channel_info")
public class PayChannelInfo extends MpBaseEntity implements EntityBaseFunction<PayChannelInfoDto> {
/** 需要与系统中配置的枚举一致 */
@DbColumn(comment = "代码")
@TableField(updateStrategy = FieldStrategy.NEVER)
private String code;
/** 需要与系统中配置的枚举一致 */
@DbColumn(comment = "名称")
@TableField(updateStrategy = FieldStrategy.NEVER)
private String name;
/** logo图片 */
@DbColumn(comment = "ICON")
private Long iconId;
/** 卡牌背景色 */
@DbColumn(comment = "卡牌背景色")
private String bgColor;
/** 备注 */
@DbColumn(comment = "备注")
private String remark;
public static PayChannelInfo init(PayChannelInfoParam in){
return PayChannelInfoConvert.CONVERT.convert(in);
}
/**
* 转换
*/
@Override
public PayChannelInfoDto toDto() {
return PayChannelInfoConvert.CONVERT.convert(this);
}
}

View File

@@ -0,0 +1,50 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.entity;
import cn.bootx.platform.common.core.function.EntityBaseFunction;
import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity;
import cn.bootx.platform.daxpay.service.core.system.payinfo.convert.PayWayInfoConvert;
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayWayInfoDto;
import cn.bootx.table.modify.annotation.DbColumn;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 支付方式
* 都是在代码中定义好的,界面上只做展示用,不可以进行增删相关的操作
* @author xxm
* @since 2024/1/8
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class PayWayInfo extends MpBaseEntity implements EntityBaseFunction<PayWayInfoDto> {
/** 需要与系统中配置的枚举一致 */
@DbColumn(comment = "代码")
@TableField(updateStrategy = FieldStrategy.NEVER)
private String code;
/** 需要与系统中配置的枚举一致 */
@DbColumn(comment = "名称")
@TableField(updateStrategy = FieldStrategy.NEVER)
private String name;
/** 备注 */
@DbColumn(comment = "备注")
private String remark;
public static PayWayInfoDto convert(PayWayInfo in) {
return PayWayInfoConvert.CONVERT.convert(in);
}
/**
* 转换
*/
@Override
public PayWayInfoDto toDto() {
return PayWayInfoConvert.CONVERT.convert(this);
}
}

View File

@@ -0,0 +1,53 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.service;
import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.common.core.util.ResultConvertUtil;
import cn.bootx.platform.daxpay.service.core.system.payinfo.dao.PayChannelInfoManager;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayChannelInfo;
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayChannelInfoDto;
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayChannelInfoParam;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 支付通道信息
* @author xxm
* @since 2024/1/8
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class PayChannelInfoService {
private final PayChannelInfoManager manager;
/**
* 列表
*/
public List<PayChannelInfoDto> list(){
return manager.findAll().stream()
.map(PayChannelInfo::toDto)
.collect(Collectors.toList());
}
/**
* 单条
*/
public PayChannelInfoDto findById(Long id){
return ResultConvertUtil.dtoConvert(manager.findById(id));
}
/**
* 更新
*/
public void update(PayChannelInfoParam param){
PayChannelInfo info = manager.findById(param.getId()).orElseThrow(DataNotExistException::new);
BeanUtil.copyProperties(param,info, CopyOptions.create().ignoreNullValue());
manager.updateById(info);
}
}

View File

@@ -0,0 +1,53 @@
package cn.bootx.platform.daxpay.service.core.system.payinfo.service;
import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.common.core.util.ResultConvertUtil;
import cn.bootx.platform.daxpay.service.core.system.payinfo.dao.PayWayInfoManager;
import cn.bootx.platform.daxpay.service.core.system.payinfo.entity.PayWayInfo;
import cn.bootx.platform.daxpay.service.dto.system.payinfo.PayWayInfoDto;
import cn.bootx.platform.daxpay.service.param.system.payinfo.PayWayInfoParam;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 支付方式信息
* @author xxm
* @since 2024/1/8
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class PayWayInfoService {
private final PayWayInfoManager manager;
/**
* 列表
*/
public List<PayWayInfoDto> list(){
return manager.findAll().stream()
.map(PayWayInfo::toDto)
.collect(Collectors.toList());
}
/**
* 单条
*/
public PayWayInfoDto findById(Long id){
return ResultConvertUtil.dtoConvert(manager.findById(id));
}
/**
* 更新
*/
public void update(PayWayInfoParam param){
PayWayInfo info = manager.findById(param.getId()).orElseThrow(DataNotExistException::new);
BeanUtil.copyProperties(param,info, CopyOptions.create().ignoreNullValue());
manager.updateById(info);
}
}

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.dto.system; package cn.bootx.platform.daxpay.service.dto.system.config;
import cn.bootx.platform.common.core.rest.dto.BaseDto; import cn.bootx.platform.common.core.rest.dto.BaseDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.dto.system; package cn.bootx.platform.daxpay.service.dto.system.config;
import cn.bootx.platform.daxpay.code.PaySignTypeEnum; import cn.bootx.platform.daxpay.code.PaySignTypeEnum;
import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbColumn;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.dto.system; package cn.bootx.platform.daxpay.service.dto.system.config;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;

View File

@@ -0,0 +1,20 @@
package cn.bootx.platform.daxpay.service.dto.system.payinfo;
import cn.bootx.platform.common.core.rest.dto.BaseDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
*
* @author xxm
* @since 2024/1/8
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@Schema(title = "")
public class PayChannelInfoDto extends BaseDto {
}

View File

@@ -0,0 +1,19 @@
package cn.bootx.platform.daxpay.service.dto.system.payinfo;
import cn.bootx.platform.common.core.rest.dto.BaseDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
*
* @author xxm
* @since 2024/1/8
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@Schema(title = "")
public class PayWayInfoDto extends BaseDto {
}

View File

@@ -1,12 +1,12 @@
package cn.bootx.platform.daxpay.service.core.system.handler; package cn.bootx.platform.daxpay.service.handler;
import cn.bootx.platform.common.core.exception.DataNotExistException; import cn.bootx.platform.common.core.exception.DataNotExistException;
import cn.bootx.platform.daxpay.service.annotation.PaymentApi; import cn.bootx.platform.daxpay.service.annotation.PaymentApi;
import cn.bootx.platform.daxpay.service.common.context.PaymentContext; import cn.bootx.platform.daxpay.service.common.context.PaymentContext;
import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal;
import cn.bootx.platform.daxpay.service.core.system.dao.PayApiConfigManager; import cn.bootx.platform.daxpay.service.core.system.config.dao.PayApiConfigManager;
import cn.bootx.platform.daxpay.service.core.system.entity.PayApiConfig; import cn.bootx.platform.daxpay.service.core.system.config.entity.PayApiConfig;
import cn.bootx.platform.daxpay.service.core.system.service.PayApiConfigService; import cn.bootx.platform.daxpay.service.core.system.config.service.PayApiConfigService;
import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import cn.bootx.platform.daxpay.exception.pay.PayFailureException;
import cn.bootx.platform.starter.auth.service.RouterCheck; import cn.bootx.platform.starter.auth.service.RouterCheck;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.param.system; package cn.bootx.platform.daxpay.service.param.system.config;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.param.system; package cn.bootx.platform.daxpay.service.param.system.config;
import cn.bootx.platform.daxpay.code.PaySignTypeEnum; import cn.bootx.platform.daxpay.code.PaySignTypeEnum;
import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbColumn;

View File

@@ -1,4 +1,4 @@
package cn.bootx.platform.daxpay.service.param.system; package cn.bootx.platform.daxpay.service.param.system.config;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;

View File

@@ -0,0 +1,19 @@
package cn.bootx.platform.daxpay.service.param.system.payinfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Data
@Accessors(chain = true)
@Schema(title = "")
public class PayChannelInfoParam {
@Schema(description= "主键")
private Long id;
}

View File

@@ -0,0 +1,19 @@
package cn.bootx.platform.daxpay.service.param.system.payinfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
/**
*
* @author xxm
* @since 2024/1/8
*/
@Data
@Accessors(chain = true)
@Schema(title = "")
public class PayWayInfoParam {
@Schema(description= "主键")
private Long id;
}