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

46 lines
926 B
TypeScript

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