1234567891011121314151617181920212223242526272829303132333435363738 |
- using Furion.DatabaseAccessor.Extensions;
- using YBEE.EQM.Core;
- namespace YBEE.EQM.Application;
- /// <summary>
- /// 反馈结果管理服务(各机构均适用)
- /// </summary>
- public class ExamResultService : IExamResultService, ITransient
- {
- private readonly IRepository<ExamResult> _rep;
- public ExamResultService(IRepository<ExamResult> rep)
- {
- _rep = rep;
- }
- /// <summary>
- /// 添加监测结果文件
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- public async Task Add(AddExamResultInput input)
- {
- var item = input.Adapt<ExamResult>();
- await item.InsertAsync();
- }
- /// <summary>
- /// 根据发布内容ID获取文件列表
- /// </summary>
- /// <param name="publishId"></param>
- /// <returns></returns>
- public async Task<List<ExamResultOutput>> GetListByPublishId(int publishId)
- {
- var items = await _rep.DetachedEntities.Where(t => t.ExamDataPublishId == publishId).ProjectToType<ExamResultOutput>().ToListAsync();
- return items;
- }
- }
|