/**
 * 文献客户端
 */
import httpClient from "@/services/httpClient";
import * as urlHelper from "@/libs/url.lib"
import type { Response } from "@/types/response.types"
import type { PaperDetail } from "@/types/doc.types";

const _url = urlHelper.withPrefix("/gw/user/detail")

export async function get(paperId: number): Promise<PaperDetail> {
  const resp = await httpClient.get<Response<PaperDetail>>(_url(paperId))
  return resp.data.data
}

export function pdfUrl(pdfPath: string, token: string) {
  return `${_url("/pdf")}?path=${pdfPath}&token=${token}`;
}

