| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import axiosInstance from '../utils/axios';
- // 岗位状态枚举
- export enum PostStatus {
- DISABLE = 0, // 禁用
- ENABLE = 1 // 启用
- }
- // 岗位 VO
- export interface PostVO {
- id?: number;
- name: string;
- code: string;
- sort: number;
- status: number;
- remark: string;
- createTime?: Date;
- }
- // 分页参数类型
- export interface PageParam {
- pageNo?: number;
- pageSize?: number;
- name?: string;
- code?: string;
- status?: number;
- [key: string]: any;
- }
- // 分页响应类型
- export interface PageResponse<T> {
- list: T[];
- total: number;
- }
- // 岗位管理 API
- export const postApi = {
- // 查询岗位列表(分页)
- getPostPage: (params?: PageParam) => {
- return axiosInstance.get<PageResponse<PostVO>>('/system/post/page', { params });
- },
- // 获取岗位精简信息列表
- getSimplePostList: () => {
- return axiosInstance.get<PostVO[]>('/system/post/simple-list');
- },
- // 查询岗位详情
- getPost: (id: number) => {
- return axiosInstance.get<PostVO>(`/system/post/get?id=${id}`);
- },
- // 新增岗位
- createPost: (data: PostVO) => {
- return axiosInstance.post('/system/post/create', data);
- },
- // 修改岗位
- updatePost: (data: PostVO) => {
- return axiosInstance.put('/system/post/update', data);
- },
- // 删除岗位
- deletePost: (id: number) => {
- return axiosInstance.delete(`/system/post/delete?id=${id}`);
- },
- // 导出岗位
- exportPost: (params?: PageParam) => {
- return axiosInstance.get('/system/post/export', {
- params,
- responseType: 'blob'
- });
- },
- };
|