diff --git a/docs/government.md b/docs/government.md index 958b22dc6..f77b30a92 100644 --- a/docs/government.md +++ b/docs/government.md @@ -334,6 +334,18 @@ pageClass: routes +## 浙江省土地使用权网上交易系统 + +### 公告信息 + + + +| 全部公告 | 挂牌公告 | 拍卖公告 | 补充公告 | +| :------: | :------: | :------: | :------: | +| all | gpgg | pmgg | bcgg | + + + ## 中国工业和信息化部 ### 政策解读 diff --git a/lib/v2/zjgtjy/index.js b/lib/v2/zjgtjy/index.js new file mode 100644 index 000000000..2585e6003 --- /dev/null +++ b/lib/v2/zjgtjy/index.js @@ -0,0 +1,46 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const type = ctx.params.type === 'all' ? '' : ctx.params.type.toUpperCase(); + const host = `https://td.zjgtjy.cn:8553/devops/noticeInfo/queryNoticeInfoList?pageSize=10&pageNumber=1¬iceType=${type}&sort=DESC`; + + const response = await got({ + method: 'get', + url: host, + }).json(); + const data = response.data; + + const items = await Promise.all( + data.map(async (item) => { + const pageUrl = `https://td.zjgtjy.cn:8553/devops/noticeInfo/queryNoticeLandContentDetails?noticeId=${item.GGID}&transactionMode=${item.JYFS}`; + const pageLink = `https://td.zjgtjy.cn/view/trade/announcement/detail?id=${item.GGID}&category=${item.ZYLB}&type=${item.JYFS}`; + + const desc = await ctx.cache.tryGet(pageUrl, async () => { + let desc = await got({ + method: 'get', + url: pageUrl, + }).json(); + desc = desc.queryNoticeContent.GGNR; + + desc = desc + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"'); + return desc; + }); + + return { + title: item.GGMC, + description: desc, + link: pageLink, + pubDate: item.GGFBSJ, + }; + }) + ); + + ctx.state.data = { + title: '浙江土地使用权挂牌公告', + link: host, + item: items, + }; +}; diff --git a/lib/v2/zjgtjy/maintainer.js b/lib/v2/zjgtjy/maintainer.js new file mode 100644 index 000000000..38948679c --- /dev/null +++ b/lib/v2/zjgtjy/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:type?': ['Fatpandac'], +}; diff --git a/lib/v2/zjgtjy/radar.js b/lib/v2/zjgtjy/radar.js new file mode 100644 index 000000000..a4625937a --- /dev/null +++ b/lib/v2/zjgtjy/radar.js @@ -0,0 +1,31 @@ +module.exports = { + 'zjgtjy.cn': { + _name: '浙江省土地使用权网上交易系统', + '.': [ + { + title: '全部更新', + docs: 'https://docs.rsshub.app/government.html', + source: '/', + target: '/zjgtjy/all', + }, + { + title: '挂牌公告', + docs: 'https://docs.rsshub.app/government.html', + source: '/', + target: '/zjgtjy/gpgg', + }, + { + title: '拍卖公告', + docs: 'https://docs.rsshub.app/government.html', + source: '/', + target: '/zjgtjy/pmgg', + }, + { + title: '补充公告', + docs: 'https://docs.rsshub.app/government.html', + source: '/', + target: '/zjgtjy/bcgg', + }, + ], + }, +}; diff --git a/lib/v2/zjgtjy/router.js b/lib/v2/zjgtjy/router.js new file mode 100644 index 000000000..7ec1cc98e --- /dev/null +++ b/lib/v2/zjgtjy/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/:type?', require('./index')); +};