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

/**
 * @description: 获取服装列表-查询列表
 * @param {*} params
 * @returns {*}
 */
export const getClothingList = async (params: Record<string, any>) => {
  return await get<any>('/clothing/list', params)
}

/**
 * @description: 获取服装详情
 * @param {*} id
 * @returns {*}
 */
export const getClothingDetail = async (id: string) => {
  return await get<any>(`/clothing/${id}`)
}

/**
 * @description: 更新服装
 * @param {*} data
 * @returns {*}
 */
export const updateClothing = async (data: Record<string, any>) => {
  return await put('/clothing', data)
}

/**
 * @description: 新增服装
 * @param {*} data
 * @returns {*}
 */
export const addClothing = async (data: Record<string, any>) => {
  return await post<any>('/clothing', data)
}

/**
 * @description: 通过id删除服装
 * @param {*} id
 * @returns {*}
 */
export const deleteClothingById = async (id: string) => {
  return await del(`/clothing/${id}`)
}

/**
 * @description: 根据模型id查材质文件
 * @param {*} id
 * @returns {*}
 */
export const getMaterialByModelId = async (modelId: string) => {
  return await get<any>(`/modelMaterial/getByModelId/${modelId}`)
}

/**
 * @description: 获取道具途径
 * @param {*} id
 * @returns {*}
 */
export const getPropertyCodeWithDiamond = async () => {
  return await get<any>('/property/propertyCodeWithDiamond')
}
