mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
1.1.0
This commit is contained in:
@@ -82,6 +82,7 @@ export class ScheduleController {
|
||||
}
|
||||
|
||||
@ApiExtraModels(SiteMainPageDto)
|
||||
@ApiExtraModels(CacheStatusDto)
|
||||
@ApiOperation({
|
||||
summary: "Обновление данных основной страницы политехникума",
|
||||
tags: ["schedule"],
|
||||
@@ -90,12 +91,12 @@ export class ScheduleController {
|
||||
@ApiNotAcceptableResponse({
|
||||
description: "Передан некорректный код страницы",
|
||||
})
|
||||
@ResultDto(null)
|
||||
@ResultDto(CacheStatusDto)
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Post("update-site-main-page")
|
||||
async updateSiteMainPage(
|
||||
@Body() siteMainPageDto: SiteMainPageDto,
|
||||
): Promise<void> {
|
||||
): Promise<CacheStatusDto> {
|
||||
return await this.scheduleService.updateSiteMainPage(siteMainPageDto);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,12 +127,16 @@ export class ScheduleService {
|
||||
return groupNames;
|
||||
}
|
||||
|
||||
async updateSiteMainPage(siteMainPageDto: SiteMainPageDto): Promise<void> {
|
||||
async updateSiteMainPage(
|
||||
siteMainPageDto: SiteMainPageDto,
|
||||
): Promise<CacheStatusDto> {
|
||||
await this.scheduleParser
|
||||
.getXlsDownloader()
|
||||
.setPreparedData(siteMainPageDto.mainPage);
|
||||
|
||||
await this.cacheManager.reset();
|
||||
await this.getSourceSchedule();
|
||||
|
||||
return this.getCacheStatus();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user