This commit is contained in:
2026-07-24 12:42:51 +08:00 Unverified
commit 67905dfa16
56 changed files with 7630 additions and 0 deletions
@@ -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
];
}