feat: 新增路由配置、交易处理和用户连击功能,并初始化相关服务与处理器

This commit is contained in:
2026-01-28 10:08:48 +08:00
parent 4d024eba8e
commit e811256d99
7 changed files with 508 additions and 2 deletions

View File

@@ -242,7 +242,23 @@ CREATE TABLE IF NOT EXISTS `default_categories` (
CONSTRAINT `fk_default_categories_parent` FOREIGN KEY (`parent_id`) REFERENCES `default_categories` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- User Streaks table (for tracking consecutive recording days)
CREATE TABLE IF NOT EXISTS `user_streaks` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`current_streak` int DEFAULT '0',
`longest_streak` int DEFAULT '0',
`last_record_date` date DEFAULT NULL,
`total_record_days` int DEFAULT '0',
`created_at` datetime(3) DEFAULT NULL,
`updated_at` datetime(3) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_user_streaks_user_id` (`user_id`),
CONSTRAINT `fk_user_streaks_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Budgets table
CREATE TABLE IF NOT EXISTS `budgets` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`created_at` datetime(3) DEFAULT NULL,