重构试卷相关内容
This commit is contained in:
27
TechHelper.Server/Repository/IExamRepository.cs
Normal file
27
TechHelper.Server/Repository/IExamRepository.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Entities.Contracts;
|
||||
|
||||
namespace TechHelper.Server.Repository
|
||||
{
|
||||
public interface IExamRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据ID异步获取一个完整的试卷实体,包括所有子题组和题目。
|
||||
/// </summary>
|
||||
/// <param name="assignmentId">试卷ID</param>
|
||||
/// <returns>完整的 Assignment 实体,如果找不到则返回 null。</returns>
|
||||
Task<Assignment?> GetFullExamByIdAsync(Guid assignmentId);
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定用户创建的所有试卷的预览信息。
|
||||
/// </summary>
|
||||
/// <param name="userId">用户ID</param>
|
||||
/// <returns>Assignment 实体集合。</returns>
|
||||
Task<IEnumerable<Assignment>> GetExamPreviewsByUserAsync(Guid userId);
|
||||
|
||||
/// <summary>
|
||||
/// 向数据库添加一个新的试卷。
|
||||
/// </summary>
|
||||
/// <param name="assignment">要添加的试卷实体。</param>
|
||||
Task AddAsync(Assignment assignment);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user