diff --git a/packages/crawler/db/allData.ts b/packages/crawler/db/allData.ts index 461cb69..79cfcbd 100644 --- a/packages/crawler/db/allData.ts +++ b/packages/crawler/db/allData.ts @@ -1,5 +1,5 @@ import { Client } from "https://deno.land/x/postgres@v0.19.3/mod.ts"; -import { AllDataType, BiliUserType } from "db/schema.d.ts"; +import { AllDataType, BiliUserType } from "@core/db/schema.d.ts"; import Akari from "ml/akari.ts"; export async function videoExistsInAllData(client: Client, aid: number) { diff --git a/packages/crawler/db/schema.d.ts b/packages/crawler/db/schema.d.ts deleted file mode 100644 index d030308..0000000 --- a/packages/crawler/db/schema.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -export interface AllDataType { - id: number; - aid: number; - bvid: string | null; - description: string | null; - uid: number | null; - tags: string | null; - title: string | null; - published_at: string | null; - duration: number; - created_at: string | null; -} - -export interface BiliUserType { - id: number; - uid: number; - username: string; - desc: string; - fans: number; -} - -export interface VideoSnapshotType { - id: number; - created_at: string; - views: number; - coins: number; - likes: number; - favorites: number; - shares: number; - danmakus: number; - aid: bigint; - replies: number; -} - -export interface LatestSnapshotType { - aid: number; - time: number; - views: number; - danmakus: number; - replies: number; - likes: number; - coins: number; - shares: number; - favorites: number; -} - -export interface SnapshotScheduleType { - id: number; - aid: number; - type?: string; - created_at: string; - started_at?: string; - finished_at?: string; - status: string; -} diff --git a/packages/crawler/db/snapshot.ts b/packages/crawler/db/snapshot.ts index 5be2d62..0be2ccc 100644 --- a/packages/crawler/db/snapshot.ts +++ b/packages/crawler/db/snapshot.ts @@ -1,5 +1,5 @@ import { Client } from "https://deno.land/x/postgres@v0.19.3/mod.ts"; -import { LatestSnapshotType } from "db/schema.d.ts"; +import { LatestSnapshotType } from "@core/db/schema.d.ts"; export async function getVideosNearMilestone(client: Client) { const queryResult = await client.queryObject(` diff --git a/packages/crawler/db/snapshotSchedule.ts b/packages/crawler/db/snapshotSchedule.ts index b8aec48..c6a30e0 100644 --- a/packages/crawler/db/snapshotSchedule.ts +++ b/packages/crawler/db/snapshotSchedule.ts @@ -1,6 +1,6 @@ import { Client } from "https://deno.land/x/postgres@v0.19.3/mod.ts"; import { formatTimestampToPsql } from "utils/formatTimestampToPostgre.ts"; -import { SnapshotScheduleType } from "./schema.d.ts"; +import { SnapshotScheduleType } from "@core/db/schema.d.ts"; import logger from "log/logger.ts"; import { MINUTE } from "$std/datetime/constants.ts"; import { redis } from "db/redis.ts"; diff --git a/packages/crawler/mq/task/getVideoStats.ts b/packages/crawler/mq/task/getVideoStats.ts index 34b6c42..e1d5a94 100644 --- a/packages/crawler/mq/task/getVideoStats.ts +++ b/packages/crawler/mq/task/getVideoStats.ts @@ -1,6 +1,6 @@ import { Client } from "https://deno.land/x/postgres@v0.19.3/mod.ts"; import { getVideoInfo } from "net/getVideoInfo.ts"; -import { LatestSnapshotType } from "db/schema.d.ts"; +import { LatestSnapshotType } from "@core/db/schema.d.ts"; import logger from "log/logger.ts"; /*