import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { JudgePositionVO, JudgePositionForm, JudgePositionQuery } from '@/api/system/physical/judgePosition/types';
import { StoreVO } from '@/api/system/physical/store/types';

/**
 * 查询职务管理列表
 * @param query
 * @returns {*}
 */

export const listJudgePosition = (query?: JudgePositionQuery): AxiosPromise<JudgePositionVO[]> => {
  return request({
    url: '/physical/judgePosition/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询职务管理详细
 * @param id
 */
export const getJudgePosition = (id: string | number): AxiosPromise<JudgePositionVO> => {
  return request({
    url: '/physical/judgePosition/' + id,
    method: 'get'
  });
};

/**
 * 新增职务管理
 * @param data
 */
export const addJudgePosition = (data: JudgePositionForm) => {
  return request({
    url: '/physical/judgePosition',
    method: 'post',
    data: data
  });
};

/**
 * 修改职务管理
 * @param data
 */
export const updateJudgePosition = (data: JudgePositionForm) => {
  return request({
    url: '/physical/judgePosition',
    method: 'put',
    data: data
  });
};

/**
 * 删除职务管理
 * @param id
 */
export const delJudgePosition = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/judgePosition/' + id,
    method: 'delete'
  });
};
export const selectJudgePositionSelList = (): AxiosPromise<StoreVO> => {
  return request({
    url: '/physical/judgePosition/selectJudgePositionSelList',
    method: 'get'
  });
};
