"use strict";
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
var utils_request = require("../utils/request.js");
var config_index = require("../config/index.js");
const login = (data) => utils_request.request({ url: "/api/users/wx/login", method: "POST", data });
const getAllRoles = () => utils_request.request({ url: "/api/roles/all", method: "GET" });
const getChatExist = (data) => utils_request.request({ url: "/api/chat_records/exists", method: "GET", data });
const createChat = (data) => utils_request.request({ baseUrl: config_index.base_url_other, url: "/chats", method: "POST", data });
const getAllRolesMessageRecord = (data) => utils_request.request({ url: "/api/chat_records/all", method: "GET", data });
const saveMessage = (data) => utils_request.request({ url: "/api/chat_records/", method: "POST", loading: false, data });
const getHistoryMessage = (data) => utils_request.request({ url: "/api/chat_records/", method: "GET", data });
const getListOfCommunity = (data) => utils_request.request({ url: "/api/post/", method: "GET", loading: false, data });
const uploadImage = (file) => utils_request.requestFormData({ url: "/api/files/", method: "POST", file });
const releaseContent = (data) => utils_request.request({ url: "/api/post/", method: "POST", data });
const saveDraft = (data) => utils_request.request({ url: "/api/drafts/", method: "POST", data });
const getDraftData = (data) => utils_request.request({ url: "/api/drafts/", method: "GET", data });
const getCommunityDetail = (id) => utils_request.request({ url: `/api/post/${id}`, method: "GET" });
const getCommentData = (id) => utils_request.request({ url: `/api/post/${id}/comments/`, method: "GET", loading: false });
const submitLike = (id) => utils_request.request({ url: `/api/post/${id}/like`, method: "POST", loading: false });
const cancelLike = (id) => utils_request.request({ url: `/api/post/${id}/like`, method: "DELETE", loading: false });
const submitComment = (_a) => {
  var _b = _a, { id } = _b, data = __objRest(_b, ["id"]);
  return utils_request.request({ url: `/api/post/${id}/comments/`, method: "POST", loading: false, data });
};
const deleteComment = ({ id, commentId }) => utils_request.request({ url: `/api/post/${id}/comments/${commentId}`, method: "DELETE", loading: false });
const saveAvatar = (data) => utils_request.request({ url: "/api/users/avatar_id", method: "PUT", data });
const saveUserName = (data) => utils_request.request({ url: "/api/users/username", method: "PUT", data });
exports.cancelLike = cancelLike;
exports.createChat = createChat;
exports.deleteComment = deleteComment;
exports.getAllRoles = getAllRoles;
exports.getAllRolesMessageRecord = getAllRolesMessageRecord;
exports.getChatExist = getChatExist;
exports.getCommentData = getCommentData;
exports.getCommunityDetail = getCommunityDetail;
exports.getDraftData = getDraftData;
exports.getHistoryMessage = getHistoryMessage;
exports.getListOfCommunity = getListOfCommunity;
exports.login = login;
exports.releaseContent = releaseContent;
exports.saveAvatar = saveAvatar;
exports.saveDraft = saveDraft;
exports.saveMessage = saveMessage;
exports.saveUserName = saveUserName;
exports.submitComment = submitComment;
exports.submitLike = submitLike;
exports.uploadImage = uploadImage;
