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

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

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

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

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

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

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