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

46 lines
926 B
TypeScript
Raw Normal View History

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