import { defHttp } from '/@/utils/http/axios';
import { listParams, checkParams, dincrementResult } from './model';
import { Result } from '/#/axios';

enum Api {
  incrementAdd = '/service/agent/increment/add',
  incrementRenew = '/service/agent/increment/renew',
  checkUserName = '/service/agent/increment/checkUserName',
  checkjxsUserName = '/service/agent/agentManage/checkUserName',
  listApi = '/service/agent/increment/list',
  allList = '/service/agent/incrementType/allList',
  addDowm = '/service/agent/down/add',
  dowmList = '/service/agent/down/list',
  cameraIncrementLog = '/service/agent/cameraIncrementLog/list',
}

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

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

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

//权益延期
export const dincrementList = (params) =>
  defHttp.get<dincrementResult>({
    url: Api.allList,
    params: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const renewApi = (params: checkParams) =>
  defHttp.post<Result>({
    url: Api.incrementRenew,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

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

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

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

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