import { defHttp } from '/@/utils/http/axios';
import {
  selectUserListParam,
  checkDeiceParam,
  addDeiceParam,
  checkUserParam,
  SubAccountUsers,
  selectCompanyParam,
  auditParam,
  addPointParam,
} from './model';
import type { Result } from '/#/axios';

enum Api {
  addDevice = '/kankan-api/api/manager/company/addDevice',
  checkDevice = '/kankan-api/api/manager/company/checkDevice',
  selectUserList = '/kankan-api/api/manager/company/selectUserList',
  addPoint = '/kankan-api/api/manager/company/addPoint',
  checkUserAddAble = '/kankan-api/api/manager/company/checkUserAddAble',
  saveSubUsers = '/kankan-api/api/manager/company/saveSubUsers',
  // selectCompanyById = '/kankan-api/api/company/selectCompanyById',
  selectCompanyById = '/kankan-api/api/manager/company/findById',
  auditCompany = '/kankan-api/api/manager/company/auditCompany',
}
/**
 * @description: Get sample list value
 */

export const AddDevice = (params: addDeiceParam) =>
  defHttp.post<Result>({
    url: Api.addDevice,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const checkDevice = (params: checkDeiceParam) =>
  defHttp.post<Result>({
    url: Api.checkDevice,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const auditCompany = (params: auditParam) =>
  defHttp.post<Result>({
    url: Api.auditCompany,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const addPoint = (params: addPointParam) =>
  defHttp.post<Result>({
    url: Api.addPoint,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const selectUserList = (params: selectUserListParam) =>
  defHttp.post<Result>({
    url: Api.selectUserList,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const checkUserAddAble = (params: checkUserParam) =>
  defHttp.post<Result>({
    url: Api.checkUserAddAble,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const selectCompanyById = (params: selectCompanyParam) =>
  defHttp.post<Result>({
    url: Api.selectCompanyById,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const saveSubUsers = (params: SubAccountUsers) =>
  defHttp.post<Result>({
    url: Api.saveSubUsers,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
