Files
TechHelper/Entities/Contracts/User.cs
SpecialX 6a65281850
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 13s
重构作业结构:优化实体模型、DTO映射和前端界面
- 重构AppMainStruct、AssignmentQuestion、Question等实体模型
- 更新相关DTO以匹配新的数据结构
- 优化前端页面布局和组件
- 添加全局信息和笔记功能相关代码
- 更新数据库迁移和程序配置
2025-09-04 15:43:33 +08:00

50 lines
1.5 KiB
C#

using Microsoft.AspNetCore.Identity;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entities.Contracts
{
public enum UserRoles
{
Student,
Teacher,
Administrator
}
public class User : IdentityUser<Guid>
{
public string? RefreshToken { get; set; }
public DateTime? RefreshTokenExpiryTime { get; set; }
public string? Address { get; set; }
public string? DisplayName { get; set; }
public SubjectAreaEnum SubjectArea { get; set; } = SubjectAreaEnum.Unknown;
[Column("deleted")]
public bool IsDeleted { get; set; }
[InverseProperty(nameof(ClassTeacher.Teacher))]
public ICollection<ClassTeacher> TaughtClassesLink { get; set; }
[InverseProperty(nameof(ClassStudent.Student))]
public ICollection<ClassStudent> EnrolledClassesLink { get; set; }
public ICollection<Question> CreatedQuestions { get; set; }
public ICollection<Assignment> CreatedAssignments { get; set; }
public ICollection<SubmissionDetail> SubmissionDetails { get; set; }
public ICollection<Submission> SubmissionsAsStudent { get; set; }
public ICollection<Submission> GradedSubmissions { get; set; }
public User()
{
Id = Guid.NewGuid();
SecurityStamp = Guid.NewGuid().ToString();
CreatedQuestions = new HashSet<Question>();
TaughtClassesLink = new HashSet<ClassTeacher>();
EnrolledClassesLink = new HashSet<ClassStudent>();
CreatedAssignments = new HashSet<Assignment>();
GradedSubmissions = new HashSet<Submission>();
SubmissionsAsStudent = new HashSet<Submission>();
}
}
}