From 95caf4cfdc0dd275ccc35186727297248715049e Mon Sep 17 00:00:00 2001 From: wally <18603454788@163.com> Date: Wed, 27 Oct 2021 16:44:32 +0800 Subject: [PATCH] init --- data/dataHistory.js | 94 +++++++++++++++++++++++++++++++++++++++++++++ route.js | 4 ++ 2 files changed, 98 insertions(+) create mode 100644 data/dataHistory.js diff --git a/data/dataHistory.js b/data/dataHistory.js new file mode 100644 index 0000000..7ab5e0f --- /dev/null +++ b/data/dataHistory.js @@ -0,0 +1,94 @@ +module.exports = { + code: 200, + msg: 'ok', + data: { + page: { + count: 100, + page: 1, + size: 10, + total: 10 + }, + data: [{ + deviceNo: 'deviceNo 001', // 设备编号 + ICCID: 'ICCID 001', + IMEI: 'IMEI 001', + signal: 'signal 强', // 信号强度 + stationNo: 'stationNo 001', // 基站编号 + version: 'version 001', // 版本号 + time: '2021-10-10 09:08:00', // 时间 + solarVoltage: 0, // 太阳能电压 + batteryVoltage: 0, // 蓄电池电压 + deviceTemperature: 0, // 机箱温度 + deviceHumidity: 0, // 机箱湿度 + environmentTemperature: 0, // 环境温度 + environmentHumidity: 0, // 环境湿度 + so2: 0, // SO2 + salt: 0, // 盐分 + corrosion1: 0, // 腐流1 + corrosion2: 0, // 腐流2 + corrosion3: 0, // 腐流3 + corrosion4: 0, // 腐流4 + },{ + deviceNo: 'deviceNo 002', // 设备编号 + ICCID: 'ICCID 002', + IMEI: 'IMEI 002', + signal: 'signal 强', // 信号强度 + stationNo: 'stationNo 002', // 基站编号 + version: 'version 002', // 版本号 + time: '2021-10-10 10:08:00', // 时间 + solarVoltage: 0, // 太阳能电压 + batteryVoltage: 0, // 蓄电池电压 + deviceTemperature: 0, // 机箱温度 + deviceHumidity: 0, // 机箱湿度 + environmentTemperature: 0, // 环境温度 + environmentHumidity: 0, // 环境湿度 + so2: 0, // SO2 + salt: 0, // 盐分 + corrosion1: 0, // 腐流1 + corrosion2: 0, // 腐流2 + corrosion3: 0, // 腐流3 + corrosion4: 0, // 腐流4 + },{ + deviceNo: 'deviceNo 003', // 设备编号 + ICCID: 'ICCID 003', + IMEI: 'IMEI 003', + signal: 'signal 强', // 信号强度 + stationNo: 'stationNo 003', // 基站编号 + version: 'version 003', // 版本号 + time: '2021-10-10 09:08:00', // 时间 + solarVoltage: 0, // 太阳能电压 + batteryVoltage: 0, // 蓄电池电压 + deviceTemperature: 0, // 机箱温度 + deviceHumidity: 0, // 机箱湿度 + environmentTemperature: 0, // 环境温度 + environmentHumidity: 0, // 环境湿度 + so2: 0, // SO2 + salt: 0, // 盐分 + corrosion1: 0, // 腐流1 + corrosion2: 0, // 腐流2 + corrosion3: 0, // 腐流3 + corrosion4: 0, // 腐流4 + }, + { + deviceNo: 'deviceNo 004', // 设备编号 + ICCID: 'ICCID 004', + IMEI: 'IMEI 004', + signal: 'signal 强', // 信号强度 + stationNo: 'stationNo 004', // 基站编号 + version: 'version 004', // 版本号 + time: '2021-10-10 09:08:00', // 时间 + solarVoltage: 0, // 太阳能电压 + batteryVoltage: 0, // 蓄电池电压 + deviceTemperature: 0, // 机箱温度 + deviceHumidity: 0, // 机箱湿度 + environmentTemperature: 0, // 环境温度 + environmentHumidity: 0, // 环境湿度 + so2: 0, // SO2 + salt: 0, // 盐分 + corrosion1: 0, // 腐流1 + corrosion2: 0, // 腐流2 + corrosion3: 0, // 腐流3 + corrosion4: 0, // 腐流4 + }] + } +} diff --git a/route.js b/route.js index 9397943..760a31d 100644 --- a/route.js +++ b/route.js @@ -4,6 +4,7 @@ const devicesAll = require('./data/devicesAll'); const device = require('./data/device'); const integralElectric = require('./data/integralElectric'); const totalCorrosion = require('./data/totalCorrosion'); +const dataHistory = require('./data/dataHistory'); const moistTime = require('./data/moistTime'); // 根据userId获取用户 @@ -26,3 +27,6 @@ get('/gateway/corrosion/monthes/totalCorrosion').to.json(totalCorrosion); // 月累计湿润时间图 get('/gateway/corrosion/monthes/moistTime').to.json(moistTime); + +// 历史数据查询 +get('/gateway/corrosion/histories').to.json(dataHistory);