export const bookMeeting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/book_meeting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const joinMeeting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/join_meeting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const leaveMeeting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/leave_meeting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const updateMeeting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/update_meeting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const createImmediateMeeting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/create_immediate_meeting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const getMeeting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/get_meeting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const getMeetings = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/get_meetings",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const endMeeting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/end_meeting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const setPersonalSetting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/set_personal_setting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const getPersonalSetting = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/get_personal_setting",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );

export const getMeetingToken = (params) =>
  uni.$u?.http.post(
    "/rtc-meeting/get_meeting_token",
    JSON.stringify({
      ...params,
    }),
    {
      custom: {
        isIMApi: true,
      },
      header: {
        token: uni.getStorageSync("IMToken"),
      },
    }
  );
