重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
This commit is contained in:
@@ -3,47 +3,57 @@ 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? HomeAddress { get; set; }
|
||||
|
||||
public string? DisplayName { get; set; }
|
||||
public SubjectAreaEnum SubjectArea { get; set; } = SubjectAreaEnum.Unknown;
|
||||
|
||||
public UserRoles? Role { get; set; }
|
||||
|
||||
public Guid? TeachSubjectId { get; set; }
|
||||
[ForeignKey(nameof(TeachSubjectId))]
|
||||
public virtual Subject? TeachSubject { get; set; }
|
||||
|
||||
[Column("deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
[InverseProperty(nameof(ClassUser.User))]
|
||||
public virtual ICollection<ClassUser> UserInjoinedClass { get; set; }
|
||||
|
||||
[InverseProperty(nameof(ClassTeacher.Teacher))]
|
||||
public ICollection<ClassTeacher> TaughtClassesLink { get; set; }
|
||||
[InverseProperty(nameof(ClassStudent.Student))]
|
||||
public ICollection<ClassStudent> EnrolledClassesLink { get; set; }
|
||||
//[InverseProperty(nameof(Question.Creator))]
|
||||
//public virtual ICollection<Question> CreatedQuestions { get; set; }
|
||||
|
||||
[InverseProperty(nameof(Exam.Creator))]
|
||||
public virtual ICollection<Exam> CreatedExams { get; set; }
|
||||
|
||||
[InverseProperty(nameof(SubmissionDetail.Student))]
|
||||
public virtual ICollection<SubmissionDetail> SubmissionDetails { get; set; }
|
||||
|
||||
[InverseProperty(nameof(Submission.Student))]
|
||||
public virtual ICollection<Submission> StudentSubmissions { get; set; }
|
||||
|
||||
[InverseProperty(nameof(Submission.Grader))]
|
||||
public virtual ICollection<Submission> GradedSubmissions { 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>();
|
||||
//CreatedQuestions = new HashSet<Question>();
|
||||
UserInjoinedClass = new HashSet<ClassUser>();
|
||||
CreatedExams = new HashSet<Exam>();
|
||||
GradedSubmissions = new HashSet<Submission>();
|
||||
SubmissionsAsStudent = new HashSet<Submission>();
|
||||
StudentSubmissions = new HashSet<Submission>();
|
||||
SubmissionDetails = new HashSet<SubmissionDetail>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user