This commit is contained in:
oneao committed 2025-12-26 17:30:43 +08:00
1 parent 4f5218c892
commit 2f8a815c62
32 files changed
+1915 -1738

No files matched your search

@@ -1,7 +1,31 @@
import type { PostTag } from '@/types/post'
import type { CreatePostCommentParams, CreatePostCommentResult, PostComment, PostCompany, PostTag, PublicPost, PublicPostDetail, QueryPublicPostParams } from '@/types/post'
import { httpGet, httpPostJson } from '@/request/utils'
// ===== 公共接口 =====
export function getPostTagApi() {
return httpGet<PostTag[]>('/post/tag')
}
export function queryPublicPostApi(params: QueryPublicPostParams) {
return httpPostJson<BasePageResult<PublicPost>>('/post/query', params)
}
export function getPublicPostDetailApi(id: number) {
return httpGet<PublicPostDetail>(`/post/${id}`)
}
export function getPostCompanyById(id: number) {
return httpGet<PostCompany>(`/post/company/${id}`)
}
export function createPostCommentApi(params: CreatePostCommentParams) {
return httpPostJson<CreatePostCommentResult>(`/post/comment/create`, params)
}
export function listPostCommentApi(id: number) {
return httpGet<PostComment[]>(`/post/comment/${id}`)
}
export function deletePostCommentApi(id: number) {
return httpGet<void>(`/post/comment/delete/${id}`)
}