feat: monorepo 重构 + 新增 5 个平台适配器
项目从单体结构重构为 pnpm monorepo (shared/backend/frontend), 新增 YouTube、Instagram、Twitter/X、哔哩哔哩、微博 5 个平台适配器, 包含完整的单元测试和 E2E 测试覆盖。 - 完成 T-031~T-044: 5 个适配器实现、注册、配置和测试 - 重构前后端分离: Hono 后端 + Next.js 前端 - 151 个单元测试 + 21 个 Mock E2E + 25 个真实 E2E - 适配器基于真实 TikHub API 响应结构实现 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
import type { PlatformConfig } from "./types/content";
|
||||
|
||||
export const MVP_PLATFORMS: PlatformConfig[] = [
|
||||
{
|
||||
id: "douyin",
|
||||
name: "抖音",
|
||||
icon: "📱",
|
||||
color: "#000000",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/douyin/web/fetch_hot_search_result",
|
||||
detail: "/api/v1/douyin/web/fetch_one_video",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "tiktok",
|
||||
name: "TikTok",
|
||||
icon: "🎵",
|
||||
color: "#00F2EA",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/tiktok/web/fetch_trending_post",
|
||||
detail: "/api/v1/tiktok/web/fetch_post_detail",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "xiaohongshu",
|
||||
name: "小红书",
|
||||
icon: "📕",
|
||||
color: "#FF2442",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/xiaohongshu/app/v2/fetch_feed",
|
||||
detail: "/api/v1/xiaohongshu/app/v2/fetch_note_detail",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "youtube",
|
||||
name: "YouTube",
|
||||
icon: "▶️",
|
||||
color: "#FF0000",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/youtube/web/get_trending_videos",
|
||||
detail: "/api/v1/youtube/web/get_video_info",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "instagram",
|
||||
name: "Instagram",
|
||||
icon: "📷",
|
||||
color: "#E4405F",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/instagram/v1/fetch_explore_sections",
|
||||
detail: "/api/v1/instagram/v2/fetch_post_info",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "twitter",
|
||||
name: "Twitter/X",
|
||||
icon: "𝕏",
|
||||
color: "#000000",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/twitter/web/fetch_trending",
|
||||
detail: "/api/v1/twitter/web/fetch_tweet_detail",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "bilibili",
|
||||
name: "哔哩哔哩",
|
||||
icon: "📺",
|
||||
color: "#00A1D6",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/bilibili/web/fetch_com_popular",
|
||||
detail: "/api/v1/bilibili/web/fetch_video_detail",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "weibo",
|
||||
name: "微博",
|
||||
icon: "🔥",
|
||||
color: "#FF8200",
|
||||
enabled: true,
|
||||
endpoints: {
|
||||
trending: "/api/v1/weibo/app/fetch_hot_search",
|
||||
detail: "/api/v1/weibo/app/fetch_status_detail",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export function getPlatformConfig(platformId: string): PlatformConfig | undefined {
|
||||
return MVP_PLATFORMS.find((p) => p.id === platformId);
|
||||
}
|
||||
Reference in New Issue
Block a user