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"./timezone-keeL11Io.mjs";const i={1:`新闻`,3:`公告`},a={path:`/news/:category?`,categories:[`game`],example:`/gf-cn/news`,parameters:{category:`分类，见下表，默认为新闻`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`sunborngame.com/:category`,`sunborngame.com/`]}],name:`情报局`,maintainers:[`nczitzk`],handler:o,description:`| 新闻 | 公告 |
| ---- | ---- |
| 1    | 3    |`};async function o(a){let o=a.req.param(`category`)??`1`,s=`https://gf-cn.sunborngame.com`,c=`https://gfcn-webserver.sunborngame.com`,l=`${c}/website/news_list/${o}?page=0&limit=${a.req.query(`limit`)??50}`,u=`${s}/News`,d=(await n({method:`get`,url:l})).data.data.list.map(e=>({guid:e.Id,title:e.Title,link:`${s}/NewsInfo?id=${e.Id}`,pubDate:r(t(e.Date),8)}));return d=await Promise.all(d.map(t=>e.tryGet(t.link,async()=>(t.description=(await n({method:`get`,url:`${c}/website/news/${t.guid}`})).data.data.Content.replaceAll(`<img src="`,`<img src="https://gf-cn.cdn.sunborngame.com/website/cms/`),t)))),{title:`${i[o]} - 少女前线 - 情报局`,link:u,item:d}}export{a as route};