import httpRequest from '@/module/request/http-request.js'
import ipConfig from '@/config/ip.config.js'

const api = {
	getPromoListUrl: ipConfig.api_app + '/activity/list',
	exchangeUrl: ipConfig.api_app + "/activity/exchange",
	getBetRankDataUrl: ipConfig.api_app + "/activity/betRankData",
	getSigninInfoUrl: ipConfig.api_app + "/signin/getSigninInfo",
	recvRewardUrl: ipConfig.api_app + "/signin/recvReward",
	canGiftCode: ipConfig.api_app + '/activity/giftCode',
	registerActivityData: ipConfig.api_app + '/activity/registerActivityData',
	registerActivityReward: ipConfig.api_app + '/activity/registerActivityReward',
	inviteRechageRankData: ipConfig.api_app + '/activity/inviteRechageRankData',
	inviteRechageRankHeadAwardList: ipConfig.api_app + '/activity/inviteRechageRankHeadAwardList',
	inviteRechageRankBelowData: ipConfig.api_app + '/activity/inviteRechageRankBelowData',
	inviteRechageRankBelowList: ipConfig.api_app + '/activity/inviteRechageRankBelowList',
	inviteRechageRankHeadAwardReceive: ipConfig.api_app + '/activity/inviteRechageRankHeadAwardReceive',
	getSpinBigAward: ipConfig.api_app + '/activity/getSpinBigAward',
	inviteRechageRankHistroyData: ipConfig.api_app + '/activity/inviteRechageRankHistroyData',
	getSpinResult: ipConfig.api_app + '/activity/invite/lottery',
	getLotteryRecord: ipConfig.api_app + '/activity/invite/lotteryRecord/',
	getActivity: ipConfig.api_app + '/activity/invite/joinAct', // 参与活动
	getPrize: ipConfig.api_app + '/activity/invite/getPrize',
	getJoinAct: ipConfig.api_app + '/activity/invite/getJoinAct',
	exchange2Tg: ipConfig.api_app + '/unioncode/check',
	getTypeDetail: ipConfig.api_app + '/activity/getByType/',
	checkRechargeAct: ipConfig.api_app + '/activity/recharge/checkAct',
	createRecharge: ipConfig.api_app + '/activity/recharge/createRecharge',
	getBonusAmount: ipConfig.api_app + '/activity/recharge/getAmount/',
	checkRedeposit: ipConfig.api_app + '/activity/recharge/lottery/checkAct',
	getRepositLottery: ipConfig.api_app + '/activity/recharge/lottery/lottery/',
	getSpinRecord: ipConfig.api_app + '/activity/recharge/lottery/record',
	getLotteryMsg: ipConfig.api_app + '/activity/recharge/lottery/rollMsg',
}
export const getLotteryMsgApi = () => {
	return httpRequest.post({
		url: api.getLotteryMsg,
		data: {}
	})
}
export const getSpinRecordApi = () => {
	return httpRequest.post({
		url: api.getSpinRecord,
		data: {}
	})
}
export const checkRedepositApi = () => {
	return httpRequest.post({
		url: api.checkRedeposit,
		data: {}
	})
}
export const getRepositLotteryApi = (params) => {
	return httpRequest.post({
		url: api.getRepositLottery + params.id,
		data: {}
	})
}
export const createRechargeApi = (params) => {
	return httpRequest.post({
		url: api.createRecharge,
		data: params
	})
}
export const getBonusAmountApi = (params) => {
	return httpRequest.post({
		url: api.getBonusAmount + params.id,
		data: {}
	})
}
export const checkRechargeActApi = (params) => {
	return httpRequest.post({
		url: api.checkRechargeAct,
		data: params
	})
}
export const getTypeDetailApi = (params) => {
	return httpRequest.post({
		url: api.getTypeDetail + params.type,
	})
}
export const getPrizeByTgApi = (params) => {
	return httpRequest.post({
		url: api.exchange2Tg + '/' + params.code,
	})
}
/**
 * 领取现金
 * @param {*} params 
 * @returns 
 */
export const getPrizeApi = (params) => {
	return httpRequest.post({
		url: api.getPrize,
		data: params
	})
}
/**
 * 获取活动信息
 * @param {*} params 
 * @returns 
 */
export const getJoinActApi = (params) => {
	return httpRequest.post({
		url: api.getJoinAct,
		data: params
	})
}
/**
 * 获取奖励
 * @param {*} params 
 * @returns 
 */
export const getPrizeListApi = (params) => {
	return httpRequest.post({
		url: api.getPrizeList,
		data: params
	})
}
/**
 * 参与活动
 * @param {*} params 
 * @returns 
 */
