import request from "../request";

const platform = sessionStorage.getItem("platform") || "classroom";
const api = platform == "classroom" ? "/edu-app" : "/api-backend";
/**
 * 即时通讯 - 群组列表
 */
export const imGroupPage = (params?: object) => {
  return request.post(api + "/imGroup/page", {
    data: params,
  });
};

/**
 * 即时通讯 - 好友列表
 */
export const imUserFriendPage = (params?: object) => {
  return request.post(api + "/imUserFriend/page", {
    data: params,
  });
};

/**
 * 即时通讯 - 转让群组
 */
export const imGroupChangeGroupOwner = (params?: object) => {
  return request.post(api + "/imGroup/changeGroupOwner", {
    data: params,
  });
};

/**
 * 即时通讯 - 群公告列表
 */
export const imGroupNoticePage = (params?: object) => {
  return request.post(api + "/imGroupNotice/page", {
    data: params,
  });
};

/**
 * 即时通讯 - 新增公告
 */
export const imGroupNoticeSave = (params?: object) => {
  return request.post(api + "/imGroupNotice/save", {
    data: params,
  });
};

/**
 * 即时通讯 - 修改群公告
 */
export const imGroupNoticeUpdate = (params?: object) => {
  return request.post(api + "/imGroupNotice/update", {
    data: params,
  });
};
