import{t as e}from"./parse-date-BdYTmLpo.mjs";import{t}from"./timezone-keeL11Io.mjs";import{t as n}from"./invalid-parameter-DLv2wPKB.mjs";import{t as r}from"./utils-DyenO1rI.mjs";import{load as i}from"cheerio";const a=new Map([[`jstz`,{title:`南京理工大学教务处 -- 教师通知`,id:`/1216`}],[`xstz`,{title:`南京理工大学教务处 -- 学生通知`,id:`/1217`}],[`xw`,{title:`南京理工大学教务处 -- 新闻`,id:`/1218`}],[`xydt`,{title:`南京理工大学教务处 -- 学院动态`,id:`/1219`}]]),o={path:`/jwc/:type?`,categories:[`university`],example:`/njust/jwc/xstz`,parameters:{type:`分类名，见下表，默认为学生通知`},features:{requireConfig:!1,requirePuppeteer:!0,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`教务处`,maintainers:[`MilkShakeYoung`,`jasongzy`],handler:s,description:`| 教师通知 | 学生通知 | 新闻 | 学院动态 |
| -------- | -------- | ---- | -------- |
| jstz     | xstz     | xw   | xydt     |`};async function s(o){let s=o.req.param(`type`)??`xstz`,c=a.get(s);if(!c)throw new n(`invalid type`);let l=`https://jwc.njust.edu.cn`+c.id+`/list.htm`,u=i(await r(l,!0)),d=u(`div#wp_news_w3`).find(`tr`);return{title:c.title,link:l,item:d.toArray().map(n=>({title:u(n).find(`a`).attr(`title`).trim(),pubDate:t(e(u(n).find(`td[width="14%"]`).text(),`YYYY-MM-DD`),8),link:u(n).find(`a`).attr(`href`)}))}}export{o as route};