u
This commit is contained in:
1 parent
5221d1cc91
commit
a8a2657753
30 files changed
+552
-255
No files matched your search
@@ -1,38 +1,7 @@
|
||||
import type { DashboardData, PostCategory, PostTag } from '@/types/post'
|
||||
import type { AddPostParams, DeletePostParams, Post, PostEditorForm, QueryPostParams, UpdatePostParams, UpdatePostStatusParams } from '@/types/post/editor'
|
||||
import type { PostTag } from '@/types/post'
|
||||
import { httpGet, httpPostJson } from '@/request/utils'
|
||||
|
||||
export function addPostApi(params: AddPostParams) {
|
||||
return httpPostJson<PostEditorForm>('/post/add', params)
|
||||
}
|
||||
|
||||
export function updatePostApi(params: UpdatePostParams) {
|
||||
return httpPostJson<PostEditorForm>('/post/update', params)
|
||||
}
|
||||
|
||||
export function updatePostStatusApi(params: UpdatePostStatusParams) {
|
||||
return httpPostJson<PostEditorForm>('/post/update/status', params)
|
||||
}
|
||||
|
||||
export function queryPostApi(params: QueryPostParams) {
|
||||
return httpPostJson<BasePageResult<Post>>('/post/query', params)
|
||||
}
|
||||
|
||||
export function getPostApi(id: number) {
|
||||
return httpGet<PostEditorForm>(`/post/${id}`)
|
||||
}
|
||||
|
||||
export function deletePostApi(params: DeletePostParams) {
|
||||
return httpPostJson<void>('/post/delete', params)
|
||||
}
|
||||
|
||||
export function getDashboardDataApi() {
|
||||
return httpGet<DashboardData>(`/post/dashboard`)
|
||||
}
|
||||
|
||||
// ===== 公共接口 =====
|
||||
export function getPostTagApi() {
|
||||
return httpGet<PostTag[]>('/post/tag')
|
||||
}
|
||||
export function getPostCategoryApi() {
|
||||
return httpGet<PostCategory[]>('/post/category')
|
||||
}
|
||||
Reference in new issue
Block a user