mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-02 18:18:49 +08:00
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import type { RSS } from '#/rss';
|
|
import type { Torrent } from '#/torrent';
|
|
import type { ApiSuccess } from '#/api';
|
|
|
|
export const apiRSS = {
|
|
async get() {
|
|
const { data } = await axios.get<RSS[]>('api/v1/rss');
|
|
return data!;
|
|
},
|
|
|
|
async add(rss: RSS) {
|
|
const { data } = await axios.post<ApiSuccess>('api/v1/rss/add', rss);
|
|
return data;
|
|
},
|
|
|
|
async delete(rss_id: number) {
|
|
const { data } = await axios.delete<ApiSuccess>(`api/v1/rss/delete/${rss_id}`);
|
|
return data!;
|
|
},
|
|
|
|
async update(rss_id: number, rss: RSS) {
|
|
const { data } = await axios.patch<ApiSuccess>(`api/v1/rss/update/${rss_id}`, rss);
|
|
return data!;
|
|
},
|
|
|
|
async refreshAll() {
|
|
const { data } = await axios.get<ApiSuccess>('api/v1/rss/refresh/all');
|
|
return data!;
|
|
},
|
|
|
|
async refresh(rss_id: number) {
|
|
const { data } = await axios.get<ApiSuccess>(`api/v1/rss/refresh/${rss_id}`);
|
|
return data!;
|
|
},
|
|
|
|
async getTorrent(rss_id: number) {
|
|
const { data } = await axios.get<Torrent[]>(`api/v1/rss/torrent/${rss_id}`);
|
|
return data!;
|
|
},
|
|
};
|