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

enum Api {
  pageList = '/service/manage/user/list',
  userDetail = '/service/manage/user/userDetail',
  getIncrementListByUserId = '/service/manage/user/getIncrementListByUserId',
  IncrementDelay = '/service/manage/user/incrementDelay',
  addUserIncrement = '/service/manage/user/addUserIncrement',
  addDownNum = '/service/manage/user/addDownNum',
  getCameraDetail = '/service/manage/user/getCameraDetail',
  unbindCamera = '/service/manage/user/unbindCamera',
  allList = '/service/manage/incrementType/allList',
}

/**
 * @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 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 UnbindCameraApi = (params: PageParams) =>
defHttp.get<userList>({
  url: Api.unbindCamera,
  params: params,
  headers: {
    // @ts-ignore
    ignoreCancelToken: true,
  },
});