feat:【pay 支付】增加 userid、usertype,并额外支持权限校验

This commit is contained in:
YunaiV
2025-07-27 19:18:04 +08:00
parent ae9e35f184
commit 8ffe9272e8
20 changed files with 143 additions and 27 deletions

View File

@@ -3,5 +3,6 @@ DELETE FROM pay_channel;
DELETE FROM pay_order;
DELETE FROM pay_order_extension;
DELETE FROM pay_refund;
DELETE FROM pay_transfer;
DELETE FROM pay_notify_task;
DELETE FROM pay_notify_log;

View File

@@ -45,6 +45,8 @@ CREATE TABLE IF NOT EXISTS `pay_order` (
`channel_fee_price` bigint(20) DEFAULT 0,
`status` tinyint(4) NOT NULL,
`user_ip` varchar(50) NOT NULL,
`user_id` bigint(20) DEFAULT NULL,
`user_type` tinyint(4) DEFAULT NULL,
`expire_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`success_time` datetime(0) DEFAULT CURRENT_TIMESTAMP,
`notify_time` datetime(0) DEFAULT CURRENT_TIMESTAMP,
@@ -97,6 +99,8 @@ CREATE TABLE IF NOT EXISTS `pay_refund` (
`refund_price` bigint(20) NOT NULL,
`reason` varchar(256) NOT NULL,
`user_ip` varchar(50) NULL DEFAULT NULL,
`user_id` bigint(20) NULL DEFAULT NULL,
`user_type` tinyint(4) NULL DEFAULT NULL,
`channel_order_no` varchar(64) NOT NULL,
`channel_refund_no` varchar(64) NULL DEFAULT NULL,
`success_time` datetime(0) NULL DEFAULT NULL,
@@ -145,3 +149,32 @@ CREATE TABLE IF NOT EXISTS `pay_notify_log` (
`deleted` bit(1) NOT NULL DEFAULT FALSE,
PRIMARY KEY ("id")
) COMMENT = '支付通知日志';
CREATE TABLE IF NOT EXISTS `pay_transfer` (
"id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY,
`no` varchar(64) NOT NULL,
`app_id` bigint(20) NOT NULL,
`channel_id` bigint(20) NOT NULL,
`channel_code` varchar(32) NOT NULL,
`user_id` bigint(20) NULL DEFAULT NULL,
`user_type` tinyint(4) NULL DEFAULT NULL,
`merchant_transfer_id` varchar(64) NOT NULL,
`price` bigint(20) NOT NULL,
`subject` varchar(256) NOT NULL,
`user_account` varchar(256) NOT NULL,
`user_name` varchar(64) NULL DEFAULT NULL,
`status` tinyint(4) NOT NULL,
`notify_url` varchar(1024) NULL DEFAULT NULL,
`channel_transfer_no` varchar(64) NULL DEFAULT NULL,
`success_time` datetime(0) NULL DEFAULT NULL,
`channel_error_code` varchar(128) NULL DEFAULT NULL,
`channel_error_msg` varchar(256) NULL DEFAULT NULL,
`channel_notify_data` varchar(1024) NULL DEFAULT NULL,
`channel_extras` varchar(1024) NULL DEFAULT NULL,
`creator` varchar(64) NULL DEFAULT '',
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updater` varchar(64) NULL DEFAULT '',
`update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` bit(1) NOT NULL DEFAULT FALSE,
PRIMARY KEY ("id")
) COMMENT = '转账单';