index.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { defHttp } from '@/config/axios'
  2. import type { PostVO } from './types'
  3. // 查询岗位列表
  4. export const getPostPageApi = ({ params }) => {
  5. return defHttp.get<PageResult<PostVO>>({ url: '/system/post/page', params })
  6. }
  7. // 获取岗位精简信息列表
  8. export const listSimplePostsApi = () => {
  9. return defHttp.get<PostVO[]>({ url: '/system/post/list-all-simple' })
  10. }
  11. // 查询岗位详情
  12. export const getPostApi = (id: number) => {
  13. return defHttp.get<PostVO>({ url: '/system/post/get?id=' + id })
  14. }
  15. // 新增岗位
  16. export const createPostApi = (params: PostVO) => {
  17. return defHttp.post({ url: '/system/post/create', params })
  18. }
  19. // 修改岗位
  20. export const updatePostApi = (params: PostVO) => {
  21. return defHttp.put({ url: '/system/post/update', params })
  22. }
  23. // 删除岗位
  24. export const deletePostApi = (id: number) => {
  25. return defHttp.delete({ url: '/system/post/delete?id=' + id })
  26. }
  27. // 导出岗位
  28. export const exportPostApi = (params) => {
  29. return defHttp.get({ url: '/system/post/export', params, responseType: 'blob' })
  30. }