import { defHttp } from '/@/utils/http/axios';
import { PageParams, RentListGetResultModel, addCameraParams } from './model';

enum Api {
  pageList = '/zfb-api/zfb/camera/pageList',
  addCamera = '/zfb-api/zfb/camera/add',
  allCompany = '/zfb-api/zfb/company/listAll',
  unbindDevice = '/zfb-api/zfb/company/unbindDevice',
  editCamera = '/zfb-api/zfb/camera/update',
}

/**
 * @description: Get sample list value
 */

export const ListApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.pageList,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const unDeviceApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.unbindDevice,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const allCompanyApi = (params: PageParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.allCompany,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const addCameraApi = (params: addCameraParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.addCamera,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const editCameraApi = (params: addCameraParams) =>
  defHttp.post<RentListGetResultModel>({
    url: Api.editCamera,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
