52 lines
1.0 KiB
TypeScript
52 lines
1.0 KiB
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) {
|
|
}
|
|
|
|
/**
|
|
* 查询岗位下的用户信息
|
|
*/
|
|
export function getPostUsers(postId: string) {
|
|
return http.get<T.UserNewResp[]>(`${BASE_URL}/${postId}/user`);
|
|
} |