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"./utils-DwzuUs2Z.mjs";const i={path:`/user/:id`,categories:[`finance`],view:0,example:`/gelonghui/user/5273`,parameters:{id:`用户编号，可在用户页 URL 中找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`gelonghui.com/user/:id`]}],name:`用户文章`,maintainers:[`nczitzk`],handler:a};async function a(i){let{id:a}=i.req.param(),{data:o}=await n(`https://www.gelonghui.com/api/community/dynamic/my-dynamics/v2`,{searchParams:{article:!0,userId:a,count:i.req.query(`limit`)?Number(i.req.query(`limit`)):15}}),s=o.result.map(e=>({title:e.title,link:e.route,description:e.content,author:e.user.nick,pubDate:t(e.createTimestamp,`X`)})),c=await Promise.all(s.map(t=>r(t,e.tryGet)));return{title:`格隆汇 - 用户 ${o.result[0].user.nick} 的文章`,description:o.result.find(e=>e.user).user.brief,image:o.result.find(e=>e.user).user.avatar.split(`@`)[0],link:o.result.find(e=>e.user).user.route.replace(`https://m.gelonghui.com`,`https://www.gelonghui.com`),item:c}}export{i as route};