import { ApiResponse } from './common';
import { post } from './request';

// 资源列表请求参数
export interface ResourcesListRequest {
  published: number;
}

// 资源项数据结构
export interface Resource {
  id: number;
  title: string;
  creator_name: string;
  media_type: number;
  url: string;
  script_id: number;
  created_at: string;
}


// 获取资源列表 - 按创建者筛选
export const getResourcesList = async (data: ResourcesListRequest): Promise<ApiResponse<Resource[]>> => {
  return post<ApiResponse<Resource[]>>('/resources/list', data);
};
