import request from '/@/utils/request';

/**
 * 根据班级代码查询教室分配
 * @param classCode 班级代码
 */
export const getClassRoomByClassCode = (classCode: string | number) => {
  return request({
    url: '/stuwork/teachclassroomassign/getClassRoomByClassCode',
    method: 'get',
    params: { classCode },
  });
};

/**
 * 教室安排
 * 接口文档：POST /api/stuwork/teachclassroomassign/addClassRoomAssign
 * @param data buildingNo 楼号, position 位置, classCode 班级代码
 */
export const addClassRoomAssign = (data: { buildingNo?: string | number; position?: string; classCode?: string }) => {
  return request({
    url: '/stuwork/teachclassroomassign/addClassRoomAssign',
    method: 'post',
    data,
  });
};

/**
 * 取消教室安排
 * 接口文档：POST /api/stuwork/teachclassroomassign/delClassRoomAssign
 * @param data 教室基础数据（包含 id, classCode, position 等）
 */
export const delClassRoomAssign = (data: any) => {
  return request({
    url: '/stuwork/teachclassroomassign/delClassRoomAssign',
    method: 'post',
    data,
  });
};

