import flyio from "../flyio";
import { ApiCaptchaResponse, ApiResponse, DictItem, ConfigItem, ApiResponseList } from "@/types";
import { ClassItem, ClassListQueryDTO, SchoolItem, SchoolListQueryDTO, SmsRequestDTO, CardInfo } from "@/types/user";

/**
 * 验证会员卡
 * @param cardNo 
 * @param password 
 * @returns 
 */
export function verifyCard(cardNo: string, password: string) {
  return flyio.post('/front/user/verifyCard', { cardNo, password }, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  }) as Promise<ApiResponse<CardInfo>>;
}

/**
 * 获取学校列表
 * @param keyword 
 * @returns 
 */
export function getSchoolList(params: SchoolListQueryDTO) {
  return flyio.get('/front/user/getSchoolList', params) as Promise<ApiResponseList<SchoolItem>>;
}

/**
 * 获取班级列表
 * @param params 
 * @returns 
 */
export function getClassList(params: ClassListQueryDTO) {
  return flyio.get('/front/user/getClassList', params) as Promise<ApiResponse<ClassItem[]>>;
}