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

const api = {
	getAgentInfoUrl: ipConfig.api_app + '/invite/agent/info',
	receiveRebateUrl: ipConfig.api_app + '/invite/agent/receiveRebate',
	agentV2Home: ipConfig.api_app + '/agentV2/home',
	agentV2MyRewardBaseInfo: ipConfig.api_app + '/agentV2/myRewardBaseInfo',
	agentV2MyRewardList: ipConfig.api_app + '/agentV2/myRewardList',
	agentV2MyTeamsBaseInfo: ipConfig.api_app + '/agentV2/myTeamsBaseInfo',
	agentV2MyTeamsList: ipConfig.api_app + '/agentV2/myTeamsList',
	agentV2ClaimAward: ipConfig.api_app + '/agentV2/claimAward',
	agentV2LevelConfig: ipConfig.api_app + '/agentV2/levelConfig',
}

/**
 * 获取分销等级规则
 */
export const getAgentV2LevelConfig = (params) => {
	return httpRequest.post({
		url: api.agentV2LevelConfig,
		data: params
	})
}

/**
 * 获取分销home
 */
export const getAgentV2Home = (params) => {
	return httpRequest.post({
		url: api.agentV2Home,
		data: params
	})
}

/**
 * 获取分销奖励
 */
export const agentV2ClaimAward = (params) => {
	return httpRequest.post({
		url: api.agentV2ClaimAward,
		data: params
	})
}

/**
 * 获取分销reward
 */
export const getAgentV2MyRewardBaseInfo = (params) => {
	return httpRequest.post({
		url: api.agentV2MyRewardBaseInfo,
		data: params
	})
}

/**
 * 获取分销reward list
 */
export const getAgentV2MyRewardList = (params) => {
	return httpRequest.post({
		url: api.agentV2MyRewardList,
		data: params
	})
}

/**
 * 获取分销teams
 */
export const getAgentV2MyTeamsBaseInfo = (params) => {
	return httpRequest.post({
		url: api.agentV2MyTeamsBaseInfo,
		data: params
	})
}

/**
 * 获取分销teams list
 */
export const getAgentV2MyTeamsList = (params) => {
	return httpRequest.post({
		url: api.agentV2MyTeamsList,
		data: params
	})
}


/**
 * 获取分销员信息
 */
export const getAgentInfoApi = (params) => {
	return httpRequest.post({
		url: api.getAgentInfoUrl,
		data: params
	})
}


/**
 * 领取返利
 */
export const receiveRebateApi = (params) => {
	return httpRequest.post({
		url: api.receiveRebateUrl,
		data: params
	})
}
