mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
Пред-деплой
This commit is contained in:
@@ -25,10 +25,7 @@ export class ScheduleParseResult {
|
||||
export class ScheduleParser {
|
||||
private lastResult: ScheduleParseResult | null = null;
|
||||
|
||||
public constructor(
|
||||
private readonly xlsDownloader: XlsDownloaderBase,
|
||||
private readonly group: string,
|
||||
) {}
|
||||
public constructor(private readonly xlsDownloader: XlsDownloaderBase) {}
|
||||
|
||||
private static getCellName(
|
||||
worksheet: XLSX.Sheet,
|
||||
@@ -162,14 +159,14 @@ export class ScheduleParser {
|
||||
row < daySkeleton.row + rowDistance;
|
||||
++row
|
||||
) {
|
||||
const time = ScheduleParser.getCellName(
|
||||
const time: string | null = ScheduleParser.getCellName(
|
||||
workSheet,
|
||||
row,
|
||||
lessonTimeColumn,
|
||||
)?.replaceAll(" ", "");
|
||||
if (!time || typeof time !== "string") continue;
|
||||
|
||||
const rawName = ScheduleParser.getCellName(
|
||||
const rawName: string | null = ScheduleParser.getCellName(
|
||||
workSheet,
|
||||
row,
|
||||
groupSkeleton.column,
|
||||
@@ -216,6 +213,9 @@ export class ScheduleParser {
|
||||
day.lessons.push(
|
||||
new LessonDto(
|
||||
type,
|
||||
type === LessonTypeDto.DEFAULT
|
||||
? Number.parseInt(time[0])
|
||||
: -1,
|
||||
LessonTimeDto.fromString(
|
||||
type === LessonTypeDto.DEFAULT
|
||||
? time.substring(5)
|
||||
|
||||
@@ -3,7 +3,8 @@ import {
|
||||
Controller,
|
||||
Get,
|
||||
HttpCode,
|
||||
HttpStatus, Post,
|
||||
HttpStatus,
|
||||
Post,
|
||||
UseGuards,
|
||||
} from "@nestjs/common";
|
||||
import { AuthGuard } from "../auth/auth.guard";
|
||||
|
||||
@@ -22,7 +22,6 @@ export class ScheduleService {
|
||||
"https://politehnikum-eng.ru/index/raspisanie_zanjatij/0-409",
|
||||
XlsDownloaderCacheMode.SOFT,
|
||||
),
|
||||
"ИС-214/23",
|
||||
);
|
||||
|
||||
private lastCacheUpdate: Date = new Date(0);
|
||||
@@ -73,7 +72,7 @@ export class ScheduleService {
|
||||
|
||||
async getGroup(group: string): Promise<GroupScheduleDto> {
|
||||
const schedule = await this.getSourceSchedule();
|
||||
console.log(schedule);
|
||||
|
||||
if ((schedule.groups as object)[group] === undefined) {
|
||||
throw new NotFoundException(
|
||||
"Группы с таким названием не существует!",
|
||||
|
||||
Reference in New Issue
Block a user