完成博客、资源管理api

This commit is contained in:
2025-05-12 15:50:50 +08:00
parent eb4301ba98
commit 9133b45744
13 changed files with 99 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
import fetcher from "@/lib/api/fetcher";
type CreateBlogParams = {
}
export async function create(data: CreateBlogParams) {
return fetcher('/admin/web/blog', {
method: 'POST',
body: JSON.stringify(data)
})
}

View File

@@ -0,0 +1,4 @@
export * from './create';
export * from './remove';
export * from './list';
export * from './update';

View File

@@ -0,0 +1,5 @@
import fetcher from "@/lib/api/fetcher";
export async function list() {
return fetcher('/admin/web/blog')
}

View File

@@ -0,0 +1,7 @@
import fetcher from "@/lib/api/fetcher";
export async function remove(id: string) {
return fetcher(`/admin/web/blog/${id}`, {
method: 'DELETE',
})
}

View File

@@ -0,0 +1,12 @@
import fetcher from "@/lib/api/fetcher";
type UpdateBlogParams = {
}
export async function update(id: string, data: UpdateBlogParams) {
return fetcher(`/admin/web/blog/${id}`, {
method: 'POST',
body: JSON.stringify(data)
})
}