/* eslint-disable no-confusing-arrow */
import { post, get } from '@/api/request'
import CONFIG from '@/config'
const { env, privateDomain, activityDomain } = CONFIG
const flag = env || CONFIG.private

// 获取抽奖(场次)列表
export const getLotterySessionList = data =>
  flag
    ? get('/activity/Draw/getDrawList', { data })
    : get('/activity/Draw/getDrawList', { data, baseURL: activityDomain })

// 获取抽奖信息
export const getLotteryInfos = data =>
  flag
    ? get('/activity/Draw/getDrawInfo', { data })
    : get('/activity/Draw/getDrawInfo', { data, baseURL: activityDomain })

// 抽奖
export const setLottery = data =>
  flag ? post('/activity/Draw/drawing', data) : post('/activity/Draw/drawing', data, { baseURL: activityDomain })

// 获取抽奖记录列表
export const getLotteryRecordList = data =>
  flag
    ? get('/activity/DrawResult/personResult', { data })
    : get('/activity/DrawResult/personResult', { data, baseURL: activityDomain })

// 获取中奖名单列表
export const getWinnersList = data =>
  flag
    ? get('/activity/Draw/getWinningRecord', { data })
    : get('/activity/Draw/getWinningRecord', { data, baseURL: activityDomain })

// 绑定手机号-已废弃
export const setBindMobile = data =>
  flag
    ? post('/Program/Login/bindMobileForDraw', data)
    : post('/Program/Login/bindMobileForDraw', data, { baseURL: privateDomain })
