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

/**
 * 分页查询宿舍月卫生列表
 * @param query 查询参数
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/dormhygienemonthly/page',
    method: 'get',
    params: query
  });
};

/**
 * 通过id查询详情
 * @param id 主键ID
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/dormhygienemonthly/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 新增宿舍月卫生
 * @param data 数据对象
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/dormhygienemonthly',
    method: 'post',
    data
  });
};

/**
 * 修改宿舍月卫生
 * @param data 数据对象
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/dormhygienemonthly/edit',
    method: 'post',
    data
  });
};

/**
 * 删除宿舍月卫生
 * @param ids ID数组
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/dormhygienemonthly/delete',
    method: 'post',
    data: ids
  });
};

/**
 * 触发宿舍月卫生评比
 * @param data 评比参数
 */
export const triggerEvaluation = (data: any) => {
  return request({
    url: '/stuwork/dormhygienemonthly/dormHygieneMonthlyCheckForInnerOut',
    method: 'post',
    data
  });
};