Release v1.0.0 #16
.envnuget.config
.gitea/workflows
.gitignoreApiDto
ApiDto.csproj
Backend.slnDockerfileCommon
Requests
Responses
Endpoint
Backend.httpISaveSettings.cs
README.mdCommon
Attributes
BadRequestResponseAttribute.csCacheMaxAgeAttribute.csLocalhostAttribute.csMaintenanceModeIgnoreAttribute.csNotFoundResponseAttribute.csSwaggerDefaultAttribute.csTokenAuthenticationAttribute.cs
Exceptions
Interfaces
MapperDto
Services
Configuration
Core
BackgroundTasks
Middleware
CacheMaxAgeMiddleware.csCookieAuthorizationMiddleware.csCustomExceptionHandlerMiddleware.csJwtRevocationMiddleware.csMaintenanceModeMiddleware.cs
Startup
Model
SwaggerOptions
Validation
Controllers
BaseController.cs
Endpoint.csprojProgram.csConfiguration
V1
AuthController.csCampusController.csDisciplineController.csFacultyController.csGroupController.csImportController.csLectureHallController.csProfessorController.csScheduleController.cs
WeatherForecastController.csSync
WeatherForecast.cswwwroot/css/swagger
Security
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
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
@ -0,0 +1,24 @@
|
|||||||
|
using Mirea.Api.Dto.Common;
|
||||||
|
using Mirea.Api.Security.Common.Domain;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Mirea.Api.Endpoint.Common.MapperDto;
|
||||||
|
|
||||||
|
public static class TwoFactorAuthenticationConverter
|
||||||
|
{
|
||||||
|
public static TwoFactorAuthentication ConvertToDto(this TwoFactorAuthenticator authenticator) =>
|
||||||
|
authenticator switch
|
||||||
|
{
|
||||||
|
TwoFactorAuthenticator.None => TwoFactorAuthentication.None,
|
||||||
|
TwoFactorAuthenticator.Totp => TwoFactorAuthentication.TotpRequired,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(authenticator), authenticator, null)
|
||||||
|
};
|
||||||
|
|
||||||
|
public static TwoFactorAuthenticator ConvertFromDto(this TwoFactorAuthentication authentication) =>
|
||||||
|
authentication switch
|
||||||
|
{
|
||||||
|
TwoFactorAuthentication.None => TwoFactorAuthenticator.None,
|
||||||
|
TwoFactorAuthentication.TotpRequired => TwoFactorAuthenticator.Totp,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(authentication), authentication, null)
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user