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

/**
 * @description: 获取道具列表-查询列表
 * @param {*} params
 * @returns {*}
 */

export const getToolList = async (params: Record<string, any>) => {
  return await get<any>('/property/list', params)
}
/**
 * @description: 获取道具详情
 * @param {*} id
 * @returns {*}
 */
export const getToolDetail = async (id: string) => {
  return await get<any>(`/property/${id}`)
}
/**
 * @description: 更新道具
 * @param {*} data
 * @returns {*}
 */
export const updateTool = async (data: Record<string, any>) => {
  return await put('/property', data)
}
/**
 * @description: 新增道具
 * @param {*} data
 * @returns {*}
 */
export const addTool = async (data: Record<string, any>) => {
  return await post<any>('/property', data)
}
/**
 * @description: 通过id删除道具
 * @param {*} id
 * @returns {*}
 */
export const deleteToolById = async (id: string) => {
  return await del(`/property/${id}`)
}
