import{t as e}from"./config-BYRrjYC5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{t as r}from"./got-BBDj7u1e.mjs";import{a as i,i as a,n as o,t as s}from"./utils-DrRRxEw0.mjs";const c={path:`/bbs/profile/thread/:userId`,categories:[`bbs`],example:`/dxy/bbs/profile/thread/8335054`,parameters:{userId:`个人 ID，可在 URL 中找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`dxy.cn/bbs/newweb/pc/profile/:userId/threads`,`dxy.cn/bbs/newweb/pc/profile/:userId`]}],name:`个人帖子`,maintainers:[`TonyRL`],handler:l};async function l(c){let l=c.req.param(`userId`),{limit:u=`30`}=c.req.query(),d=await t.tryGet(`dxy:user-info:${l}`,async()=>{let e={userId:l,serverTimestamp:Date.now(),timestamp:Date.now(),noncestr:s(8,`number`)},{data:t}=await r(`${i}/bbs/newweb/personal-page/user-info`,{searchParams:{...e,sign:a(e)}});if(t.code!==`success`)throw Error(t.message);return t.data}),f=(await t.tryGet(`dxy:user:post:${l}`,async()=>{let e={userId:l,type:`0`,pageNum:`1`,pageSize:u,serverTimestamp:Date.now(),timestamp:Date.now(),noncestr:s(8,`number`)},{data:t}=await r(`${i}/bbs/newweb/user/post/page`,{searchParams:{...e,sign:a(e)}});if(t.code!==`success`)throw Error(t.message);return t.data},e.cache.routeExpire,!1)).result.map(e=>{let{postInfo:t,createdTime:r,entityId:a}=e;return{title:t.subject,description:t.simpleBody,pubDate:n(r,`x`),author:t.postUser.nickname,category:[t.boardInfo.title],link:`${i}/bbs/newweb/pc/post/${a}`,postId:a}}),p=await Promise.all(f.map(e=>o(e,t.tryGet)));return{title:`${d.nickname} 的个人主页 - 丁香园论坛 - 专业医生社区，医学、药学、生命科学、科研学术交流`,description:`${d.identificationTitle} ${d.signature}`,link:`${i}/bbs/newweb/pc/profile/${l}/threads`,image:d.avatar,item:p}}export{c as route};