初次提交

This commit is contained in:
2025-09-25 11:01:00 +08:00
commit aee6cca805
28 changed files with 6971 additions and 0 deletions

26
config/database-init.js Normal file
View File

@@ -0,0 +1,26 @@
const { initDB, } = require('../database');
/**
* 数据库初始化函数
* 创建所有必要的表结构和初始数据
*/
async function initDatabase() {
try {
// 初始化数据库连接池
await initDB();
console.log('数据库连接池初始化成功');
} catch (error) {
console.error('数据库初始化失败:', error);
throw error;
}
}
module.exports = {
initDatabase
};