41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
const mysql = require('mysql2/promise');
|
|
|
|
const dbConfig = {
|
|
host: 'mysql.theaken.com',
|
|
port: 33306,
|
|
user: 'root',
|
|
password: 'zh6161168',
|
|
database: 'db_AI_scoring'
|
|
};
|
|
|
|
async function checkData() {
|
|
let connection;
|
|
try {
|
|
console.log('🔗 連接到資料庫...');
|
|
connection = await mysql.createConnection(dbConfig);
|
|
console.log('✅ 資料庫連接成功');
|
|
|
|
// 檢查評審記錄
|
|
const [evaluations] = await connection.execute('SELECT id, project_id, overall_score, grade FROM evaluations LIMIT 5');
|
|
console.log('📊 評審記錄:', evaluations);
|
|
|
|
// 檢查專案記錄
|
|
const [projects] = await connection.execute('SELECT id, title, status FROM projects LIMIT 5');
|
|
console.log('📋 專案記錄:', projects);
|
|
|
|
// 檢查評分記錄
|
|
const [scores] = await connection.execute('SELECT id, evaluation_id, criteria_item_id, score FROM evaluation_scores LIMIT 5');
|
|
console.log('🎯 評分記錄:', scores);
|
|
|
|
} catch (error) {
|
|
console.error('❌ 錯誤:', error.message);
|
|
} finally {
|
|
if (connection) {
|
|
await connection.end();
|
|
console.log('🔌 資料庫連接已關閉');
|
|
}
|
|
}
|
|
}
|
|
|
|
checkData();
|