mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 13:14:55 +08:00
feat: github
This commit is contained in:
@@ -42,6 +42,7 @@ export const handleRoute = async (c: ListContext) => {
|
|||||||
const type = isTrendingType(typeParam) ? typeParam : "daily";
|
const type = isTrendingType(typeParam) ? typeParam : "daily";
|
||||||
|
|
||||||
const listData = await getTrendingRepos(type);
|
const listData = await getTrendingRepos(type);
|
||||||
|
|
||||||
const routeData = {
|
const routeData = {
|
||||||
name: "github",
|
name: "github",
|
||||||
title: "github 趋势",
|
title: "github 趋势",
|
||||||
@@ -54,7 +55,18 @@ export const handleRoute = async (c: ListContext) => {
|
|||||||
},
|
},
|
||||||
link: `https://github.com/trending?since=${type}`,
|
link: `https://github.com/trending?since=${type}`,
|
||||||
total: listData?.data?.length || 0,
|
total: listData?.data?.length || 0,
|
||||||
...listData,
|
...{
|
||||||
|
...listData,
|
||||||
|
data: listData?.data?.map((v, index)=>{
|
||||||
|
return {
|
||||||
|
id:index,
|
||||||
|
title: v.repo,
|
||||||
|
desc: v.description,
|
||||||
|
hot: v.stars,
|
||||||
|
...v
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return routeData;
|
return routeData;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user