Files
TechHelper/TechHelper.Server/Repositories/IExamRepository.cs
2025-06-20 18:58:11 +08:00

38 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Entities.Contracts;
namespace TechHelper.Server.Repositories
{
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);
Task AddAsync(AssignmentQuestion assignment);
Task AddAsync(Question assignment);
Task AddAsync(AssignmentClass assignment);
}
}