import http from '@/utils/http'

/**
 * 藏品-新增 /编辑
 */
export const API_goodsAdd = (data: any, type: '新增' | '编辑') => {
  const url = type === '新增' ? 'cms/goods/add' : 'cms/goods/edit'

  return http.post(url, data)
}

/**
 * 藏品-获取详情
 */
export const API_goodsInfo = (id: number) => {
  return http.get(`cms/goods/detail/${id}`)
}

/**
 * 从已存在的藏品中添加
 */
export const API_goodsNowAdd = (url: string, data: any) => {
  return http.post(url, data)
}
