import { ultraFetch } from "./init"
import type { Return, AppInfo } from "@/type/common"

export const getAppInfo = (channel: string): Promise<Return<AppInfo>> => {
  return ultraFetch.get({
    URL: "/rest/channel/version",
    headers: {
      channel,
    },
  })
}

export const changeStringToQrcode = (
  content: string
): Promise<Return<string>> => {
  return ultraFetch.post({
    URL: "/rest/util/qrcode",
    body: JSON.stringify({
      content,
    }),
  })
}
