import { defHttp } from '/@/utils/http/axios';
import { setParams } from '/@/utils/index';

enum Api {
  checkQueryPage = '/archives/patrolWard/query/page',
  checkDetail = '/archives/patrolWard/detail',
  checkAdd = '/archives/patrolWard/add',
  checkEdit = '/archives/patrolWard/edit',
  checkRemove = '/archives/patrolWard/removeByIds',
  checkQueryCheckRoomRecord = '/archives/patrolWard/queryCheckRoomRecord',
  checkQueryPersonNumber = '/archives/patrolWard/queryPersonNumber',
  checkFollowOrNo = '/archives/patrolWard/followOrNo',
}

export const checkQueryCheckRoomRecord = (params?: object) => {
  return defHttp.post({
    url: Api.checkQueryCheckRoomRecord,
    params: setParams(params),
  });
};

export const checkQueryPage = (params?: object) => {
  return defHttp.post({
    url: Api.checkQueryPage,
    params: setParams(params),
  });
};

export const checkDetail = (id: string) => {
  return defHttp.get({ url: Api.checkDetail + '/' + id });
};

export const checkAdd = (params?: object) => {
  return defHttp.post({ url: Api.checkAdd, params: params });
};

export const checkEdit = (params?: object) => {
  return defHttp.post({ url: Api.checkEdit, params: params });
};

export const checkRemove = (params: Array<string | number>) => {
  return defHttp.post({ url: Api.checkRemove, params: params });
};

export const checkQueryPersonNumber = () => {
  return defHttp.get({ url: Api.checkQueryPersonNumber });
};

export const checkFollowOrNo = (id?: string) => {
  return defHttp.post({ url: Api.checkFollowOrNo + '/' + id });
};
