import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{t as r}from"./timezone-keeL11Io.mjs";const i={path:`/report/:type1/:type2`,categories:[`finance`],example:`/nanhua/report/WEEK/WEEK_black`,parameters:{type1:"一级分类代码，如 `WEEK`（周度报告）、`SEASON`（季年报告）、`HOT`（热点报告）等，需要使用 `encodeURIComponent` 编码",type2:"二级分类代码，如 `WEEK_black`（黑色）、`WEEK_enchem`（能化）等，需要使用 `encodeURIComponent` 编码"},radar:[{source:[`mall.nanhua.net/mall/r/w/reportNew/report-list.html`],target:(e,t)=>{let n=new URL(t).searchParams,r=n.get(`type1`),i=n.get(`type2`);return r&&i?`/nanhua/report/${encodeURIComponent(r)}/${encodeURIComponent(i)}`:``}}],name:`研报`,maintainers:[`TonyRL`],handler:a,url:`mall.nanhua.net/mall/r/w/reportNew/report-list.html`};async function a(i){let{type1:a,type2:o}=i.req.param(),s=`https://mall.nanhua.net`,c=`${s}/mall/nh/api`,l=`${s}/mall/r/w/reportNew/report-list.html?type1=${a}&type2=${o}`,u=await t.tryGet(`nanhua:treeList`,async()=>(await e(`${c}/reportType/getTreeList.json`,{method:`POST`,body:{}})).data),d=await e(`${c}/report/getPage.json`,{method:`POST`,body:{type1Code:a,type2Code:o,pageSize:i.req.query(`limit`)||`20`}}),f=u.find(e=>e.type===a),p=f?.children?.find(e=>e.type===o),m=d.data.result.map(e=>({title:e.title,description:e.content||e.summary||e.desc,link:e.fileName?`${c}/report/getReportFile?reportId=${e.id}&filetitle=${e.fileName}`:/^\d+$/.test(e.id)?e.detailUrl:`${s}/mall/r/w/reportNew/report-list-page.html?id=${e.id}`,pubDate:r(n(e.createTime),8),author:e.personName,category:[e.type1Name,e.type2Name,e.typeName].filter(Boolean),image:e.iconUrl}));return{title:`南华期货 - ${f?.name??a} - ${p?.name??o}`,link:l,language:`zh-CN`,image:`${s}/favicon.ico`,item:m}}export{i as route};