Browse Source

合并代码

master
song 4 years ago
parent
commit
dee88e48c6
  1. 4
      .gitignore
  2. 25
      .idea/workspace.xml
  3. 27
      data/config-function.js
  4. 17
      data/config-network.js
  5. 94
      data/dataHistory.js
  6. 4
      data/devicesAll.js
  7. 14
      route.js

4
.gitignore

@ -0,0 +1,4 @@
.idea
node_modules
.vscode

25
.idea/workspace.xml

@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="f6554b0f-8e9f-4d17-af66-170afe4c12e9" name="默认变更列表" comment="" />
<list default="true" id="f6554b0f-8e9f-4d17-af66-170afe4c12e9" name="默认变更列表" comment="">
<change afterPath="$PROJECT_DIR$/data/config-function.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/data/config-network.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/route.js" beforeDir="false" afterPath="$PROJECT_DIR$/route.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -14,7 +19,13 @@
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1zqPGJ109BzDN5oqtEXo6tn6xHP" />
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
@ -46,12 +57,24 @@
<workItem from="1634872549457" duration="1798000" />
<workItem from="1635121020817" duration="1948000" />
<workItem from="1635211315342" duration="2957000" />
<workItem from="1635390008514" duration="1142000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />

27
data/config-function.js

@ -0,0 +1,27 @@
module.exports = {
code: 200,
msg: 'ok',
data: {
frequency: { // 采样频率
so2: 10, // SO2采样频率
metal: 20, // 金属腐蚀采样频率
th: 30, // 温湿度 采样频率
salt: 40, // 盐雾 采样频率
},
count: 1000, // 采集个数
time: new Date(), // 设置时间
batteryLow: 11, // 电池电压低阈值
batteryHigh: 31, // 电池电压高阈值
sunHigh: 2, // 太阳能电压高阈值
humidityHigh: 32, // 湿度高阈值
temperatureLow: 11, // 温度低阈值
temperatureHigh: 45, // 温度高阈值
securityMode: 0, // 安全模式 0->不加密 1->加密
corrosiveType: 1, // 金属腐蚀类型
report: {
type: 1, // 上报周期类型 0->时间点 1->周期
timePoints: [0, 0, 0, 0, 0, 0], // 设置时间点
cycle: 10, // 上报周期分钟数
},
}
}

17
data/config-network.js

@ -0,0 +1,17 @@
module.exports = {
code: 200,
msg: 'ok',
data: {
ip1: '192.168.1.101',
port1: '8007',
ip2: '292.168.1.101',
port2: '4001',
ip3: '192.168.1.102',
port3: '9001',
ipBackup: '192.168.1.103', // 备用ip
portBackup: '1001', // 备用端口号
account: 'wally-yy', // 账号
password: '111111', // 密码
apn: 'dsfasfa', // apn
}
}

94
data/dataHistory.js

@ -0,0 +1,94 @@
module.exports = {
code: 200,
msg: 'ok',
data: {
page: {
count: 10,
page: 1,
size: 10,
total: 100
},
data: [{
deviceNo: 'deviceNo 001', // 设备编号
ICCID: 'ICCID 001',
IMEI: 'IMEI 001',
signal: 'signal 强', // 信号强度
stationNo: 'sta001', // 基站编号
version: 'v1.0.0', // 版本号
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: 'sta002', // 基站编号
version: 'v1.0.0', // 版本号
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: 'sta003', // 基站编号
version: 'v1.0.0', // 版本号
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: 'sta004', // 基站编号
version: 'v1.0.0', // 版本号
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
}]
}
}

4
data/devicesAll.js

@ -3,8 +3,8 @@ module.exports = {
msg: 'ok',
data: {
page: {
count: 100, // 数据条数
total: 10, // 总共多少页
count: 10, // 总共多少页
total: 100, // 数据条数
page: 1, // 当前页数
size: 10, // 每页10条
},

14
route.js

@ -4,6 +4,9 @@ const devicesAll = require('./data/devicesAll');
const device = require('./data/device');
const monthes = require('./data/monthes');
const realtime = require('./data/realtime');
const dataHistory = require('./data/dataHistory');
const configNetwork = require('./data/config-network');
const configFunction = require('./data/config-function');
// 根据userId获取用户
get('/gateway/tall3/v3.0/users/userId').to.json(user);
@ -17,8 +20,17 @@ get('/gateway/corrosion/devices/all/:id').to.json(device);
// 设备列表 完整信息
get('/gateway/corrosion/devices/all').to.json(devicesAll);
// 积分电量
// 月累计数据分析
get('/gateway/corrosion/statistics/monthes').to.json(monthes);
// 实时数据统计
get('/gateway/corrosion/statistics/realtime').to.json(realtime);
// 历史数据查询
get('/gateway/corrosion/histories').to.json(dataHistory);
// 获取网络配置参数
get('/gateway/corrosion/config/network').to.json(configNetwork);
// 获取功能配置参数
get('/gateway/corrosion/config/function').to.json(configFunction);

Loading…
Cancel
Save