export const getActivity = (params) => {
	return httpRequest.post({
		url: api.getActivity,
		data: params
	})
}
/**
 * 抽奖记录
 * @param {*} params 
 * @returns 
 */
export const getLotteryRecord = (params) => {
	const { id, page, size } = params
	return httpRequest.post({
		url: api.getLotteryRecord + id + '?page=' + page + '&size=' + size,
	})
}
/**
 * 转盘列表
 */
export const getSpinList = (params) => {
	return httpRequest.post({
		url: api.getSpinList,
		data: params
	})
}
/**
 * 转盘结果
 */
export const getSpinResult = (params) => {
	return httpRequest.post({
		url: api.getSpinResult,
		data: params
	})
}
/**
 * 邀请活动历史
 */
export const getInviteRechageRankHistroyData = (params) => {
	return httpRequest.post({
		url: api.inviteRechageRankHistroyData,
		data: params
	})
}


/**
 * 转盘大奖
 */
export const getSpinBigAward = (params) => {
	return httpRequest.post({
		url: api.getSpinBigAward,
		data: params
	})
}

/**
 * 获取活动列表
 */
export const getPromoListApi = (params) => {
	return httpRequest.post({
		url: api.getPromoListUrl,
		data: params
	})
}


/**
 * 兑换
 */
export const exchangeApi = (params) => {
	return httpRequest.post({
		url: api.exchangeUrl,
		data: params
	})
}

/**
 * 获取排行榜数据
 */
export const getBetRankDataApi = (params) => {
	return httpRequest.post({
		url: api.getBetRankDataUrl,
		data: params
	})
}

/**
 * 获取签到数据
 */
export const getSigninInfoApi = (params) => {
	return httpRequest.post({
		url: api.getSigninInfoUrl,
		data: params
	})
}


/**
 * 获取签到数据
 */
export const recvRewardUrlApi = (params) => {
	return httpRequest.post({
		url: api.recvRewardUrl,
		data: params
	})
}

/**
 * jili活动code
 */
export const requestCanGiftCode = (params) => {
	return httpRequest.post({
		url: api.canGiftCode,
		data: params
	})
}

/**
 * 注册活动
 */
export const requestRegisterActivityData = (params) => {
	return httpRequest.post({
		url: api.registerActivityData,
		data: params
	})
}

/**
 * 注册活动领取
 */
export const requestRegisterActivityReward = (params) => {
	return httpRequest.post({
		url: api.registerActivityReward,
		data: params
	})
}

/**
 * 获取邀请充值排行榜数据
 */
export const requestInviteRechageRankData = (params) => {
	return httpRequest.post({
		url: api.inviteRechageRankData,
		data: params
	})
}

/**
 * 获取邀请充值排行榜人头奖记录
 */
export const requestInviteRechageRankHeadAwardList = (params) => {
	return httpRequest.post({
		url: api.inviteRechageRankHeadAwardList,
		data: params
	})
}

/**
 * 获取邀请充值排行榜下级数据
 */
export const requestInviteRechageRankBelowData = (params) => {
	return httpRequest.post({
		url: api.inviteRechageRankBelowData,
		data: params
	})
}


/**
 * 获取邀请充值排行榜下级数据
 */
export const requestInviteRechageRankBelowList = (params) => {
	return httpRequest.post({
		url: api.inviteRechageRankBelowList,
		data: params
	})
}


/**
 * 获取邀请充值排行榜下级数据
 */
export const requestInviteRechageRankHeadAwardReceive = (params) => {
	return httpRequest.post({
		url: api.inviteRechageRankHeadAwardReceive,
		data: params
	})
}

/**
 * 获取转盘结果
 */
export const requestGetSpinReward = (params) => {
	return httpRequest.post({
		url: ipConfig.api_app + '/activity/getSpinReward',
		data: params
	})
}

/**
 * 获取转盘结果记录
 */
export const requestGetSpinRewardLog = (params) => {
	return httpRequest.post({
		url: ipConfig.api_app + '/activity/getSpinAwardLog',
		data: params
	})
}

/**
 * 获取转盘剩余次数
 */
export const requestGetSpinActivityData = (params) => {
	return httpRequest.post({
		url: ipConfig.api_app + '/activity/getSpinActivityData',
		data: params
	})
}

/**
 * 获取转盘领奖
 */
export const requestClaimSpinAward = (params) => {
	return httpRequest.post({
		url: ipConfig.api_app + '/activity/claimSpinAward',
		data: params
	})
}
