Release v1.0.0 #16
.editorconfig.envnuget.config
.gitea/workflows
.gitignoreApiDto
ApiDto.csproj
Backend.slnDockerfileCommon
AuthRoles.csCacheType.csCronUpdateSkip.csDatabaseType.csOAuthAction.csOAuthProvider.csPairPeriodTime.csPasswordPolicy.csTwoFactorAuthentication.cs
Requests
Responses
AvailableOAuthProvidersResponse.csCampusBasicInfoResponse.csCampusDetailsResponse.cs
Configuration
DisciplineResponse.csFacultyResponse.csGroupDetailsResponse.csGroupResponse.csLectureHallDetailsResponse.csLectureHallResponse.csLessonTypeResponse.csProfessorResponse.csScheduleResponse.csTotpKeyResponse.csUserResponse.csEndpoint
Backend.httpISaveSettings.cs
README.mdCommon
Attributes
BadRequestResponseAttribute.csCacheMaxAgeAttribute.csLocalhostAttribute.csMaintenanceModeIgnoreAttribute.csNotFoundResponseAttribute.csSwaggerDefaultAttribute.csTokenAuthenticationAttribute.cs
Exceptions
Interfaces
MapperDto
AvailableProvidersConverter.csCronUpdateSkipConverter.csPairPeriodTimeConverter.csPasswordPolicyConverter.csTwoFactorAuthenticationConverter.csUserConverter.cs
Services
Configuration
Core
BackgroundTasks
Middleware
CacheMaxAgeMiddleware.csCookieAuthorizationMiddleware.csCustomExceptionHandlerMiddleware.csJwtRevocationMiddleware.csMaintenanceModeMiddleware.cs
Startup
Model
SwaggerOptions
ActionResultSchemaFilter.csConfigureSwaggerOptions.csDefaultValues.csEnumSchemaFilter.csExampleFilter.csTagSchemeFilter.cs
Validation
Controllers
BaseController.csConfigurationBaseController.cs
Endpoint.csprojProgram.csSetupConfiguration
V1
AuthController.csCampusController.cs
WeatherForecastController.csConfiguration
DisciplineController.csFacultyController.csGroupController.csImportController.csLectureHallController.csLessonTypeController.csProfessorController.csScheduleController.csSecurityController.csSync
WeatherForecast.cswwwroot/css/swagger
Security
Common
CookieNames.cs
DependencyInjection.csDomain
Interfaces
Model
OAuth2
ViewModel
Properties
Security.csprojServices
SqlData
Application
Application.csprojDependencyInjection.cs
Common
Cqrs
Campus/Queries
GetCampusBasicInfoList
CampusBasicInfoDto.csCampusBasicInfoVm.csGetCampusBasicInfoListQuery.csGetCampusBasicInfoListQueryHandler.cs
GetCampusDetails
Discipline/Queries
GetDisciplineDetails
GetDisciplineList
Faculty/Queries/GetFacultyList
Group/Queries
GetGroupDetails
GetGroupList
LectureHall/Queries
GetLectureHallDetails
GetLectureHallList
Professor/Queries
GetProfessorDetails
GetProfessorDetailsBySearch
GetProfessorList
Schedule/Queries/GetScheduleList
TypeOfOccupation/Queries/GetTypeOfOccupationList
Interfaces/DbContexts
Domain
Domain.csproj
Schedule
Migrations
MysqlMigrations
Migrations
20240601023106_InitialMigration.Designer.cs20240601023106_InitialMigration.cs20241027034820_RemoveUnusedRef.Designer.cs20241027034820_RemoveUnusedRef.csUberDbContextModelSnapshot.cs
MysqlMigrations.csprojPsqlMigrations
Migrations
20240601021702_InitialMigration.Designer.cs20240601021702_InitialMigration.cs20241027032753_RemoveUnusedRef.Designer.cs20241027032753_RemoveUnusedRef.csUberDbContextModelSnapshot.cs
PsqlMigrations.csprojSqliteMigrations
Persistence
Common
BaseDbContext.csConfigurationResolver.csDatabaseProvider.csDbContextFactory.csModelBuilderExtensions.cs
Contexts/Schedule
CampusDbContext.csDisciplineDbContext.csFacultyDbContext.csGroupDbContext.csLectureHallDbContext.csLessonAssociationDbContext.csLessonDbContext.csProfessorDbContext.csSpecificWeekDbContext.csTypeOfOccupationDbContext.cs
DbInitializer.csDependencyInjection.csEntityTypeConfigurations
Mark.cs
Persistence.csprojUberDbContext.csMysql/Schedule
CampusConfiguration.csDisciplineConfiguration.csFacultyConfiguration.csGroupConfiguration.csLectureHallConfiguration.csLessonAssociationConfiguration.csLessonConfiguration.csProfessorConfiguration.csSpecificWeekConfiguration.csTypeOfOccupationConfiguration.cs
Postgresql/Schedule
CampusConfiguration.csDisciplineConfiguration.csFacultyConfiguration.csGroupConfiguration.csLectureHallConfiguration.csLessonAssociationConfiguration.csLessonConfiguration.csProfessorConfiguration.csSpecificWeekConfiguration.csTypeOfOccupationConfiguration.cs
Sqlite/Schedule
@ -18,7 +18,7 @@ public static class CronUpdateSkipService
|
|||||||
throw new ArgumentException("It is impossible to create a structure because it has incorrect values.");
|
throw new ArgumentException("It is impossible to create a structure because it has incorrect values.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ScheduleSettings.CronUpdateSkip> Filter(this List<ScheduleSettings.CronUpdateSkip> data, DateOnly? currentDate = null)
|
public static List<ScheduleSettings.CronUpdateSkip> FilterDateEntry(this List<ScheduleSettings.CronUpdateSkip> data, DateOnly? currentDate = null)
|
||||||
{
|
{
|
||||||
currentDate ??= DateOnly.FromDateTime(DateTime.Now);
|
currentDate ??= DateOnly.FromDateTime(DateTime.Now);
|
||||||
return data.OrderBy(x => x.End ?? x.Date)
|
return data.OrderBy(x => x.End ?? x.Date)
|
||||||
@ -26,8 +26,18 @@ public static class CronUpdateSkipService
|
|||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ScheduleSettings.CronUpdateSkip> Filter(this List<ScheduleSettings.CronUpdateSkip> data, DateTime? currentDate = null) =>
|
public static List<ScheduleSettings.CronUpdateSkip> FilterDateEntry(this List<ScheduleSettings.CronUpdateSkip> data, DateTime? currentDate = null) =>
|
||||||
data.Filter(DateOnly.FromDateTime(currentDate ?? DateTime.Now));
|
data.FilterDateEntry(DateOnly.FromDateTime(currentDate ?? DateTime.Now));
|
||||||
|
|
||||||
|
public static List<ScheduleSettings.CronUpdateSkip> Filter(this List<ScheduleSettings.CronUpdateSkip> data, DateOnly? currentDate = null)
|
||||||
|
{
|
||||||
|
currentDate ??= DateOnly.FromDateTime(DateTime.Now);
|
||||||
|
|
||||||
|
return data.Where(x => x.Date >= currentDate || x.End >= currentDate)
|
||||||
|
.OrderBy(x => x.End ?? x.Date)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<DateTimeOffset> GetNextTask(this List<ScheduleSettings.CronUpdateSkip> data,
|
public static List<DateTimeOffset> GetNextTask(this List<ScheduleSettings.CronUpdateSkip> data,
|
||||||
CronExpression expression, int depth = 1, DateOnly? currentDate = null)
|
CronExpression expression, int depth = 1, DateOnly? currentDate = null)
|
||||||
@ -42,7 +52,7 @@ public static class CronUpdateSkipService
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
var lastSkip = data.Filter(nextRunTime.DateTime).LastOrDefault();
|
var lastSkip = data.FilterDateEntry(nextRunTime.DateTime).LastOrDefault();
|
||||||
|
|
||||||
if (lastSkip is { Start: not null, End: not null })
|
if (lastSkip is { Start: not null, End: not null })
|
||||||
nextRunTime = new DateTimeOffset(lastSkip.End.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
nextRunTime = new DateTimeOffset(lastSkip.End.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
||||||
@ -56,7 +66,7 @@ public static class CronUpdateSkipService
|
|||||||
|
|
||||||
nextRunTime = next.Value;
|
nextRunTime = next.Value;
|
||||||
|
|
||||||
if (data.Filter(nextRunTime.DateTime).Any())
|
if (data.FilterDateEntry(nextRunTime.DateTime).Any())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
result.Add(nextRunTime);
|
result.Add(nextRunTime);
|
||||||
|
@ -103,7 +103,9 @@ public class ScheduleController(ILogger<ScheduleController> logger, IOptionsSnap
|
|||||||
/// <returns>Cron update skip dates.</returns>
|
/// <returns>Cron update skip dates.</returns>
|
||||||
[HttpGet("CronUpdateSkip")]
|
[HttpGet("CronUpdateSkip")]
|
||||||
public ActionResult<List<CronUpdateSkip>> CronUpdateSkip() =>
|
public ActionResult<List<CronUpdateSkip>> CronUpdateSkip() =>
|
||||||
config.Value.ScheduleSettings!.CronUpdateSkipDateList.Filter(DateTime.Now).ConvertToDto();
|
config.Value.ScheduleSettings!.CronUpdateSkipDateList
|
||||||
|
.Filter()
|
||||||
|
.ConvertToDto();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the list of cron update skip dates in the configuration.
|
/// Updates the list of cron update skip dates in the configuration.
|
||||||
@ -124,7 +126,7 @@ public class ScheduleController(ILogger<ScheduleController> logger, IOptionsSnap
|
|||||||
throw new ControllerArgumentException(ex.Message);
|
throw new ControllerArgumentException(ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.Value.ScheduleSettings!.CronUpdateSkipDateList = result.Filter(DateTime.Now);
|
config.Value.ScheduleSettings!.CronUpdateSkipDateList = result.Filter();
|
||||||
config.Value.SaveSetting();
|
config.Value.SaveSetting();
|
||||||
|
|
||||||
return Ok();
|
return Ok();
|
||||||
|
Reference in New Issue
Block a user