import request from "@/utils/request";

// 查询发文列表
export function listMessage(query) {
  return request({
    url: "/offcial/message/list",
    method: "get",
    params: query,
  });
}

// 查询发文详细
export function getMessage(outMessageId) {
  return request({
    url: "/offcial/message/" + outMessageId,
    method: "get",
  });
}
// 查询发文详细
export function getOutMessageByWorkId(workId) {
  return request({
    url: "/offcial/message/messageByWorkId/" + workId,
    method: "get",
  });
}

// 新增发文
export function addMessage(data) {
  return request({
    url: "/offcial/message",
    method: "post",
    data: data,
  });
}

// 修改发文
export function updateMessage(data) {
  return request({
    url: "/offcial/message",
    method: "put",
    data: data,
  });
}

// 删除发文
export function delMessage(outMessageId) {
  return request({
    url: "/offcial/message/" + outMessageId,
    method: "delete",
  });
}
// 新增发文
export function saveOutMessage(data) {
  return request({
    url: "/offcial/message/saveOutMessage",
    method: "post",
    data: data,
  });
}
// 发文删除文件
export function delFileList(fileId) {
  return request({
    url: "/offcial/message/delFiles/" + fileId,
    method: "post",
  });
}
