Implement comprehensive academic workflow enhancements
This commit is contained in:
1 parent
b4e5663c28
commit
9f533ad02a
12 files changed
+7420
-13
No files matched your search
@@ -557,7 +557,7 @@ public sealed class BaseDataController(AppDbContext db, IAppCache cache) : Contr
|
||||
.Select(x => new ClassroomListItem(
|
||||
x.Id, x.Code, x.Name, x.BuildingId, x.Building!.CampusId,
|
||||
x.Building.Name, x.Building.Campus!.Name, x.Capacity,
|
||||
x.RoomType, x.TeachingVenueNature, x.Equipment,
|
||||
x.Floor, x.RoomType, x.TeachingVenueNature, x.Equipment,
|
||||
x.IsEnabled, x.SortOrder))
|
||||
.ToListAsync(cancellationToken);
|
||||
return Ok(new PagedResult<ClassroomListItem>(
|
||||
@@ -578,6 +578,7 @@ public sealed class BaseDataController(AppDbContext db, IAppCache cache) : Contr
|
||||
x.Building.Name,
|
||||
x.Building.Campus!.Name,
|
||||
x.Capacity,
|
||||
x.Floor,
|
||||
x.RoomType,
|
||||
x.TeachingVenueNature,
|
||||
x.Equipment,
|
||||
@@ -645,6 +646,7 @@ public sealed class BaseDataController(AppDbContext db, IAppCache cache) : Contr
|
||||
Name = request.Name.Trim(),
|
||||
BuildingId = request.BuildingId,
|
||||
Capacity = request.Capacity,
|
||||
Floor = request.Floor,
|
||||
RoomType = request.RoomType.Trim(),
|
||||
TeachingVenueNature = request.TeachingVenueNature == 0
|
||||
? TeachingVenueNature.GeneralClassroom
|
||||
@@ -668,6 +670,7 @@ public sealed class BaseDataController(AppDbContext db, IAppCache cache) : Contr
|
||||
ApplyCatalog(entity, request);
|
||||
entity.BuildingId = request.BuildingId;
|
||||
entity.Capacity = request.Capacity;
|
||||
entity.Floor = request.Floor;
|
||||
entity.RoomType = request.RoomType.Trim();
|
||||
entity.TeachingVenueNature = request.TeachingVenueNature == 0
|
||||
? TeachingVenueNature.GeneralClassroom
|
||||
@@ -822,6 +825,7 @@ public sealed record ClassroomRequest(
|
||||
string Code, string Name, int SortOrder, bool IsEnabled,
|
||||
Guid BuildingId,
|
||||
[Range(1, 1000)] int Capacity,
|
||||
[Range(1, 99)] int Floor,
|
||||
[Required, MaxLength(40)] string RoomType,
|
||||
TeachingVenueNature TeachingVenueNature,
|
||||
[MaxLength(300)] string? Equipment)
|
||||
@@ -879,6 +883,7 @@ public sealed record ClassroomListItem(
|
||||
string BuildingName,
|
||||
string CampusName,
|
||||
int Capacity,
|
||||
int Floor,
|
||||
string RoomType,
|
||||
TeachingVenueNature TeachingVenueNature,
|
||||
string? Equipment,
|
||||
|
||||
@@ -44,6 +44,7 @@ public sealed class Classroom : CatalogEntity
|
||||
{
|
||||
public Guid BuildingId { get; set; }
|
||||
public Building? Building { get; set; }
|
||||
public int Floor { get; set; } = 1;
|
||||
public int Capacity { get; set; }
|
||||
public string RoomType { get; set; } = "普通教室";
|
||||
public TeachingVenueNature TeachingVenueNature { get; set; } =
|
||||
|
||||
@@ -258,11 +258,14 @@ public sealed class AppDbContext(DbContextOptions<AppDbContext> options)
|
||||
.HasForeignKey(x => x.CampusId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
builder.Entity<Classroom>()
|
||||
.HasOne(x => x.Building)
|
||||
.WithMany()
|
||||
.HasForeignKey(x => x.BuildingId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
builder.Entity<Classroom>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Floor).HasDefaultValue(1);
|
||||
entity.HasOne(x => x.Building)
|
||||
.WithMany()
|
||||
.HasForeignKey(x => x.BuildingId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
builder.Entity<AcademicTerm>(entity =>
|
||||
{
|
||||
|
||||
Loaded 3 of 12 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user