import { post, get, instance } from "@/utils/request";

enum URL {
  // 获取支付方式
  getPayMethod = '/getPayMethod',
  // 充值列表
  depositList = '/getShop2List',
  getPayClass = '/getPayClass',
  //用户充值
  userDeposit = '/buyShop2',
  // 提现方式
  getTransMethodList = '/getWithdrawMethod',
  // 提现列表
  withdrawList = '/getWithDrawAccountList',
  // 用户提现
  withdraw = '/withdraw',
  // 支付记录
  getPayRecords = '/getPayRecords',
  // 获取socket中心服务器url
  getCenterUrl = '/getCenterUrl',
  // 获取平台配置
  getPlatformConfig = '/getPlatformConfig',
  // 获取默认Notice
  getNotice = '/getNotice',
  getMail = '/getMail',
  // token 登录
  tokenLogin = '/tokenLogin',
  // 群组
  getCustomerGroup = '/getCustomerGroupList',
  // 获取分享链接
  getShareLink = '/getShareLink',
  getVipAwardCycle = '/receiveVipAward',
  setNoticeRead = '/readNotice',
  setMailRead = '/readMail',
  receiveMailAttachments = '/receiveMailAttachments',
  getOneOfThree = '/getOneOfThree',

  getChildRebate = '/getChildRebate',
  getChildRebateDetail = 'getChildRebateDetailPage',
  getChildRebateRecordsDetail = 'getChildRebateRecordsDetailPage',
  getChildRebateRecords = 'getChildRebateRecordsPage',
  getChildRebateInfo = 'getChildRebateInfo',
  getPayMethodList = 'getPayMethodList',
  oneOfThreeBuy = 'buyOneOfThree',
  receiveOneOfThree = 'receiveOneOfThree',
  receiveChildRebate = 'receiveChildRebate',

  getPopularizePhones = 'getPopularizePhones',
  getCoinsDetailLog = 'getCoinsDetailLogPage',
  getWithDrawRecord = 'getWithDrawRecordPage',

  helpTurntableTaskAward = 'receiveTurntable2',
  getHelpTurntable2Log = 'getHelpTurntable2Log',

  getCheckin = 'getCheckin',
  checkinDay = 'checkinDay',
  getMonthCheckinAward = 'getMonthCheckinAward',
  getPropsCache = 'updatePropsCache',

  receiveCycleRebateLoss = 'receiveCycleRebateLoss',
  // 个人下注返利
  getTotalRebate = '/getTotalRebate',
  // 领取个人下注返利
  receiveTotalRebate = '/receiveTotalRebate',

  getFlowRecord = 'getFlowRecordPage',
  diamondConvert = 'diamondConvert',

  pddAddProbability = 'addPddOdds',
  pddAwardRecords='pddAwardRecords',
  getPddTask='getPddTask',
  pddPointsBuy='buyPddScore',
  getVipLvAward = '/receiveVipAwardLevel',
}

export const pddAddProbability = async (data: any) => {
  return await instance(URL.pddAddProbability, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};


export const pddPointsBuy = async (data: any) => {
  return await instance(URL.pddPointsBuy, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};


export const getHelpTurntable2Log = async (data: any) => {
  return await instance(URL.getHelpTurntable2Log, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};


export const getPayRecords = async (data: any) => {
  return await instance(URL.getPayRecords, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

export const pddAwardRecords = async (data: any) => {
  return await instance(URL.pddAwardRecords, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};



export const getFlowRecordPage = async (data: any) => {
  return await instance(URL.getFlowRecord, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};


export const getPropsCache = async (data: any) => {
  return await instance(URL.getPropsCache, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

export const getWithDrawRecord = async (data: any) => {
  return await instance(URL.getWithDrawRecord, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

export const getChildRebate = async (data: any) => {
  return await instance(URL.getChildRebate, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getChildRebateDetail = async (data: any) => {
  return await instance(URL.getChildRebateDetail, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getChildRebateRecordsDetail = async (data: any) => {
  return await instance(URL.getChildRebateRecordsDetail, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getChildRebateRecords = async (data: any) => {
  return await instance(URL.getChildRebateRecords, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getChildRebateInfo = async (data: any) => {
  return await instance(URL.getChildRebateInfo, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getCoinsDetailLog = async (data: any) => {
  return await instance(URL.getCoinsDetailLog, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

export const getVipLvAward = async (data: any) => {
  return await instance(URL.getVipLvAward, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

export const diamondConvert = (data: any) => post(URL.diamondConvert, data);
export const getTotalRebate = (data: any) => post(URL.getTotalRebate, data);
export const receiveTotalRebate = (data: any) => post(URL.receiveTotalRebate, data);
export const getCheckin = (data: any) => post(URL.getCheckin, data);
export const receiveCycleRebateLoss = (data: any) => post(URL.receiveCycleRebateLoss, data);
export const checkinDay = (data: any) => post(URL.checkinDay, data);
export const getMonthCheckinAward = (data: any) => post(URL.getMonthCheckinAward, data);
export const helpTurntableTaskAward = (data: any) => post(URL.helpTurntableTaskAward, data);
export const getOneOfThree = (data: any) => post(URL.getOneOfThree, data);
export const getPayMethodList = (data: any) => post(URL.getPayMethodList, data);
export const oneOfThreeBuy = (data: any) => post(URL.oneOfThreeBuy, data);
export const receiveOneOfThree = (data: any) => post(URL.receiveOneOfThree, data);
export const receiveChildRebate = (data: any) => post(URL.receiveChildRebate, data);
export const getPopularizePhones = (data: any) => post(URL.getPopularizePhones, data);

export const depositList = (data: any) => post(URL.depositList, data);
export const getPayClass = (data: any) => post(URL.getPayClass, data);
/**
     * vip 日周月领奖
     * @param {number} awardType 领奖类型 0每日奖励 1每周奖励 2每月奖励
     * @returns
     */
export const getVipAwardCycle = async (data: any) => {
  return await instance(URL.getVipAwardCycle, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
// export const getVipAwardCycle = (data: any) => post(URL.getVipAwardCycle, data);

export const getPddTask = (data: any) => post(URL.getPddTask, data);
export const userDeposit = (data: any) => post(URL.userDeposit, data);

export const withdrawList = (data: any) => post(URL.withdrawList, data);
export const getTransMethodList = (data: any) => post(URL.getTransMethodList, data);

export const withdraw = (data: any) => post(URL.withdraw, data);

export const getCenterUrl = () => post(URL.getCenterUrl);
// 获取平台配置
export const getPlatformConfig = () => post(URL.getPlatformConfig);
// 获取默认Notice
export const getNotice = async (data: any) => {
  return await instance(URL.getNotice, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const setNoticeRead = async (data: any) => {
  return await instance(URL.setNoticeRead, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getMail = async (data: any) => {
  return await instance(URL.getMail, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const setMailRead = async (data: any) => {
  return await instance(URL.setMailRead, {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

export const receiveMailAttachments = async (data: any) => {
  return await instance(URL.receiveMailAttachments, {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

//获取分享链接
export const getShareLink = () => post(URL.getShareLink);
// token 登录
export const tokenLogin = () => post(URL.tokenLogin)
// 群组
export const getCustomerGroup = () => post(URL.getCustomerGroup)

// 埋点
export const adPoint = (data: CustomObject) => post('https://007.czgame.xyz:2087/api/ad/upload', data)