mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 13:14:55 +08:00
feat: 添加gameres路由类型定义
This commit is contained in:
10
src/router.types.d.ts
vendored
10
src/router.types.d.ts
vendored
@@ -431,4 +431,14 @@ export type RouterType = {
|
|||||||
name: string;
|
name: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
gameres: {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
hot: number | undefined;
|
||||||
|
desc: string;
|
||||||
|
cover: string;
|
||||||
|
timestamp: number | undefined;
|
||||||
|
url: string;
|
||||||
|
mobileUrl: string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import type { RouterData } from "../types.js";
|
|||||||
import { load } from "cheerio";
|
import { load } from "cheerio";
|
||||||
import { get } from "../utils/getData.js";
|
import { get } from "../utils/getData.js";
|
||||||
import { getTime } from "../utils/getTime.js";
|
import { getTime } from "../utils/getTime.js";
|
||||||
|
import { RouterType } from "../router.types.js";
|
||||||
|
|
||||||
export const handleRoute = async (_: undefined, noCache: boolean) => {
|
export const handleRoute = async (_: undefined, noCache: boolean) => {
|
||||||
const listData = await getList(noCache);
|
const listData = await getList(noCache);
|
||||||
@@ -44,8 +45,6 @@ const getList = async (noCache: boolean) => {
|
|||||||
const timestamp = getTime(dateTime);
|
const timestamp = getTime(dateTime);
|
||||||
|
|
||||||
// 热度(列表暂无评论数)
|
// 热度(列表暂无评论数)
|
||||||
// const hotText = dom.find(".comment").text().trim();
|
|
||||||
// const hot = Number(hotText.replace(/\D/g, "")) || 0;
|
|
||||||
const hot = undefined;
|
const hot = undefined;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -57,7 +56,7 @@ const getList = async (noCache: boolean) => {
|
|||||||
url,
|
url,
|
||||||
id: url,
|
id: url,
|
||||||
mobileUrl: url,
|
mobileUrl: url,
|
||||||
};
|
} as RouterType["gameres"];
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user