chore: initial commit

This commit is contained in:
2026-07-22 17:50:30 +08:00
parent d46cdd676e
commit 3abf272e33
190 changed files with 18073 additions and 0 deletions

22
src/api/blog/post.ts Normal file
View File

@@ -0,0 +1,22 @@
import { http } from '@/lib'
import type { PageParams, Post, PostFormOutput } from '@/schemas'
export const getPosts = (params: PageParams) => {
return http.get<Post[], ApiPageResponse<Post>>('/post', { params })
}
export const createPost = (data: PostFormOutput) => {
return http.post<{ post_id: number }>('/post', data)
}
export const updatePost = (id: number, data: PostFormOutput) => {
return http.patch(`/post/${id}`, data)
}
export const getPost = (id: number) => {
return http.get<Post>(`/post/${id}`)
}
export const deletePost = (id: number) => {
return http.delete(`/post/${id}`)
}