Initial commit: Telegram Management System
Some checks failed
Deploy / deploy (push) Has been cancelled

Full-stack web application for Telegram management
- Frontend: Vue 3 + Vben Admin
- Backend: NestJS
- Features: User management, group broadcast, statistics

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
你的用户名
2025-11-04 15:37:50 +08:00
commit 237c7802e5
3674 changed files with 525172 additions and 0 deletions

54
test-api-data.js Normal file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env node
const mysql = require('mysql2/promise');
async function createMockApi() {
const connection = await mysql.createConnection({
host: '127.0.0.1',
user: 'root',
password: '',
database: 'tg_manage'
});
try {
// 查询TG账号数据
const [rows] = await connection.execute(
'SELECT id, phone, firstname, lastname, status, usageId FROM accounts ORDER BY id DESC LIMIT 20'
);
console.log('📊 TG账号数据样例:');
console.log(JSON.stringify(rows.slice(0, 5), null, 2));
// 统计数据
const [stats] = await connection.execute(
`SELECT
COUNT(*) as total,
SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as active,
SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) as inactive,
SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as banned
FROM accounts`
);
console.log('📈 账号统计:');
console.log(JSON.stringify(stats[0], null, 2));
// 用途统计
const [usages] = await connection.execute(
'SELECT usageId, COUNT(*) as count FROM accounts GROUP BY usageId'
);
console.log('📋 用途分布:');
console.log(JSON.stringify(usages, null, 2));
} catch (error) {
console.error('❌ 数据库查询失败:', error.message);
} finally {
await connection.end();
}
}
if (require.main === module) {
createMockApi().catch(console.error);
}
module.exports = { createMockApi };