增加周榜,月榜,日榜搜索和批量下载
This commit is contained in:
@@ -91,6 +91,20 @@ class DownloadService {
|
||||
return apiService.post(`/api/download/artist/${artistId}`, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载排行榜作品
|
||||
*/
|
||||
async downloadRankingArtworks(options: {
|
||||
mode: 'day' | 'week' | 'month';
|
||||
type: 'art' | 'manga' | 'novel';
|
||||
limit?: number;
|
||||
size?: string;
|
||||
quality?: string;
|
||||
format?: string;
|
||||
}) {
|
||||
return apiService.post('/api/download/ranking', options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已下载的文件列表
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import api from './api';
|
||||
|
||||
export interface RankingParams {
|
||||
mode: 'day' | 'week' | 'month';
|
||||
type: 'art' | 'manga' | 'novel';
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface RankingResponse {
|
||||
artworks: any[];
|
||||
next_url?: string;
|
||||
}
|
||||
|
||||
class RankingService {
|
||||
/**
|
||||
* 获取排行榜数据
|
||||
*/
|
||||
async getRanking(params: RankingParams) {
|
||||
try {
|
||||
const response = await api.get('/api/ranking', { params });
|
||||
return {
|
||||
success: true,
|
||||
data: response.data
|
||||
};
|
||||
} catch (error: any) {
|
||||
return {
|
||||
success: false,
|
||||
error: error.response?.data?.error || error.message || '获取排行榜失败'
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default new RankingService();
|
||||
Reference in New Issue
Block a user