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

/**
 * @description: 列表
 */
export function getArticleList(params?) {
  return http.request({
    url: '/article/page',
    method: 'GET',
    params,
  });
}
/**
 * @description: 根据ID获取详情
 */
export function getArticleDetail(articleId) {
  return http.request({
    url: '/article/detail/'+articleId,
    method: 'get',
  });
}
/**
 * @description: 添加
 */
export function articleAdd(data:any) {
  return http.request({
    url: '/article/add',
    method: 'POST',
    data,
  });
}
/**
 * @description: 更新
 */
export function articleUpdate(data:any) {
  return http.request({
    url: '/article/update',
    method: 'PUT',
    data
  });
}
/**
 * @description: 删除
 */
export function articleDelete(articleId) {
  return http.request({
    url: '/article/delete/'+articleId,
    method: 'DELETE',
  });
}
/**
 * @description: 批量删除
 */
export function articleBatchDelete(data:any) {
  return http.request({
    url: '/article/batchDelete',
    method: 'DELETE',
    data
  });
}