/* eslint-disable no-confusing-arrow */
import { post, get } from '@/api/request'
import CONFIG from '@/config'
const { env, 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 getLiveLottery = data =>
  flag
    ? get('/activity/Draw/getLiveDraw', { data })
    : get('/activity/Draw/getLiveDraw', { data, baseURL: activityDomain })

// 获取用户抽奖记录
export const getUserRecord = data =>
  flag
    ? get('/activity/DrawResult/getUserRecord', { data })
    : get('/activity/DrawResult/getUserRecord', { data, baseURL: activityDomain })
