import { CardModeEnum } from '@/enum/constant'
import { request } from '@/service/index'



/**
 * 此函数将 card id 作为字符串并返回card detail
 * @param {string} id - 题卡id
 * @returns 题卡详情
 */
export const getCardDetailById = (id: string, mode: CardModeEnum) => {
  return request<API.Card>({
    url: mode === CardModeEnum.OPRA ? `/app-game/quiz/card/${id}` : `/app-game/quiz/card/preview/${id}`,
    method: 'POST',
  })
}


/**
 * 提交学习计划
 * @param params 
 * @returns 
 */
export const submitlearnPortAns = (params: any, url: string) => {
  return request<API.Card>({
    url: '',
    baseURL: url,
    method: 'POST',
    params,
  })
}


