import request from '/@/utils/request';

/**
 * 获取门禁规则列表
 */
export const fetchList = (query: any) => {
  return request({
    url: '/stuwork/entrancerule/page',
    method: 'get',
    params: query
  });
};

/**
 * 获取门禁规则详情
 */
export const getObj = (query: any) => {
  return request({
    url: '/stuwork/entrancerule/detail',
    method: 'get',
    params: query
  });
};

/**
 * 新增门禁规则
 */
export const addObj = (obj: any) => {
  return request({
    url: '/stuwork/entrancerule',
    method: 'post',
    data: obj
  });
};

/**
 * 编辑门禁规则
 */
export const putObj = (obj: any) => {
  return request({
    url: '/stuwork/entrancerule/edit',
    method: 'post',
    data: obj
  });
};

/**
 * 删除门禁规则
 */
export const delObjs = (ids: string[]) => {
  return request({
    url: '/stuwork/entrancerule/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 开启/关闭假期模式
 */
export const openHoliday = (obj: any) => {
  return request({
    url: '/stuwork/entrancerule/openHoliday',
    method: 'post',
    data: obj
  });
};

