Files
muse_creative_hotspots/packages/shared/src/platforms.ts
T
wxsandClaude Opus 4.6 6cc703ada2 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>
2026-03-03 15:43:25 +08:00

97 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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);
}