diff --git a/docs/forecast.md b/docs/forecast.md index 4d599348c6..aeccf704d7 100644 --- a/docs/forecast.md +++ b/docs/forecast.md @@ -34,14 +34,6 @@ pageClass: routes ## 停电通知 -获取未来一天的停电通知 - -### 国家电网 - - - -> 以上参数可从[查询页面](http://www.95598.cn/95598/outageNotice/initOutageNotice)打开控制台抓包获得 - ### 南京市 diff --git a/lib/router.js b/lib/router.js index bb9f570ab5..abe4862274 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1030,8 +1030,6 @@ router.get('/facebook/page/:id', require('./routes/facebook/page')); router.get('/bihu/activaties/:id', require('./routes/bihu/activaties')); // 停电通知 -router.get('/tingdiantz/95598/:orgNo/:provinceNo/:outageStartTime/:outageEndTime/:scope?', require('./routes/tingdiantz/95598')); -router.get('/tingdiantz/95598/:orgNo/:provinceNo/:scope?', require('./routes/tingdiantz/95598')); router.get('/tingdiantz/nanjing', require('./routes/tingdiantz/nanjing')); // 36kr diff --git a/lib/routes/tingdiantz/95598.js b/lib/routes/tingdiantz/95598.js deleted file mode 100644 index 75c02dc731..0000000000 --- a/lib/routes/tingdiantz/95598.js +++ /dev/null @@ -1,54 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const { orgNo, provinceNo, scope = '', typeCode = '', lineName = '' } = ctx.params; - let { outageStartTime, outageEndTime } = ctx.params; - if (!outageStartTime) { - outageStartTime = new Date(Date.now()).toISOString().slice(0, 10); - } - if (!outageEndTime) { - outageEndTime = new Date(Date.now() + 86400000).toISOString().slice(0, 10); - } - const anHui = provinceNo === '34101' ? '01' : '02'; - const response = await got({ - method: 'post', - url: 'http://www.95598.cn/95598/outageNotice/queryOutageNoticeList', - form: true, - data: { - orgNo, - outageStartTime, - outageEndTime, - scope, - provinceNo, - typeCode, - lineName, - anHui, - }, - }); - - const items = (response.data.seleList || []).map((item) => { - const title = `${item.subsName} | ${item.typeCode || ''}`; - const description = ` - 停电时间:${item.startTime} - ${item.stopTime}
- 停电范围:${item.scope}
- 停电线路:${item.lineName}
- 公变名称:${item.pubTranName}
- 停电原因:${item.poweroffReason}
- `; - const guid = item.powerOffId; - const pubDate = new Date(item.startTime).toUTCString(); - - return { - title, - description, - guid, - pubDate, - }; - }); - - ctx.state.data = { - title: '国家电网停电通知', - link: 'http://www.95598.cn/95598/outageNotice/initOutageNotice', - item: items, - }; -};