1
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using Jiaowu.Api.Domain.Common;
|
||||
|
||||
namespace Jiaowu.Api.Domain.Academic;
|
||||
|
||||
public sealed class Campus : CatalogEntity
|
||||
{
|
||||
public string? Address { get; set; }
|
||||
}
|
||||
|
||||
public sealed class College : CatalogEntity
|
||||
{
|
||||
public Guid? CampusId { get; set; }
|
||||
public Campus? Campus { get; set; }
|
||||
public string? ShortName { get; set; }
|
||||
}
|
||||
|
||||
public sealed class Major : CatalogEntity
|
||||
{
|
||||
public Guid CollegeId { get; set; }
|
||||
public College? College { get; set; }
|
||||
public required string DegreeType { get; set; }
|
||||
public int SchoolingYears { get; set; } = 4;
|
||||
}
|
||||
|
||||
public sealed class AdministrativeClass : CatalogEntity
|
||||
{
|
||||
public Guid MajorId { get; set; }
|
||||
public Major? Major { get; set; }
|
||||
public int Grade { get; set; }
|
||||
public string? CounselorName { get; set; }
|
||||
}
|
||||
|
||||
public sealed class Building : CatalogEntity
|
||||
{
|
||||
public Guid CampusId { get; set; }
|
||||
public Campus? Campus { get; set; }
|
||||
}
|
||||
|
||||
public sealed class Classroom : CatalogEntity
|
||||
{
|
||||
public Guid BuildingId { get; set; }
|
||||
public Building? Building { get; set; }
|
||||
public int Capacity { get; set; }
|
||||
public string RoomType { get; set; } = "普通教室";
|
||||
public string? Equipment { get; set; }
|
||||
}
|
||||
|
||||
public sealed class AcademicTerm : CatalogEntity
|
||||
{
|
||||
public required string AcademicYear { get; set; }
|
||||
public TermSeason Season { get; set; }
|
||||
public DateOnly StartDate { get; set; }
|
||||
public DateOnly EndDate { get; set; }
|
||||
public bool IsCurrent { get; set; }
|
||||
}
|
||||
|
||||
public enum TermSeason
|
||||
{
|
||||
Autumn = 1,
|
||||
Spring = 2,
|
||||
Summer = 3
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace Jiaowu.Api.Domain.Common;
|
||||
|
||||
public abstract class EntityBase
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public abstract class CatalogEntity : EntityBase
|
||||
{
|
||||
public required string Code { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public int SortOrder { get; set; }
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Jiaowu.Api.Domain.Identity;
|
||||
|
||||
public sealed class ApplicationUser : IdentityUser<Guid>
|
||||
{
|
||||
public required string DisplayName { get; set; }
|
||||
public string? StaffNumber { get; set; }
|
||||
public Guid? CollegeId { get; set; }
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? LastLoginAt { get; set; }
|
||||
}
|
||||
|
||||
public sealed class ApplicationRole : IdentityRole<Guid>
|
||||
{
|
||||
public string? Description { get; set; }
|
||||
public DataScope DataScope { get; set; } = DataScope.Self;
|
||||
}
|
||||
|
||||
public enum DataScope
|
||||
{
|
||||
Self = 0,
|
||||
Class = 1,
|
||||
College = 2,
|
||||
All = 3
|
||||
}
|
||||
|
||||
public static class SystemRoles
|
||||
{
|
||||
public const string SuperAdmin = "SuperAdmin";
|
||||
public const string AcademicAdmin = "AcademicAdmin";
|
||||
public const string CollegeAdmin = "CollegeAdmin";
|
||||
public const string Teacher = "Teacher";
|
||||
public const string Counselor = "Counselor";
|
||||
public const string Student = "Student";
|
||||
public const string Leader = "Leader";
|
||||
|
||||
public static readonly string[] All =
|
||||
[
|
||||
SuperAdmin,
|
||||
AcademicAdmin,
|
||||
CollegeAdmin,
|
||||
Teacher,
|
||||
Counselor,
|
||||
Student,
|
||||
Leader
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Jiaowu.Api.Domain.Common;
|
||||
|
||||
namespace Jiaowu.Api.Domain.System;
|
||||
|
||||
public sealed class AuditLog : EntityBase
|
||||
{
|
||||
public Guid? UserId { get; set; }
|
||||
public string? UserName { get; set; }
|
||||
public required string Method { get; set; }
|
||||
public required string Path { get; set; }
|
||||
public int StatusCode { get; set; }
|
||||
public string? IpAddress { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user