import request from '@/utils/request';

// 推荐位配置
const recommendUrl = '/product/recommend';

// 查询推荐位列表
export function listRecommend(params: any) {
  return request.get(recommendUrl + '/list', { params });
}

// 获取推荐位详情
export function getRecommend(id: number | string) {
  return request.get(`${recommendUrl}/${id}`);
}

// 新增推荐位
export function addRecommend(data: any) {
  return request.post(recommendUrl, data);
}

// 修改推荐位
export function updateRecommend(data: any) {
  return request.put(recommendUrl, data);
}

// 删除推荐位
export function delRecommend(id: number | string) {
  return request.delete(`${recommendUrl}/${id}`);
}

// 推荐关联
const linkUrl = '/product/recommendLink';

// 查询推荐关联列表
export function listRecommendLink(params: any) {
  return request.get(linkUrl + '/list', { params });
}

// 新增推荐关联
export function addRecommendLink(data: any) {
  return request.post(linkUrl, data);
}

// 删除推荐关联
export function delRecommendLink(id: number | string) {
  return request.delete(`${linkUrl}/${id}`);
}
