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

// 参数类型定义
interface TaskAwardListParams {
  keyword?: string
  page?: number
  size?: number
  status?: string
  taskType?: string
}

interface TaskAwardData {
  description?: string
  extraReward?: number
  id?: string
  name: string
  status?: number
  taskType: string
}

/**
 * @description: 获取任务奖励列表
 */
export const getTaskAwardList = async (params: TaskAwardListParams) => {
  return await get<any>('/taskExtraConfig/list', params)
}

/**
 * @description: 更新任务奖励
 */
export const updateTaskAward = async (data: TaskAwardData) => {
  return await put('/taskExtraConfig', data)
}

/**
 * @description: 删除任务奖励
 * @param {*} params
 * @return {*}
 */
export const deleteTaskAward = async (id: string) => {
  return await del(`/taskExtraConfig/${id}`)
}

/**
 * @description: 新增任务奖励
 */
export const addTaskAward = async (data: TaskAwardData) => {
  return await post<any>('/taskExtraConfig', data)
}
