纳入范围: - backend/ Spring Boot 多模块后端(iot-common/device/rule/data/alarm/auth) - frontend/admin/ Vue3 + Element Plus 管理后台 - Android/ 涂鸦原生 APP (com.xhai.iot) - backend/sql/ Flyway 风格迁移脚本(V2~V21) - docs/ 对接文档与设计文档 排除范围: - 构建产物: node_modules/ target/ build/ dist/ .gradle/ - 签名密钥: *.jks *.keystore (严禁入库) - 本机配置: Android/local.properties - 运行日志: logs/ *.log - AI 协作本地数据 .codebuddy/ 与第三方 demo tuya-demo/ .gitattributes 统一以 LF 存储, Windows 批处理保留 CRLF
20 lines
642 B
JavaScript
20 lines
642 B
JavaScript
const mysql = require('mysql2/promise');
|
|
|
|
(async () => {
|
|
const conn = await mysql.createConnection({
|
|
host: 'localhost', port: 33060,
|
|
user: 'root', password: 'root', database: 'iot_platform'
|
|
});
|
|
|
|
// 查看 alarm 表结构
|
|
const [cols] = await conn.query("DESCRIBE alarm");
|
|
console.log('=== alarm 表结构 ===');
|
|
cols.forEach(c => console.log(` ${c.Field} | ${c.Type} | ${c.Null} | ${c.Key} | ${c.Default}`));
|
|
|
|
// 查看数据量
|
|
const [[cnt]] = await conn.query("SELECT COUNT(*) as cnt FROM alarm");
|
|
console.log('\n数据行数:', cnt.cnt);
|
|
|
|
await conn.end();
|
|
})().catch(e => console.error('错误:', e.message));
|