Industrial-image-management.../src/apis/system/post.ts

47 lines
917 B
TypeScript
Raw Normal View History

import type * as T from './type'
import http from '@/utils/http'
2025-07-30 09:13:52 +08:00
const BASE_URL = '/post'
2025-07-30 09:13:52 +08:00
/**
*
*/
export function addPost(data: T.PostAddReq) {
return http.post<any>(BASE_URL, data)
2025-07-30 09:13:52 +08:00
}
/**
*
*/
export function getPostDetail(postId: string) {
return http.get<T.PostVO>(`${BASE_URL}/detail/${postId}`)
2025-07-30 09:13:52 +08:00
}
/**
*
*/
export function listPost(params?: T.PostPageQuery) {
return http.get<T.PostVO[]>(`${BASE_URL}/list`, params)
2025-07-30 09:13:52 +08:00
}
/**
*
*/
export function pagePost(params?: T.PostPageQuery) {
return http.get<PageRes<T.PostVO[]>>(`${BASE_URL}/page`, params)
2025-07-30 09:13:52 +08:00
}
/**
*
*/
export function updatePost(postId: string, data: T.PostUpdateReq) {
return http.put<any>(`${BASE_URL}/${postId}`, data)
2025-07-30 09:13:52 +08:00
}
/**
*
*/
export function deletePost(postId: string) {
return http.del<any>(`${BASE_URL}/${postId}`)
}