主要能力: 教师、学生可在“我的课表”启用订阅、复制 URL、唤起日历客户端或下载一次性 ICS。 自动覆盖固定课程、调停课后的最新安排、考试/监考、补考,以及灵活课程提醒。 采用独立随机订阅标识和 HMAC 签名;重置或停用后旧地址立即失效。 支持 ETag 条件请求和一小时刷新提示,减少日历客户端重复同步。 订阅地址按实际前端 API 地址生成,兼容独立部署域名。 已增加窄屏弹窗最大宽度和纵向操作布局。
52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
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 string? CalendarSubscriptionStamp { get; set; }
|
|
public DateTime? CalendarSubscriptionCreatedAt { 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
|
|
];
|
|
}
|