Files
ACP/Service/Implement/TestCheckRecordService.cs
2026-08-30 15:57:28 +08:00

39 lines
1.2 KiB
C#

using Model;
using Model.Entity;
using ORM;
using Service.Interface;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Service.Implement
{
public class TestCheckRecordService : BaseService<TestCheckRecordEntity>, ITestCheckRecordService
{
public TestCheckRecordService(SqlSugarRepository<TestCheckRecordEntity> repository) : base(repository)
{
}
/// <summary>
/// 根据 TestRoundId 查询该次运行的所有测试项判断记录(按创建时间升序)
/// </summary>
public async Task<Result<List<TestCheckRecordEntity>>> GetByTestRoundIdAsync(Guid testRoundId)
{
try
{
var list = await _repository.Entities
.Where(x => x.TestRoundId == testRoundId)
.OrderBy(x => x.CreateTime)
.ToListAsync();
return Result<List<TestCheckRecordEntity>>.Success(list);
}
catch (Exception ex)
{
return Result<List<TestCheckRecordEntity>>.Error("根据 TestRoundId 查询测试项判断记录失败", ex);
}
}
}
}