import request from '@/config/axios'

// 幸运抽奖-抽奖记录 VO
export interface LuckLotteryRecordVO {
  id: number // id
  userId: number // 用户id
  lotteryId: number // 活动id
  prizeId: number // 奖品id
  type: string // 奖品类型1：未中奖 2：积分3:余额 4：红包 5:优惠券 6：站内商品 7：等级经验 8：用户等级 9：svip天数'
  isReceive: boolean // 是否领取
  receiveTime: Date // 领取时间
  receiveInfo: string // 收获地址、备注等
  isDeliver: boolean // 是否发货
  deliverTime: Date // 发货处理时间
  deliverInfo: string // 发货单号、备注等
}

// 幸运抽奖-抽奖记录 API
export const LuckLotteryRecordApi = {
  // 查询幸运抽奖-抽奖记录分页
  getLuckLotteryRecordPage: async (params: any) => {
    return await request.get({ url: `/promotion/luck-lottery-record/page`, params })
  },

  // 查询幸运抽奖-抽奖记录详情
  getLuckLotteryRecord: async (id: number) => {
    return await request.get({ url: `/promotion/luck-lottery-record/get?id=` + id })
  },

  // 新增幸运抽奖-抽奖记录
  createLuckLotteryRecord: async (data: LuckLotteryRecordVO) => {
    return await request.post({ url: `/promotion/luck-lottery-record/create`, data })
  },

  // 修改幸运抽奖-抽奖记录
  updateLuckLotteryRecord: async (data: LuckLotteryRecordVO) => {
    return await request.put({ url: `/promotion/luck-lottery-record/update`, data })
  },

  // 删除幸运抽奖-抽奖记录
  deleteLuckLotteryRecord: async (id: number) => {
    return await request.delete({ url: `/promotion/luck-lottery-record/delete?id=` + id })
  },

  // 导出幸运抽奖-抽奖记录 Excel
  exportLuckLotteryRecord: async (params) => {
    return await request.download({ url: `/promotion/luck-lottery-record/export-excel`, params })
  }
}