feat: 功能优化
This commit is contained in:
@@ -294,3 +294,72 @@ CREATE TABLE `member_user_permission` (
|
||||
KEY `idx_package_id` (`package_id`) USING BTREE,
|
||||
KEY `idx_validity_end` (`validity_end`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户权限表';
|
||||
|
||||
-- ===============================================
|
||||
-- 5. 兑换码模块
|
||||
-- ===============================================
|
||||
|
||||
-- ===============================================
|
||||
-- 5.1 菜单配置(需要在后台手动添加或执行以下 SQL)
|
||||
-- 注意:parent_id 需要根据实际情况调整,这里假设 muye 积分管理的 parent_id 为 5000
|
||||
-- ===============================================
|
||||
|
||||
-- 兑换码管理菜单(目录)
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5010, '兑换码管理', '', 2, 10, 5000, 'redeemcode', 'ep:tickets', 'muye/redeemcode/index', 'RedeemCode', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 兑换码查询
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5011, '兑换码查询', 'muye:redeem-code:query', 3, 1, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 兑换码创建
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5012, '兑换码创建', 'muye:redeem-code:create', 3, 2, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 兑换码删除
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5013, '兑换码删除', 'muye:redeem-code:delete', 3, 3, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 兑换码导出
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5014, '兑换码导出', 'muye:redeem-code:export', 3, 4, 5010, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 兑换记录菜单
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5020, '兑换记录', '', 2, 11, 5000, 'redeemrecord', 'ep:document', 'muye/redeemrecord/index', 'RedeemRecord', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 兑换记录查询
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5021, '兑换记录查询', 'muye:redeem-record:query', 3, 1, 5020, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 兑换记录导出
|
||||
-- INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
-- VALUES (5022, '兑换记录导出', 'muye:redeem-record:export', 3, 2, 5020, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0')
|
||||
|
||||
-- 兑换码表
|
||||
CREATE TABLE `muye_redemption_code` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`code` varchar(32) NOT NULL COMMENT '兑换码',
|
||||
`type` varchar(20) NOT NULL DEFAULT 'points' COMMENT '类型: points-积分',
|
||||
`amount` int NOT NULL COMMENT '面额(积分数)',
|
||||
`price` decimal(10,2) DEFAULT NULL COMMENT '原价金额(元)',
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态: 0-未使用 1-已使用 2-已过期',
|
||||
`batch_no` varchar(32) DEFAULT NULL COMMENT '批次号',
|
||||
`batch_remark` varchar(200) DEFAULT NULL COMMENT '批次备注',
|
||||
`user_id` bigint DEFAULT NULL COMMENT '使用者用户ID',
|
||||
`used_time` datetime DEFAULT NULL COMMENT '使用时间',
|
||||
`expire_time` datetime DEFAULT NULL COMMENT '过期时间',
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_code` (`code`) USING BTREE,
|
||||
KEY `idx_tenant_id` (`tenant_id`) USING BTREE,
|
||||
KEY `idx_batch_no` (`batch_no`) USING BTREE,
|
||||
KEY `idx_status` (`status`) USING BTREE,
|
||||
KEY `idx_user_id` (`user_id`) USING BTREE,
|
||||
KEY `idx_expire_time` (`expire_time`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='兑换码表';
|
||||
|
||||
41
sql/mysql/benchmark_task_tables.sql
Normal file
41
sql/mysql/benchmark_task_tables.sql
Normal file
@@ -0,0 +1,41 @@
|
||||
-- 对标分析异步任务表
|
||||
-- 执行前请确认数据库名称
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `muye_benchmark_task` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
|
||||
`user_id` bigint NOT NULL COMMENT '用户ID',
|
||||
|
||||
-- 任务信息
|
||||
`task_name` varchar(200) NOT NULL COMMENT '任务名称',
|
||||
`video_count` int NOT NULL DEFAULT 0 COMMENT '视频数量',
|
||||
`video_urls` text COMMENT '视频URL列表(JSON)',
|
||||
|
||||
-- 执行状态
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '任务状态:0-待处理 1-处理中 2-成功 3-失败',
|
||||
`progress` int NOT NULL DEFAULT 0 COMMENT '进度(0-100)',
|
||||
|
||||
-- 执行结果
|
||||
`merged_text` longtext COMMENT '合并后的转写文本',
|
||||
`generated_prompt` longtext COMMENT '生成的提示词',
|
||||
`prompt_id` bigint DEFAULT NULL COMMENT '保存后的提示词ID',
|
||||
|
||||
-- 错误信息
|
||||
`error_msg` varchar(1000) DEFAULT NULL COMMENT '错误信息',
|
||||
|
||||
-- 时间戳
|
||||
`start_time` datetime DEFAULT NULL COMMENT '开始时间',
|
||||
`finish_time` datetime DEFAULT NULL COMMENT '完成时间',
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_status` (`status`),
|
||||
KEY `idx_create_time` (`create_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='对标分析异步任务表';
|
||||
|
||||
-- 同步到 DO 类的 @TableName
|
||||
45
sql/mysql/redeem_code_menu.sql
Normal file
45
sql/mysql/redeem_code_menu.sql
Normal file
@@ -0,0 +1,45 @@
|
||||
-- ===============================================
|
||||
-- 兑换码管理菜单配置 SQL
|
||||
-- 注意:parent_id 需要根据实际情况调整
|
||||
-- 请先查询 muye 积分管理的 parent_id: SELECT id FROM system_menu WHERE name = '积分管理';
|
||||
-- ===============================================
|
||||
|
||||
-- 假设 muye 积分管理的 parent_id 为 5000,请根据实际情况修改
|
||||
|
||||
-- 1. 兑换码管理菜单(目录)
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换码管理', '', 2, 20, 0, 'redeemcode', 'ep:tickets', 'muye/redeemcode/index', 'RedeemCode', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 获取刚插入的菜单ID(兑换码管理)
|
||||
SET @redeem_code_menu_id = LAST_INSERT_ID();
|
||||
|
||||
-- 1.1 兑换码查询
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换码查询', 'muye:redeem-code:query', 3, 1, @redeem_code_menu_id, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 1.2 兑换码创建
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换码创建', 'muye:redeem-code:create', 3, 2, @redeem_code_menu_id, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 1.3 兑换码删除
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换码删除', 'muye:redeem-code:delete', 3, 3, @redeem_code_menu_id, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 1.4 兑换码导出
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换码导出', 'muye:redeem-code:export', 3, 4, @redeem_code_menu_id, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 2. 兑换记录菜单(目录)
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换记录', '', 2, 21, 0, 'redeemrecord', 'ep:document', 'muye/redeemrecord/index', 'RedeemRecord', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 获取刚插入的菜单ID(兑换记录)
|
||||
SET @redeem_record_menu_id = LAST_INSERT_ID();
|
||||
|
||||
-- 2.1 兑换记录查询
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换记录查询', 'muye:redeem-record:query', 3, 1, @redeem_record_menu_id, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
|
||||
-- 2.2 兑换记录导出
|
||||
INSERT INTO `system_menu` (`name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
|
||||
VALUES ('兑换记录导出', 'muye:redeem-record:export', 3, 2, @redeem_record_menu_id, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0');
|
||||
58
sql/mysql/redeem_code_tables.sql
Normal file
58
sql/mysql/redeem_code_tables.sql
Normal file
@@ -0,0 +1,58 @@
|
||||
-- ===============================================
|
||||
-- 兑换码系统建表 SQL
|
||||
-- 执行此文件前请确保数据库连接正确
|
||||
-- ===============================================
|
||||
|
||||
-- 1. 兑换码表
|
||||
CREATE TABLE IF NOT EXISTS `muye_redeem_code` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`code` varchar(32) NOT NULL COMMENT '兑换码',
|
||||
`code_type` tinyint NOT NULL DEFAULT 1 COMMENT '码类型: 1-单次 2-多次',
|
||||
`points` int NOT NULL COMMENT '积分数',
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态: 0-未使用 1-已使用 2-已过期 3-已禁用',
|
||||
`batch_no` varchar(32) DEFAULT NULL COMMENT '批次号',
|
||||
`source` varchar(50) DEFAULT NULL COMMENT '来源',
|
||||
`max_use_count` int NOT NULL DEFAULT 1 COMMENT '最大使用次数',
|
||||
`used_count` int NOT NULL DEFAULT 0 COMMENT '已使用次数',
|
||||
`user_id` bigint DEFAULT NULL COMMENT '使用者用户ID',
|
||||
`used_time` datetime DEFAULT NULL COMMENT '使用时间',
|
||||
`expire_time` datetime DEFAULT NULL COMMENT '过期时间',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`operator_id` bigint DEFAULT NULL COMMENT '操作人ID',
|
||||
`operator_name` varchar(64) DEFAULT NULL COMMENT '操作人名称',
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_code` (`code`) USING BTREE,
|
||||
KEY `idx_tenant_id` (`tenant_id`) USING BTREE,
|
||||
KEY `idx_batch_no` (`batch_no`) USING BTREE,
|
||||
KEY `idx_status` (`status`) USING BTREE,
|
||||
KEY `idx_user_id` (`user_id`) USING BTREE,
|
||||
KEY `idx_expire_time` (`expire_time`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='兑换码表';
|
||||
|
||||
-- 2. 兑换记录表
|
||||
CREATE TABLE IF NOT EXISTS `muye_redeem_record` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
`user_id` bigint NOT NULL DEFAULT 0 COMMENT '用户编号',
|
||||
`mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号',
|
||||
`code_id` bigint NOT NULL DEFAULT 0 COMMENT '兑换码ID',
|
||||
`code` varchar(32) NOT NULL COMMENT '兑换码',
|
||||
`points` int NOT NULL DEFAULT 0 COMMENT '获得积分',
|
||||
`balance_after` int NOT NULL DEFAULT 0 COMMENT '兑换后积分余额',
|
||||
`source` varchar(50) NOT NULL DEFAULT '' COMMENT '来源',
|
||||
`source_id` varchar(64) NOT NULL DEFAULT '' COMMENT '来源关联ID',
|
||||
`remark` varchar(500) NOT NULL DEFAULT '' COMMENT '备注',
|
||||
`creator` varchar(64) NOT NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_tenant_id` (`tenant_id`) USING BTREE,
|
||||
KEY `idx_user_id` (`user_id`) USING BTREE,
|
||||
KEY `idx_code_id` (`code_id`) USING BTREE,
|
||||
KEY `idx_create_time` (`create_time`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='兑换记录表';
|
||||
Reference in New Issue
Block a user