Добавил слой Application
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
namespace UniVerse.Application.DTOs.Achievements;
|
||||
|
||||
public record AchievementDto(
|
||||
int Id,
|
||||
string Name,
|
||||
string? Description,
|
||||
string? IconUrl,
|
||||
int XpReward,
|
||||
int CoinReward,
|
||||
string? Condition,
|
||||
DateTime CreatedAt
|
||||
);
|
||||
|
||||
public record UserAchievementDto(
|
||||
int Id,
|
||||
AchievementDto Achievement,
|
||||
DateTime AwardedAt
|
||||
);
|
||||
|
||||
public record CreateAchievementRequest(
|
||||
string Name,
|
||||
string? Description,
|
||||
string? IconUrl,
|
||||
int XpReward,
|
||||
int CoinReward,
|
||||
string? Condition
|
||||
);
|
||||
|
||||
public record UpdateAchievementRequest(
|
||||
string Name,
|
||||
string? Description,
|
||||
string? IconUrl,
|
||||
int XpReward,
|
||||
int CoinReward,
|
||||
string? Condition
|
||||
);
|
||||
@@ -0,0 +1,11 @@
|
||||
using UniVerse.Domain.Enums;
|
||||
|
||||
namespace UniVerse.Application.DTOs.Auth;
|
||||
|
||||
public record AuthResponse(string AccessToken, DateTime ExpiresAt, UserAuthDto User);
|
||||
|
||||
public record UserAuthDto(int Id, string Email, string? DisplayName, UserRole Role);
|
||||
|
||||
public record LoginMicrosoftRequest(string AuthorizationCode);
|
||||
|
||||
public record DevLoginRequest(string Email, string? DisplayName = null, UserRole Role = UserRole.Student);
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace UniVerse.Application.DTOs.Common;
|
||||
|
||||
public record PaginationRequest(int Page = 1, int PageSize = 20);
|
||||
|
||||
public record PagedResult<T>(
|
||||
List<T> Items,
|
||||
int TotalCount,
|
||||
int Page,
|
||||
int PageSize,
|
||||
int TotalPages
|
||||
)
|
||||
{
|
||||
public static PagedResult<T> Create(List<T> items, int totalCount, int page, int pageSize)
|
||||
{
|
||||
var totalPages = (int)Math.Ceiling(totalCount / (double)pageSize);
|
||||
return new PagedResult<T>(items, totalCount, page, pageSize, totalPages);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using UniVerse.Application.DTOs.Tags;
|
||||
|
||||
namespace UniVerse.Application.DTOs.Courses;
|
||||
|
||||
public record CourseDto(
|
||||
int Id,
|
||||
string Name,
|
||||
string? Description,
|
||||
bool IsSynced,
|
||||
List<TagDto> Tags,
|
||||
DateTime CreatedAt
|
||||
);
|
||||
|
||||
public record CreateCourseRequest(string Name, string? Description);
|
||||
|
||||
public record UpdateCourseRequest(string Name, string? Description);
|
||||
|
||||
public record CourseFilterRequest(
|
||||
int? TagId,
|
||||
string? Search,
|
||||
bool? IsSynced,
|
||||
int Page = 1,
|
||||
int PageSize = 20
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
using UniVerse.Domain.Enums;
|
||||
|
||||
namespace UniVerse.Application.DTOs.Gamification;
|
||||
|
||||
public record CoinTransactionDto(
|
||||
int Id,
|
||||
int Amount,
|
||||
CoinTransactionType Type,
|
||||
int? ReviewId,
|
||||
int? AchievementId,
|
||||
string? Description,
|
||||
DateTime CreatedAt
|
||||
);
|
||||
@@ -0,0 +1,86 @@
|
||||
using UniVerse.Domain.Enums;
|
||||
|
||||
namespace UniVerse.Application.DTOs.Lectures;
|
||||
|
||||
public record LectureDto(
|
||||
int Id,
|
||||
int CourseId,
|
||||
string CourseName,
|
||||
int? TeacherId,
|
||||
string? TeacherName,
|
||||
int? LocationId,
|
||||
string? LocationName,
|
||||
string Title,
|
||||
string? Description,
|
||||
LectureFormat Format,
|
||||
DateTime StartsAt,
|
||||
DateTime EndsAt,
|
||||
bool IsOpen,
|
||||
int MaxEnrollments,
|
||||
int EnrollmentsCount,
|
||||
string? OnlineUrl,
|
||||
DateTime CreatedAt
|
||||
);
|
||||
|
||||
public record LectureDetailDto(
|
||||
int Id,
|
||||
int CourseId,
|
||||
string CourseName,
|
||||
int? TeacherId,
|
||||
string? TeacherName,
|
||||
int? LocationId,
|
||||
string? LocationName,
|
||||
string Title,
|
||||
string? Description,
|
||||
LectureFormat Format,
|
||||
DateTime StartsAt,
|
||||
DateTime EndsAt,
|
||||
bool IsOpen,
|
||||
int MaxEnrollments,
|
||||
int EnrollmentsCount,
|
||||
string? OnlineUrl,
|
||||
DateTime CreatedAt,
|
||||
bool IsEnrolled
|
||||
);
|
||||
|
||||
public record CreateLectureRequest(
|
||||
int CourseId,
|
||||
int? TeacherId,
|
||||
int? LocationId,
|
||||
string Title,
|
||||
string? Description,
|
||||
LectureFormat Format,
|
||||
DateTime StartsAt,
|
||||
DateTime EndsAt,
|
||||
bool IsOpen,
|
||||
int MaxEnrollments,
|
||||
string? OnlineUrl
|
||||
);
|
||||
|
||||
public record UpdateLectureRequest(
|
||||
int? TeacherId,
|
||||
int? LocationId,
|
||||
string Title,
|
||||
string? Description,
|
||||
LectureFormat Format,
|
||||
DateTime StartsAt,
|
||||
DateTime EndsAt,
|
||||
bool IsOpen,
|
||||
int MaxEnrollments,
|
||||
string? OnlineUrl
|
||||
);
|
||||
|
||||
public record LectureFilterRequest(
|
||||
DateOnly? DateFrom,
|
||||
DateOnly? DateTo,
|
||||
int? CourseId,
|
||||
int? TeacherId,
|
||||
LectureFormat? Format,
|
||||
bool? IsOpen,
|
||||
int? TagId,
|
||||
string? Search,
|
||||
int Page = 1,
|
||||
int PageSize = 20
|
||||
);
|
||||
|
||||
public record EnrollmentDto(int Id, int UserId, string? UserName, string? UserEmail, bool Attended, DateTime CreatedAt);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace UniVerse.Application.DTOs.Locations;
|
||||
|
||||
public record LocationDto(int Id, string Name, string? Building, string? Room, string? Address, DateTime CreatedAt);
|
||||
|
||||
public record CreateLocationRequest(string Name, string? Building, string? Room, string? Address);
|
||||
|
||||
public record UpdateLocationRequest(string Name, string? Building, string? Room, string? Address);
|
||||
@@ -0,0 +1,23 @@
|
||||
using UniVerse.Domain.Enums;
|
||||
|
||||
namespace UniVerse.Application.DTOs.Reviews;
|
||||
|
||||
public record ReviewDto(
|
||||
int Id,
|
||||
int LectureId,
|
||||
string? LectureTitle,
|
||||
int UserId,
|
||||
string? UserName,
|
||||
ReviewRating Rating,
|
||||
string? Text,
|
||||
ReviewLlmStatus LlmStatus,
|
||||
ReviewSentiment? Sentiment,
|
||||
double? QualityScore,
|
||||
bool? IsInformative,
|
||||
string[]? LlmTags,
|
||||
DateTime CreatedAt
|
||||
);
|
||||
|
||||
public record CreateReviewRequest(int LectureId, ReviewRating Rating, string? Text);
|
||||
|
||||
public record UpdateReviewRequest(ReviewRating Rating, string? Text);
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace UniVerse.Application.DTOs.Sync;
|
||||
|
||||
public record SyncScheduleRequest(
|
||||
string? SpecialtyCode,
|
||||
DateTime? TimeMin,
|
||||
DateTime? TimeMax,
|
||||
string? TypeId
|
||||
);
|
||||
|
||||
public record SyncResultDto(int Created, int Updated, int Skipped, string? Error);
|
||||
|
||||
public record SyncStatusDto(DateTime? LastSyncAt, string Status, SyncResultDto? LastResult);
|
||||
|
||||
public record EmployeeDto(string? Id, string FullName, string? Department);
|
||||
@@ -0,0 +1,11 @@
|
||||
using UniVerse.Domain.Enums;
|
||||
|
||||
namespace UniVerse.Application.DTOs.Tags;
|
||||
|
||||
public record TagDto(int Id, string Name, TagType Type, int? ParentId, DateTime CreatedAt);
|
||||
|
||||
public record TagTreeDto(int Id, string Name, TagType Type, List<TagTreeDto> Children);
|
||||
|
||||
public record CreateTagRequest(string Name, TagType Type, int? ParentId);
|
||||
|
||||
public record UpdateTagRequest(string Name, TagType Type, int? ParentId);
|
||||
@@ -0,0 +1,55 @@
|
||||
using UniVerse.Domain.Enums;
|
||||
|
||||
namespace UniVerse.Application.DTOs.Users;
|
||||
|
||||
public record UserDto(
|
||||
int Id,
|
||||
string Email,
|
||||
string? DisplayName,
|
||||
string? AvatarUrl,
|
||||
UserRole Role,
|
||||
bool IsActive,
|
||||
int Xp,
|
||||
int Coins,
|
||||
int Level,
|
||||
DateTime CreatedAt
|
||||
);
|
||||
|
||||
public record UserStatsDto(
|
||||
int TotalLectures,
|
||||
int AttendedLectures,
|
||||
int TotalReviews,
|
||||
int Xp,
|
||||
int Coins,
|
||||
int Level,
|
||||
int AchievementsCount
|
||||
);
|
||||
|
||||
public record UpdateUserRequest(
|
||||
string? DisplayName,
|
||||
string? AvatarUrl
|
||||
);
|
||||
|
||||
public record UserFilterRequest(
|
||||
string? Search,
|
||||
UserRole? Role,
|
||||
bool? IsActive,
|
||||
int Page = 1,
|
||||
int PageSize = 20
|
||||
);
|
||||
|
||||
public record StudentProfileDto(
|
||||
int Id,
|
||||
string? StudentId,
|
||||
string? GroupName,
|
||||
int? EnrollmentYear,
|
||||
string? Faculty,
|
||||
string? Specialty
|
||||
);
|
||||
|
||||
public record TeacherProfileDto(
|
||||
int Id,
|
||||
string? Department,
|
||||
string? Title,
|
||||
string? Bio
|
||||
);
|
||||
Reference in New Issue
Block a user