import { AxiosPromise, AxiosResponse } from "axios";
import request from "./request";
//用户授权码模式登录
function loginCode(data?: {
    authorizationCode: string

}) {
    return request({
        url: "login/code",
        method: "post",
        data: data

    })

}
//用户授权码模式登录--测试
function loginCodeTest() {
    return request({
        url: "login/code/test",
        method: "post",
    })

}
//查询模拟考试题库
function studentQustionInfoSelectTestQuestionInfo(params: {
    liceBus: string,
    liceCar: string,
    liceMoto: string,
    liceTruck: string,
    subject: number,
}): AxiosPromise<selectTestQuestionInfo.response> {
    return request({
        url: "student/qustion/info/selectTestQuestionInfo",
        method: "get",
        params

    })

}
//查询模拟考试题库(通用)
function openApiqustionInfoSelectTestQuestionInfo(params: {
    liceBus: string,
    liceCar: string,
    liceMoto: string,
    liceTruck: string,
    subject: number,
}): AxiosPromise<selectTestQuestionInfo.response> {
    return request({
        url: "open-api/qustion/info/selectTestQuestionInfo",
        method: "get",
        params

    })

}
//查询用户信息
function studentUserInfo(): AxiosPromise<studentUserInfo.response> {
    return request({
        url: "student/qustion/info/selectTestQuestionInfo",
        method: "get",
    })

}
//查询202204题库列表
async function questionTwoList(params: {
    pageNum: number,
    pageSize: number,
    cartype: "0" | "1" | "2" | "3",
    kemu: number,
    explainJs?: string
}): Promise<AxiosPromise<questionTwoList.response>> {
    let res: AxiosResponse<questionTwoList.response> = await request({
        url: "https://admin1.zzxcx.net/zzjs-admin/open-api/question/two/list",
        method: "get",
        params
    })
    //
    return res
}
export default {
    loginCode,
    loginCodeTest,
    studentQustionInfoSelectTestQuestionInfo,
    studentUserInfo,
    openApiqustionInfoSelectTestQuestionInfo,
    questionTwoList


}

function AxiosPromise<T>() {
    throw new Error("Function not implemented.");
}

