import request from './request';
let api = {
  getRewardGiftList: '/Program/Index/getRewardGiftList', // 获取礼物打赏配置
  rewardGift: '/Program/Reward/rewardGift', // 礼物打赏
  reward: '/Program/Reward/reward' // 打赏
};
const prodApi = {
  getRewardGiftList: 'https://privateapi.guangdianyun.tv/v1/Program/Index/getRewardGiftList', // 获取礼物打赏配置
  rewardGift: 'https://privateapi.guangdianyun.tv/v1/Program/Reward/rewardGift', // 礼物打赏
  reward: 'https://privateapi.guangdianyun.tv/v1/Program/Reward/reward' // 打赏
};
const preApi = {
  // getRewardGiftList: '', // 获取礼物打赏配置
  // rewardGift: '', // 礼物打赏
  // reward: '' // 打赏
};
const testApi = {
  // getRewardGiftList: '', // 获取礼物打赏配置
  // rewardGift: '', // 礼物打赏
  // reward: '' // 打赏
};
if (!process.env.private) {
  if (!process.env.X_CA_STAGE) {
    api = { ...api, ...prodApi };
  } else if (process.env.X_CA_STAGE === 'PRE') {
    api = { ...api, ...preApi };
  } else if (process.env.X_CA_STAGE === 'TEST') {
    api = { ...api, ...testApi };
  }
}

export const getRewardGiftList = data => {
  return request.get(api['getRewardGiftList'], data);
};
export const rewardGift = data => {
  return request.post(api['rewardGift'], data);
};
export const reward = data => {
  return request.post(api['reward'], data);
};

export default {
  getRewardGiftList,
  rewardGift,
  reward
};
