var _excluded = ["accessToken"],
  _excluded2 = ["accessToken"],
  _excluded3 = ["accessToken"],
  _excluded4 = ["accessToken"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import { get, post, del, put } from "../_util/axios";
import { EHR_SERVICE } from "../_util/constants";
var commentGetWay = "".concat(EHR_SERVICE, "/api/comment"); // 评论系统网关

export var postComment = function postComment(_ref) {
  var accessToken = _ref.accessToken,
    data = _objectWithoutProperties(_ref, _excluded);
  return post({
    url: "".concat(commentGetWay, "/ct/comments"),
    data: data,
    headers: {
      accessToken: accessToken
    }
  });
}; // 创建评论

export var delComment = function delComment(_ref2) {
  var accessToken = _ref2.accessToken,
    id = _ref2.id;
  return del({
    url: "".concat(commentGetWay, "/ct/comments/").concat(id),
    headers: {
      accessToken: accessToken
    }
  });
}; // 删除评论

export var getCommentList = function getCommentList(_ref3) {
  var accessToken = _ref3.accessToken,
    data = _objectWithoutProperties(_ref3, _excluded2);
  return get({
    url: "".concat(commentGetWay, "/ct/comments"),
    data: data,
    headers: {
      accessToken: accessToken
    }
  });
}; // 查询评论列表

export var postCommentReply = function postCommentReply(_ref4) {
  var accessToken = _ref4.accessToken,
    data = _objectWithoutProperties(_ref4, _excluded3);
  return post({
    url: "".concat(commentGetWay, "/ct/comments/reply"),
    data: data,
    headers: {
      accessToken: accessToken
    }
  });
}; // 创建评论的回复

export var delCommentReply = function delCommentReply(_ref5) {
  var accessToken = _ref5.accessToken,
    id = _ref5.id;
  return del({
    url: "".concat(commentGetWay, "/ct/comments/reply/").concat(id),
    headers: {
      accessToken: accessToken
    }
  });
}; // 删除评论的回复

export var getCommentReplyList = function getCommentReplyList(_ref6) {
  var accessToken = _ref6.accessToken,
    data = _objectWithoutProperties(_ref6, _excluded4);
  return get({
    url: "".concat(commentGetWay, "/ct/comments/reply"),
    data: data,
    headers: {
      accessToken: accessToken
    }
  });
}; // 查询评论的回复列表

export var putCommentSelection = function putCommentSelection(_ref7) {
  var accessToken = _ref7.accessToken,
    id = _ref7.id,
    flag = _ref7.flag;
  return put({
    url: "".concat(commentGetWay, "/ct/comments/").concat(id, "/chosen/").concat(flag),
    headers: {
      accessToken: accessToken
    }
  });
}; // 精选评论

export var putCommentLike = function putCommentLike(_ref8) {
  var accessToken = _ref8.accessToken,
    id = _ref8.id,
    flag = _ref8.flag;
  return put({
    url: "".concat(commentGetWay, "/ct/comments/").concat(id, "/like/").concat(flag),
    headers: {
      accessToken: accessToken
    }
  });
}; // 评论点赞

export var putCommentReplyLike = function putCommentReplyLike(_ref9) {
  var accessToken = _ref9.accessToken,
    id = _ref9.id,
    flag = _ref9.flag;
  return put({
    url: "".concat(commentGetWay, "/ct/comments/reply/").concat(id, "/like/").concat(flag),
    headers: {
      accessToken: accessToken
    }
  });
}; // 回复点赞