import request from '@/config/axios'

export interface SignInRecordVO {
  id: number
  userId: number
  signInDate: string
  signInMonth: string
  rewardIssued: number
  reward: number
}

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

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

// 新增用户签到记录
export const createSignInRecord = async (data: SignInRecordVO) => {
  return await request.post({ url: `/member/sign-in-record/create`, data })
}

// 修改用户签到记录
export const updateSignInRecord = async (data: SignInRecordVO) => {
  return await request.put({ url: `/member/sign-in-record/update`, data })
}

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

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