import request from "@/utils/request";

// 查询文章列表
export function listArticle(query) {
  return request({
    url: "/oa/article/list",
    method: "get",
    params: query,
  });
}

// 查询文章详细
export function getArticle(id) {
  return request({
    url: "/oa/article/" + id,
    method: "get",
  });
}

// 普通删除
export function delArticle(id) {
  return request({
    url: "/oa/article/" + id,
    method: "DELETE",
  });
}

// 新增文章
export function addArticle(data) {
  return request({
    url: "/oa/article",
    method: "post",
    data: data,
  });
}

// 修改文章
export function updateArticle(data) {
  return request({
    url: "/oa/article",
    method: "put",
    data: data,
  });
}

// // 删除文章
// export function delArticle(id) {
//   return request({
//     url: "/oa/article/" + id,
//     method: "delete",
//   });
// }

// 所属部门
export function columnDepartment() {
  return request({
    url: "/system/dept/list/",
    method: "get",
  });
}
// 所属栏目
export function columnList(query) {
  return request({
    url: "/oa/column/list",
    method: "get",
    params: query,
  });
}
//删除标题图
export function fileDel(id) {
  return request({
    url: "/system/file/" + id,
    method: "Delete",
  });
}
//撤销发布
export function unpublish(data) {
  return request({
    url: "/oa/article",
    method: "put",
    data: data,
  });
}
//文章详情
export function detailArticle(id) {
  return request({
    url: "/oa/article/detail/" + id,
    method: "GET",
  });
}
//文章更多
export function moreArticle(query) {
  return request({
    url: "/oa/article/listByColumnId/more",
    method: "get",
    params: query,
  });
}
