import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ShiftTeamForm, ShiftTeamQuery, ShiftTeamVO } from './types';

export const listShiftTeam = (params?: ShiftTeamQuery): AxiosPromise<ShiftTeamVO[]> => {
  return request({
    url: '/ems/shiftTeam/list',
    method: 'get',
    params
  });
};

export const getShiftTeam = (id: string | number): AxiosPromise<ShiftTeamVO> => {
  return request({
    url: '/ems/shiftTeam/' + id,
    method: 'get'
  });
};

export const addShiftTeam = (data: ShiftTeamForm) => {
  return request({
    url: '/ems/shiftTeam',
    method: 'post',
    data
  });
};

export const updateShiftTeam = (data: ShiftTeamForm) => {
  return request({
    url: '/ems/shiftTeam',
    method: 'put',
    data
  });
};

export const delShiftTeam = (ids: string | number | Array<string | number>) => {
  return request({
    url: '/ems/shiftTeam/' + ids,
    method: 'delete'
  });
};
