Initial commit: 宁夏智慧养殖监管平台

This commit is contained in:
shenquanyi
2025-08-25 15:00:46 +08:00
commit ec72c6a8b5
177 changed files with 37263 additions and 0 deletions

23
backend/check-devices.js Normal file
View File

@@ -0,0 +1,23 @@
const { Device } = require('./models');
(async () => {
try {
const devices = await Device.findAll({
limit: 5,
attributes: ['id', 'name', 'type']
});
console.log('前5个设备:');
devices.forEach(d => {
console.log(`ID: ${d.id}, 名称: ${d.name}, 类型: ${d.type}`);
});
const totalCount = await Device.count();
console.log(`\n设备总数: ${totalCount}`);
} catch (error) {
console.error('检查设备时出错:', error);
} finally {
process.exit();
}
})();