import { api } from '@/services/api';

export enum RecommendationType {
  Article = 'article',
  Checkin = 'checkin',
}

export type RecommendationCard = {
  id: string;
  type: RecommendationType;
  title?: string;
  coverUrl: string;
  articleId?: string;
  subtitle?: string;
  extra?: Record<string, any>;
};

export async function fetchRecommendations(): Promise<RecommendationCard[]> {
  // 后端返回 BaseResponseDto<data>，services/api 会自动解出 data 字段
  return api.get<RecommendationCard[]>(`/recommendations/list`);
}


