import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{t as r}from"./pypasswaf-C2iBbGLp.mjs";import{load as i}from"cheerio";const a=`https://aao.nuaa.edu.cn/`,o=new Map([[`tzgg`,{title:`通知公告 | 南京航空航天大学教务处`,suffix:`8222/list.htm`}],[`jxfw`,{title:`教学服务 | 南京航空航天大学教务处`,suffix:`8230/list.htm`}],[`xspy`,{title:`学生培养 | 南京航空航天大学教务处`,suffix:`8231/list.htm`}],[`jxjs`,{title:`教学建设 | 南京航空航天大学教务处`,suffix:`8232/list.htm`}],[`jxzy`,{title:`教学资源 | 南京航空航天大学教务处`,suffix:`8233/list.htm`}]]),s={path:`/jwc/:type/:getDescription?`,categories:[`university`],example:`/nuaa/jwc/tzgg/getDescription`,parameters:{type:`分类名，见下表`,getDescription:`是否获取全文`},features:{requireConfig:!1,requirePuppeteer:!0,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`教务处`,maintainers:[`arcosx`,`Seiry`,`qrzbing`,`Xm798`],handler:c,description:`| 通知公告 | 教学服务 | 教学建设 | 学生培养 | 教学资源 |
| -------- | -------- | -------- | -------- | -------- |
| tzgg     | jxfw     | jxjs     | xspy     | jxzy     |`};async function c(s){let c=s.req.param(`type`),l=o.get(c).suffix,u=!!s.req.param(`getDescription`)||!1,d=new URL(l,a).href,f={headers:{cookie:await r(a)}},p=i((await n(d,f)).data),m=p(`#news_list .news_ul .p-list-item a`).slice(0,10).toArray().map(e=>({title:p(e).find(`.text .title`).text(),link:p(e).attr(`href`),date:p(e).find(`.date em`).text()+`-`+p(e).find(`.date span`).text()})),h=await Promise.all(m.map(async r=>{let o=r.title||`tzgg`,s=r.date,c=new URL(r.link,a).href,l=o+`<br><a href="`+c+`" target="_blank">查看原文</a>`;return u&&(l=await e.tryGet(c,async()=>{let e=c.split(`.`).at(-1);if(e===`htm`||e===`html`)return i((await n(c,f)).data)(`.wp_articlecontent`).html()+`<br><hr /><a href="`+c+`" target="_blank">查看原文</a>`})),{title:o,link:c,description:l,pubDate:t(s)}}));return{title:o.get(c).title,link:d,description:`南京航空航天大学教务处RSS`,item:h}}export{s as route};