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

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

/**
 * @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 ListApi = (params: PageParams) =>
//   defHttp.post<RentListGetResultModel>({
//     url: Api.pageList,
//     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,
    },
  });
