UNPKG

rsshub

Version:
114 lines (112 loc) 3.28 kB
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as art } from "./render-BQo6B4tL.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { t as utils_default } from "./utils-kJNx41KG.mjs"; import path from "node:path"; //#region lib/routes/cde/xxgk.ts init_esm_shims(); const baseUrl = "https://www.cde.org.cn"; const xxgkMap = { xxgk: { priorityApproval: { title: "优先审评公示", url: `${baseUrl}/main/xxgk/listpage/2f78f372d351c6851af7431c7710a731`, endPoint: "/priority/getPriorityApprovalList", form: { pageSize: 50, pageNum: 1, noticeType: 2, acceptid: "", drugname: "", company: "" } }, breakthroughCure: { title: "突破性治疗公示", url: `${baseUrl}/main/xxgk/listpage/da6efd086c099b7fc949121166f0130c`, endPoint: "/breakthrough/getBreakthroughCureList", form: { pageSize: 50, pageNum: 1, noticeType: 1, acceptid: "", drugname: "", company: "" } }, cliniCal: { title: "临床试验默示许可", url: `${baseUrl}/main/xxgk/listpage/4b5255eb0a84820cef4ca3e8b6bbe20c`, endPoint: "/xxgk/getCliniCalList", form: { pageSize: 50, pageNum: 1, condition: "" } } } }; const route = { path: "/xxgk/:category", categories: ["government"], example: "/cde/xxgk/priorityApproval", parameters: { category: "类别,见下表" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, name: "信息公开", maintainers: ["TonyRL"], handler, description: `| 优先审评公示 | 突破性治疗公示 | 临床试验默示许可 | | :--------------: | :--------------: | :--------------: | | priorityApproval | breakthroughCure | cliniCal |` }; async function handler(ctx) { const category = ctx.req.param("category"); const { data } = await got_default.post(`${baseUrl}/main${xxgkMap.xxgk[category].endPoint}`, { form: xxgkMap.xxgk[category].form, headers: { referer: xxgkMap.xxgk[category].url, cookie: await utils_default.getCookie(ctx) } }); const items = data.data.records.map((item) => { let description = ""; switch (category) { case "priorityApproval": description = art(path.join(__dirname, "templates/priorityApproval-277d57b8.art"), { item }); break; case "breakthroughCure": description = art(path.join(__dirname, "templates/breakthroughCure-ecd43a95.art"), { item }); break; case "cliniCal": description = art(path.join(__dirname, "templates/cliniCal-581a9762.art"), { item }); break; default: description = ""; } return { title: item.drgnamecn, guid: item.acceptid, pubDate: item.endNoticeDate ? parseDate(item.endNoticeDate) : null, description, link: xxgkMap.xxgk[category].url }; }); return { title: `${xxgkMap.xxgk[category].title} - 国家药品监督管理局药品审评中心`, link: xxgkMap.xxgk[category].url, item: items }; } //#endregion export { route };