diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/AliPayCode.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/AliPayCode.java index ae0d6874c..261a75dad 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/AliPayCode.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/AliPayCode.java @@ -10,10 +10,10 @@ public interface AliPayCode { // 认证类型 /** 公钥 */ - int AUTH_TYPE_KEY = 1; + String AUTH_TYPE_KEY = "key"; /** 证书 */ - int AUTH_TYPE_CART = 2; + String AUTH_TYPE_CART = "cart"; // 渠道枚举 /** 目前PC支付必填 */ diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/WalletCode.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/WalletCode.java index bb4bea7ef..0df236496 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/WalletCode.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/code/paymodel/WalletCode.java @@ -8,69 +8,62 @@ package cn.bootx.platform.daxpay.code.paymodel; */ public interface WalletCode { - /** - * 系统操作 - */ - int OPERATION_SOURCE_SYSTEM = 1; + /* 操作类型 */ + /** 系统操作 */ + String OPERATION_SOURCE_SYSTEM = "1"; - /** - * 管理员操作 - */ - int OPERATION_SOURCE_ADMIN = 2; + /** 管理员操作 */ + String OPERATION_SOURCE_ADMIN = ""; - /** - * 用户操作 - */ - int OPERATION_SOURCE_USER = 3; + /** 用户操作 */ + String OPERATION_SOURCE_USER = "3"; - /** - * 钱包状态-正常 - */ - int STATUS_NORMAL = 1; + /* 钱包状态 */ + /** 钱包状态-正常 */ + String STATUS_NORMAL = ""; - /** - * 钱包状态-禁用 - */ - int STATUS_FORBIDDEN = 2; + /** 钱包状态-禁用 */ + String STATUS_FORBIDDEN = ""; + /* 日志类型 */ /** * 钱包日志-开通 */ - int LOG_ACTIVE = 1; + String LOG_ACTIVE = ""; /** * 钱包日志-主动充值 */ - int LOG_RECHARGE = 2; + String LOG_RECHARGE = ""; /** * 钱包日志-自动充值 */ - int LOG_AUTO_RECHARGE = 3; + String LOG_AUTO_RECHARGE = ""; /** * 钱包日志-Admin余额变动 */ - int LOG_ADMIN_CHANGER = 4; + String LOG_ADMIN_CHANGER = ""; /** * 钱包日志-支付 */ - int LOG_PAY = 5; + String LOG_PAY = ""; /** * 钱包日志-系统扣除余额的日志 */ - int LOG_SYSTEM_REDUCE_BALANCE = 6; + String LOG_SYSTEM_REDUCE_BALANCE = ""; /** * 钱包日志-退款 */ - int LOG_REFUND = 7; + String LOG_REFUND = ""; /** * 钱包日志-取消支付返还 */ - int LOG_PAY_CLOSE = 8; + String LOG_PAY_CLOSE = ""; } diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/alipay/entity/AlipayConfig.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/alipay/entity/AlipayConfig.java index 8b034c629..7fd4a0ffa 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/alipay/entity/AlipayConfig.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/alipay/entity/AlipayConfig.java @@ -73,7 +73,7 @@ public class AlipayConfig extends MpBaseEntity implements EntityBaseFunction { /** * 更新钱包状态 */ - public void setUpStatus(Long walletId, int status) { + public void setUpStatus(Long walletId, String status) { lambdaUpdate().eq(Wallet::getId, walletId).set(Wallet::getStatus, status).update(); } diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/Wallet.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/Wallet.java index 8c27e49ae..5897bb876 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/Wallet.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/Wallet.java @@ -1,5 +1,7 @@ package cn.bootx.platform.daxpay.core.channel.wallet.entity; +import cn.bootx.mybatis.table.modify.annotation.DbColumn; +import cn.bootx.mybatis.table.modify.annotation.DbTable; import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.daxpay.core.channel.wallet.convert.WalletConvert; @@ -19,18 +21,25 @@ import java.math.BigDecimal; */ @EqualsAndHashCode(callSuper = true) @Data +@DbTable(comment = "钱包") @Accessors(chain = true) @TableName("pay_wallet") public class Wallet extends MpBaseEntity implements EntityBaseFunction { /** 关联用户id */ + @DbColumn(comment = "关联用户id") private Long userId; /** 余额 */ + @DbColumn(comment = "余额") private BigDecimal balance; + /** 预冻结额度 */ + @DbColumn(comment = "预冻结额度") + private BigDecimal freezeQuota; + /** 状态 */ - private Integer status; + private String status; @Override public WalletDto toDto() { diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletLog.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletLog.java index 2700b3188..27af92a94 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletLog.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletLog.java @@ -1,5 +1,7 @@ package cn.bootx.platform.daxpay.core.channel.wallet.entity; +import cn.bootx.mybatis.table.modify.annotation.DbColumn; +import cn.bootx.mybatis.table.modify.annotation.DbTable; import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.daxpay.core.channel.wallet.convert.WalletConvert; @@ -12,41 +14,54 @@ import lombok.experimental.Accessors; import java.math.BigDecimal; /** - * 钱包日志表 + * 钱包日志 * * @author xxm * @date 2020/12/8 */ @EqualsAndHashCode(callSuper = true) @Data +@DbTable(comment = "钱包日志") @Accessors(chain = true) @TableName("pay_wallet_log") public class WalletLog extends MpBaseEntity implements EntityBaseFunction { /** 钱包id */ + @DbColumn(comment = "钱包id") private Long walletId; /** 用户id */ + @DbColumn(comment = "用户id") private Long userId; /** 类型 */ - private Integer type; + @DbColumn(comment = "类型") + private String type; /** 交易记录ID */ + @DbColumn(comment = "交易记录ID") private Long paymentId; - /** 备注 */ - private String remark; - /** 业务ID */ + @DbColumn(comment = "业务ID") private String businessId; - /** 操作类型 */ - private int operationSource; + /** + * 操作类型 + * @see + */ + @DbColumn(comment = "操作类型") + private String operationSource; /** 金额 */ + @DbColumn(comment = "金额") private BigDecimal amount; + /** 备注 */ + @DbColumn(comment = "备注") + private String remark; + + @Override public WalletLogDto toDto() { return WalletConvert.CONVERT.convert(this); diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletPayment.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletPayment.java index 5e51938bb..76c2e10f0 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletPayment.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/entity/WalletPayment.java @@ -1,5 +1,6 @@ package cn.bootx.platform.daxpay.core.channel.wallet.entity; +import cn.bootx.mybatis.table.modify.annotation.DbTable; import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.daxpay.core.channel.base.entity.BasePayment; import cn.bootx.platform.daxpay.core.channel.wallet.convert.WalletConvert; @@ -17,6 +18,7 @@ import lombok.experimental.Accessors; */ @EqualsAndHashCode(callSuper = true) @Data +@DbTable(comment = "钱包交易记录") @Accessors(chain = true) @TableName("pay_wallet_payment") public class WalletPayment extends BasePayment implements EntityBaseFunction { diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/service/WalletService.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/service/WalletService.java index af70c73d0..13ef522bf 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/service/WalletService.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/core/channel/wallet/service/WalletService.java @@ -133,7 +133,7 @@ public class WalletService { } // 充值类型 - List chargeLogType = Lists.newArrayList(WalletCode.LOG_RECHARGE, WalletCode.LOG_AUTO_RECHARGE, + List chargeLogType = Lists.newArrayList(WalletCode.LOG_RECHARGE, WalletCode.LOG_AUTO_RECHARGE, WalletCode.LOG_ADMIN_CHANGER); // 保证是充值类型 且充值金额大于0 diff --git a/dax-pay/src/main/java/cn/bootx/platform/daxpay/dto/channel/wallet/WalletLogDto.java b/dax-pay/src/main/java/cn/bootx/platform/daxpay/dto/channel/wallet/WalletLogDto.java index dd3c83c68..81c05a3ca 100644 --- a/dax-pay/src/main/java/cn/bootx/platform/daxpay/dto/channel/wallet/WalletLogDto.java +++ b/dax-pay/src/main/java/cn/bootx/platform/daxpay/dto/channel/wallet/WalletLogDto.java @@ -33,7 +33,7 @@ public class WalletLogDto extends BaseDto implements Serializable { * @see WalletCode */ @Schema(description = "类型") - private Integer type; + private String type; @Schema(description = "交易记录ID") private Long paymentId; @@ -45,10 +45,10 @@ public class WalletLogDto extends BaseDto implements Serializable { private String businessId; /** - * @see WalletCode + * @see WalletCode#OPERATION_SOURCE_SYSTEM */ @Schema(description = " 1 系统操作 2管理员操作 3用户操作") - private Integer operationSource; + private String operationSource; @Schema(description = "金额") private BigDecimal amount; diff --git a/pom.xml b/pom.xml index 472ec8865..ad419c4e5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.11 + 2.7.13