Files
workspace/code/link56/link56-frontend-new/src/request/api/post/index.ts
T
2026-01-04 17:31:04 +08:00

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}`)
}