32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import type { CreatePostCommentParams, CreatePostCommentResult, PostComment, PostCompany, PostTag, PublicPost, PublicPostDetail, QueryPublicPostParams } from '@/types/post'
|
|
import { httpGet, httpPostJson } from '@/request/utils'
|
|
|
|
// ===== 公共接口 =====
|
|
export function listPostTagApi() {
|
|
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 httpPostJson<void>(`/post/comment/delete/${id}`)
|
|
}
|