/**
 * 教师模块 API 存根文件
 * 原模块已剥离至 competition-management-system-stripped-modules/
 * 仅保留被赛事模块引用的类型和接口定义
 */
import request from "@/utils/request";
import type { PaginationParams, PaginationResponse } from "@/types/api";

export interface Teacher {
  id: number;
  userId: number;
  tenantId: number;
  departmentId: number;
  employeeNo?: string;
  phone?: string;
  gender?: number;
  subject?: string;
  title?: string;
  description?: string;
  validState: number;
  user?: {
    id: number;
    username: string;
    nickname: string;
    email?: string;
    avatar?: string;
    validState: number;
  };
  department?: {
    id: number;
    name: string;
    code: string;
  };
}

export async function getTeachersList(
  params: PaginationParams & { departmentId?: number; nickname?: string; username?: string }
): Promise<PaginationResponse<Teacher>> {
  return request.get<any, PaginationResponse<Teacher>>("/teachers", { params });
}

export async function getTeacherByUserId(userId: number): Promise<Teacher> {
  return request.get<any, Teacher>(`/teachers/user/${userId}`);
}

export const teachersApi = {
  getList: getTeachersList,
  getByUserId: getTeacherByUserId,
};
