import { http } from '@/utils/http/axios';

/**
 * @description: 列表
 */
export function getLayoutList(params?) {
  return http.request({
    url: '/layout/page',
    method: 'GET',
    params,
  });
}

/**
 * 获取全部推荐位列表
 * @param params 参数
 * @returns 返回结果
 */
export function getLayoutAllList(params?) {
  return http.request({
    url: '/layout/list',
    method: 'GET',
    params,
  });
}

/**
 * @description: 根据ID获取详情
 */
export function getLayoutDetail(layoutId) {
  return http.request({
    url: '/layout/detail/' + layoutId,
    method: 'get',
  });
}

/**
 * @description: 添加
 */
export function layoutAdd(data: any) {
  return http.request({
    url: '/layout/add',
    method: 'POST',
    data,
  });
}

/**
 * @description: 更新
 */
export function layoutUpdate(data: any) {
  return http.request({
    url: '/layout/update',
    method: 'PUT',
    data,
  });
}

/**
 * @description: 删除
 */
export function layoutDelete(layoutId) {
  return http.request({
    url: '/layout/delete/' + layoutId,
    method: 'DELETE',
  });
}

/**
 * @description: 批量删除
 */
export function layoutBatchDelete(data: any) {
  return http.request({
    url: '/layout/batchDelete',
    method: 'DELETE',
    data,
  });
}
