feat: перелопатил синхронизацию преподавателей
Backend CI / build-and-test (push) Failing after 13m11s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Failing after 10m12s
Frontend CI / build-and-check (push) Failing after 16m9s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 14m6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 14m58s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Failing after 14m58s
Backend CI / build-and-test (push) Failing after 13m11s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Failing after 10m12s
Frontend CI / build-and-check (push) Failing after 16m9s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 14m6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 14m58s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Failing after 14m58s
This commit is contained in:
@@ -5,7 +5,7 @@ namespace UniVerse.Application.DTOs.Auth;
|
||||
public record AuthResponse(string AccessToken, DateTime ExpiresAt, UserAuthDto User);
|
||||
public record AuthResult(AuthResponse Response, string RefreshToken);
|
||||
|
||||
public record UserAuthDto(string Email, string? DisplayName, IReadOnlyList<UserRole> Roles);
|
||||
public record UserAuthDto(int Id, string Email, string? DisplayName, IReadOnlyList<UserRole> Roles);
|
||||
|
||||
public record LoginMicrosoftRequest(string AuthorizationCode, string? RedirectUri = null);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public record UserDto(
|
||||
);
|
||||
|
||||
public record CurrentUserDto(
|
||||
int Id,
|
||||
string Email,
|
||||
string? DisplayName,
|
||||
string? AvatarUrl,
|
||||
|
||||
@@ -8,10 +8,10 @@ public interface ILectureService
|
||||
Task<PagedResult<LectureDto>> GetAllAsync(LectureFilterRequest filter, int? currentUserId = null);
|
||||
Task<LectureDetailDto> GetByIdAsync(int id, int? currentUserId = null);
|
||||
Task<LectureDto> CreateAsync(CreateLectureRequest request);
|
||||
Task<LectureDto> UpdateAsync(int id, UpdateLectureRequest request);
|
||||
Task<LectureDto> UpdateAsync(int id, UpdateLectureRequest request, int currentUserId, bool isAdmin = false);
|
||||
Task DeleteAsync(int id);
|
||||
Task EnrollAsync(int lectureId, int userId);
|
||||
Task UnenrollAsync(int lectureId, int userId);
|
||||
Task MarkAttendanceAsync(int lectureId, int userId, bool attended);
|
||||
Task<PagedResult<EnrollmentDto>> GetEnrollmentsAsync(int lectureId, PaginationRequest pagination);
|
||||
Task MarkAttendanceAsync(int lectureId, int userId, bool attended, int currentUserId, bool isAdmin = false);
|
||||
Task<PagedResult<EnrollmentDto>> GetEnrollmentsAsync(int lectureId, PaginationRequest pagination, int currentUserId, bool isAdmin = false);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace UniVerse.Application.Interfaces;
|
||||
|
||||
public interface IMicrosoftAuthClient
|
||||
{
|
||||
Task<MicrosoftTokenResult> ExchangeAuthorizationCodeAsync(
|
||||
string authorizationCode,
|
||||
string redirectUri,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public record MicrosoftTokenResult(string IdToken);
|
||||
@@ -9,7 +9,7 @@ public interface IReviewService
|
||||
Task<ReviewDto> GetByIdAsync(int id);
|
||||
Task<ReviewDto> UpdateAsync(int id, int userId, UpdateReviewRequest request);
|
||||
Task DeleteAsync(int id, int userId, bool isAdmin = false);
|
||||
Task<PagedResult<ReviewDto>> GetByLectureAsync(int lectureId, PaginationRequest pagination);
|
||||
Task<PagedResult<ReviewDto>> GetByLectureAsync(int lectureId, PaginationRequest pagination, int? currentUserId = null, bool isAdmin = false);
|
||||
Task<PagedResult<ReviewDto>> GetByUserAsync(int userId, PaginationRequest pagination);
|
||||
Task<PagedResult<ReviewDto>> GetAllAsync(ReviewFilterRequest filter);
|
||||
Task ReanalyzeAsync(int id);
|
||||
|
||||
@@ -16,6 +16,7 @@ public interface IModeusApiClient
|
||||
Task<ModeusEventsResponse> SearchEventsAsync(SyncScheduleRequest request);
|
||||
Task<ModeusRoomsResponse> SearchRoomsAsync();
|
||||
Task<List<ModeusEmployee>> SearchEmployeeAsync(string fullname);
|
||||
Task<string?> GetSubIdByFullNameAsync(string fullname, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
// Modeus API response models
|
||||
|
||||
@@ -20,12 +20,12 @@ public static class MappingExtensions
|
||||
);
|
||||
|
||||
public static CurrentUserDto ToCurrentUserDto(this User user, int level) => new(
|
||||
user.Email, user.DisplayName, user.AvatarUrl,
|
||||
user.Id, user.Email, user.DisplayName, user.AvatarUrl,
|
||||
user.Roles.Select(r => r.Role).OrderBy(r => r).ToList(), user.Xp, user.Coins, level, user.CreatedAt
|
||||
);
|
||||
|
||||
public static UserAuthDto ToAuthDto(this User user) => new(
|
||||
user.Email, user.DisplayName, user.Roles.Select(r => r.Role).OrderBy(r => r).ToList()
|
||||
user.Id, user.Email, user.DisplayName, user.Roles.Select(r => r.Role).OrderBy(r => r).ToList()
|
||||
);
|
||||
|
||||
// --- Tag ---
|
||||
|
||||
Reference in New Issue
Block a user