From 89607875ff8119351dce2dafe9069cc505740640 Mon Sep 17 00:00:00 2001 From: MisteryMonster <40703811+MisteryMonster@users.noreply.github.com> Date: Thu, 6 Aug 2020 06:21:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:add=20=E4=B8=AD=E5=8D=8E=E4=BA=BA=E6=B0=91?= =?UTF-8?q?=E5=85=B1=E5=92=8C=E5=9B=BD=E5=86=9C=E4=B8=9A=E5=86=9C=E6=9D=91?= =?UTF-8?q?=E9=83=A8-=E6=95=B0=E6=8D=AE-=E6=9C=80=E6=96=B0=E5=8F=91?= =?UTF-8?q?=E5=B8=83=20(#5355)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/government.md | 4 ++++ lib/router.js | 1 + lib/routes/gov/moa/sjzxfb.js | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 lib/routes/gov/moa/sjzxfb.js diff --git a/docs/government.md b/docs/government.md index f0c06d075..6c73d0095 100644 --- a/docs/government.md +++ b/docs/government.md @@ -415,6 +415,10 @@ pageClass: routes +### 数据 - 最新发布 + + + ## 中华人民共和国商务部 ### 政务公开 diff --git a/lib/router.js b/lib/router.js index 5639c6cd7..bf919c29f 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1808,6 +1808,7 @@ router.get('/cninfo/fund_announcement/:code?/:searchkey?', require('./routes/cni router.get('/ccdi/scdc', require('./routes/ccdi/scdc')); // 中华人民共和国农业农村部 +router.get('/gov/moa/sjzxfb', require('./routes/gov/moa/sjzxfb')); router.get('/gov/moa/:suburl(.*)', require('./routes/gov/moa/moa')); // 香水时代 diff --git a/lib/routes/gov/moa/sjzxfb.js b/lib/routes/gov/moa/sjzxfb.js new file mode 100644 index 000000000..39f4e71b9 --- /dev/null +++ b/lib/routes/gov/moa/sjzxfb.js @@ -0,0 +1,20 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const response = await got({ + method: 'get', + url: `http://zdscxx.moa.gov.cn:8080/misportal/echartReport/webData/%E6%9C%80%E6%96%B0%E5%8F%91%E5%B8%83/page1.json`, + }); + const data = response.data; + + ctx.state.data = { + title: '中华人民共和国农业农村部 - 数据 - 最新发布', + link: `http://zdscxx.moa.gov.cn:8080/nyb/pc/index.jsp`, + item: data.map((item) => ({ + title: `${item.title}`, + description: `${item.content}`, + link: `http://zdscxx.moa.gov.cn:8080/misportal/public/agricultureMessageViewDC.jsp?page=1&channel=%E6%9C%80%E6%96%B0%E5%8F%91%E5%B8%83&id=${item._id}`, + pubDate: `${item.publishTime}`, + })), + }; +};