import { defHttp } from '/@/utils/http/axios';
import { PageParams, userList } from './model';
import { Result } from '/#/axios';

enum Api {
  pageList = '/service/agent/user/list',
  userDetail = '/service/agent/user/userDetail',
  getIncrementListByUserId = '/service/agent/user/getIncrementListByUserId',
  IncrementDelay = '/service/agent/user/incrementDelay',
  addUserIncrement = '/service/agent/user/addUserIncrement',
  addDownNum = '/service/agent/user/addDownNum',
  getCameraDetail = '/service/agent/user/getCameraDetail',
  unbindCamera = '/service/agent/camera/unBindCamera',
  allList = '/service/agent/incrementType/allList',
  cameraAllType = '/service/agent/cameraType/allList',
  wifiPrefixAll = '/service/agent/cameraWifiPrefix/allList',
  incrementUseTypeList = '/service/agent/incrementUseType/allList',
  getAddUserIncrementTime = '/service/agent/user/getAddUserIncrementTime',
  currencyList = '/service/agent/currency/allList',
  incrementBindCamera = '/service/agent/user/incrementBindCamera',
  incrementUnBindCamera = '/service/agent/user/incrementUnBindCamera',
}

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

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

//权益详情
export const userDetail = (params: PageParams) =>
  defHttp.get<userList>({
    url: Api.userDetail,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//权益详情
export const DetailsApi = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.getIncrementListByUserId,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//权益延期
export const IncrementDelayApi = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.IncrementDelay,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//权益延期
export const dincrementList = (params: PageParams) =>
  defHttp.get<userList>({
    url: Api.allList,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//延期时间
export const getAddUserIncrementTime = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.getAddUserIncrementTime,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//添加用户权益
export const AddUserIncrementApi = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.addUserIncrement,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//加用户下载次数
export const AddDownNumApi = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.addDownNum,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//获取相机详情
export const GetCameraDetailApi = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.getCameraDetail,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
//获取相机详情
export const incrementBindCamera = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.incrementBindCamera,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
//获取相机详情
export const incrementUnBindCamera = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.incrementUnBindCamera,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//相机解绑
export const UnbindCameraApi = (params: PageParams) =>
  defHttp.post<userList>({
    url: Api.unbindCamera,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

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

//全部权益使用类型
export const currencyList = (params: PageParams) =>
  defHttp.get<userList>({
    url: Api.currencyList,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
//设备类型字典
export const cameraAllType = (params: PageParams) =>
  defHttp.get<userList>({
    url: Api.cameraAllType,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

//wifi前缀字典
export const wifiPrefixAll = (params: PageParams) =>
  defHttp.get<userList>({
    url: Api.wifiPrefixAll,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
