import request from '@/config/axios'

export interface CheckInVO {
  id: number
  userId : number
  checkInMonth: number
  checkInDate: string
  receivedReward: string
}

// 查询用户签到列表
export const getCheckInPage = async (params) => {
  return await request.get({ url: `/member/check-in/page`, params })
}

// 查询用户签到详情
export const getCheckIn = async (id: number) => {
  return await request.get({ url: `/member/check-in/get?id=` + id })
}

// 新增用户签到
export const createCheckIn = async (data: CheckInVO) => {
  return await request.post({ url: `/member/check-in/create`, data })
}

// 修改用户签到
export const updateCheckIn = async (data: CheckInVO) => {
  return await request.put({ url: `/member/check-in/update`, data })
}

// 删除用户签到
export const deleteCheckIn = async (id: number) => {
  return await request.delete({ url: `/member/check-in/delete?id=` + id })
}

// 导出用户签到 Excel
export const exportCheckIn = async (params) => {
  return await request.download({ url: `/member/check-in/export-excel`, params })
}
