import { del, get, post } from '../../http'

/**
 * @description: 获取扭蛋权重列表-查询列表
 * @param {*} data
 * @returns {*}
 */
const gettwistedEggList = async () => {
  return await get<any>('/twistTagProbability/listAdmin')
}

/**
 * @description: 新增扭蛋奖品下拉框数据获取
 * @param {*} data
 * @returns {*}
 */
const getTwistedEggRewardList = async (params: Record<string, any>) => {
  return await get<any>('/twistTagProbability/listAllTwistEggReward', params)
}

/**
 * @description: 新增扭蛋奖品
 * @param {*} data
 * @returns {*}
 */
const addTwistedEggReward = async (data: any) => {
  return await post<any>('/twistEggProbability', data)
}

/**
 * @description: 删除扭蛋奖品
 * @param {*} data
 * @returns {*}
 */
const deleteTwistedEggReward = async (id: string) => {
  return await del(`/twistEggProbability/${id}`)
}

/**
 * @description: 修改扭蛋奖品
 * @param {*} data
 * @returns {*}
 */
const changeTwistedEggReward = async (data: Record<string, any>) => {
  return await post<any>('/twistEggProbability/updateBatchAdmin', data)
}

/**
 * @description: 更新指定标签概率
 * @param {*} data
 * @returns {*}
 */
const ipDataTwistedEggReward = async (data: Record<string, any>) => {
  return await post<any>(
    '/twistTagProbability/updateSpecificTagProbability',
    data,
  )
}

const twistedEggApi = {
  gettwistedEggList,
  getTwistedEggRewardList,
  addTwistedEggReward,
  deleteTwistedEggReward,
  changeTwistedEggReward,
  ipDataTwistedEggReward,
}

export default twistedEggApi
