import { client } from '../client';

export interface CoverBackground {
  id: number;
  scriptCode: string;
  title: string | null;
  url: string;
  sortOrder: number;
  status: string;
}

export const coverApi = {
  /**
   * 获取封面背景图列表
   * GET /cover-backgrounds?script_code={code}
   */
  getBackgrounds: async (scriptCode: string): Promise<CoverBackground[]> => {
    return client.get<CoverBackground[]>(`/cover-backgrounds?script_code=${encodeURIComponent(scriptCode)}`);
  },
};
