You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
1 year ago
|
const zhidiaoSystem = require('../../../utils/zhidiaoSystem.js');
|
||
|
const moment = require('moment')
|
||
|
|
||
|
let isDev = false
|
||
|
isDev = true
|
||
|
|
||
|
module.exports = function (app, opts) {
|
||
|
const busLines = app.fs.scheduleInit(
|
||
|
{
|
||
|
interval: '24 0 */1 * * *',
|
||
|
immediate: true,
|
||
|
proRun: false,
|
||
|
disabled: false
|
||
|
},
|
||
|
|
||
|
async () => {
|
||
|
try {
|
||
|
const { models, ORM: sequelize } = app.fs.dc
|
||
|
const Authorization = zhidiaoSystem.createAuthorization()
|
||
|
const busRunRes = await app.fs.zhidiaoRequest.get(`getBusRunList`, {
|
||
|
header: {
|
||
|
Authorization: Authorization
|
||
|
}
|
||
|
})
|
||
|
const busLineRes = await app.fs.zhidiaoRequest.get(`getLinePointList`, {
|
||
|
header: {
|
||
|
Authorization: Authorization
|
||
|
}
|
||
|
})
|
||
|
console.log(`定时获取BUS路线信息`);
|
||
|
app.fs.zhidiaoData = {
|
||
|
busLine: busLineRes,
|
||
|
busRun: busRunRes
|
||
|
}
|
||
|
} catch (error) {
|
||
|
console.error(error);
|
||
|
}
|
||
|
}
|
||
|
)
|
||
|
|
||
|
return {
|
||
|
busLines,
|
||
|
}
|
||
|
}
|