import { defHttp } from '/@/utils/http/axios';
import { Result } from '/#/axios';

enum Api {
  authorizeModelingList = '/service/agent/authorizeModeling/list',
  authorizeModelingaddOrUpdate = '/service/agent/authorizeModeling/addOrUpdate',
  authorizeModelingdelete = '/service/agent/authorizeModeling/delete',
  authorizeInstallList = '/service/agent/authorizeInstall/list',
  authorizeInstalladdOrUpdate = '/service/agent/authorizeInstall/addOrUpdate',
  authorizeInstalldelete = '/service/agent/authorizeInstall/delete',
  checkMachineCode = '/service/agent/authorizeInstall/checkMachineCode',
  authorizeCameraList = '/service/agent/authorizeCamera/list',
  authorizeCameraaddOrUpdate = '/service/agent/authorizeCamera/addOrUpdate',
  authorizeCameradelete = '/service/agent/authorizeCamera/delete',
  authorizeCameradetail = '/service/agent/authorizeCamera/detail/',
  authorizeCameraupdateSnCode = '/service/agent/authorizeCamera/updateSnCode/',
  authorizeCamerasnUpdateLog = '/service/agent/authorizeCamera/snUpdateLog/',
}

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

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

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

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

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

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

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

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

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

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

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

//全部权益使用类型
export const authorizeCameradetail = (id) =>
  defHttp.get<Result>({
    url: Api.authorizeCameradetail + id,
    params: {},
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//全部权益使用类型
export const authorizeCameraupdateSnCode = ({ id, snCode }) =>
  defHttp.get<Result>({
    url: Api.authorizeCameraupdateSnCode + id + '/' + snCode,
    params: {},
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//全部权益使用类型
export const authorizeCamerasnUpdateLog = (id) =>
  defHttp.get<Result>({
    url: Api.authorizeCamerasnUpdateLog + id,
    params: {},
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
