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

/**
 * @description: 获取商城模型列表-查询列表
 * @param {*} params
 * @returns {*}
 */

export const getMallModelList = async (params: Record<string, any>) => {
  return await get<any>('/model/list', params)
}

/**
 * @description: 获取模型详情
 * @param {*} id
 * @returns {*}
 */
export const getMallModelDetail = async (id: string) => {
  return await get<any>(`/model/${id}`)
}

/**
 * @description: 新增或修改模型
 * @param {*} data
 * @returns {*}
 */
export const addOrUpdateMallModel = async (data: Record<string, any>) => {
  return await post<any>('/model', data)
}

/**
 * @description: 通过id删除模型
 * @param {*} id
 * @returns {*}
 */
export const deleteMallModelById = async (id: string) => {
  return await del(`/model/${id}`)
}
