更新API
This commit is contained in:
@@ -83,8 +83,14 @@ export interface PackagItemDetailResponse {
|
||||
}
|
||||
|
||||
// PDF响应
|
||||
export interface PdfItem {
|
||||
pdf_name?: string | null;
|
||||
pdf_url?: string | null;
|
||||
combination_code?: number | null;
|
||||
}
|
||||
|
||||
export interface PdfResponse {
|
||||
list_pdf_url: string[];
|
||||
list_pdf_url: Array<string | PdfItem>;
|
||||
message: string | null;
|
||||
}
|
||||
|
||||
@@ -105,6 +111,11 @@ export interface ParsedPdfResponse {
|
||||
message: string;
|
||||
}
|
||||
|
||||
// 签到确认响应
|
||||
export interface SignInResponse {
|
||||
is_success: number; // 0-成功 1-失败
|
||||
}
|
||||
|
||||
// 创建axios实例
|
||||
function createAxiosInstance(baseURL: string): AxiosInstance {
|
||||
const instance = axios.create({
|
||||
@@ -244,10 +255,12 @@ export async function getTongyishuPdfFile(
|
||||
*/
|
||||
export async function submitTongyishuSign(
|
||||
exam_id: number,
|
||||
combination_code: number,
|
||||
sign_file: File | Blob
|
||||
): Promise<ApiResponse<PdfResponse>> {
|
||||
const formData = new FormData();
|
||||
formData.append("exam_id", exam_id.toString());
|
||||
formData.append("combination_code", combination_code.toString());
|
||||
formData.append("sign_file", sign_file);
|
||||
|
||||
const response = await axiosInstance.post<ApiResponse<PdfResponse>>(
|
||||
@@ -322,5 +335,24 @@ export function parsePdfUrlResponse(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 9. 体检客户签到确认
|
||||
* @param physical_exam_id 体检ID
|
||||
* @param package_code 套餐代码
|
||||
*/
|
||||
export async function signIn(
|
||||
physical_exam_id: number,
|
||||
package_code: number
|
||||
): Promise<ApiResponse<SignInResponse>> {
|
||||
const response = await axiosInstance.post<ApiResponse<SignInResponse>>(
|
||||
"sign-in",
|
||||
{
|
||||
physical_exam_id,
|
||||
package_code,
|
||||
}
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
// 导出axios实例,以便需要时进行自定义配置
|
||||
export { axiosInstance };
|
||||
|
||||
Reference in New Issue
Block a user