using YBEE.EQM.Core;
namespace YBEE.EQM.Application;
///
/// 监测数据上报类型管理服务
///
[ApiDescriptionSettings(Name = "exam-data-report")]
[Route("exam/data/report")]
public class ExamDataReportAppService(IExamDataReportService examDataReportService, IResourceFileService resourceFileService) : IDynamicApiController
{
#region 创建更新
///
/// 添加上报类型
///
///
///
public async Task Add(AddExamDataReportInput input)
{
await examDataReportService.Add(input);
}
///
/// 更新上报类型
///
///
///
public async Task Update(UpdateExamDataReportInput input)
{
await examDataReportService.Update(input);
}
///
/// 删除上报类型
///
///
///
public async Task Del(BaseId input)
{
await examDataReportService.Del(input);
}
///
/// 上传附件
///
///
///
[RequestSizeLimit(1024 * 1024 * 1024)]
[RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue)]
public async Task UploadAttachment([FromForm] UploadResourceFileInput input)
{
var rfile = await resourceFileService.Upload(input);
var addParams = rfile.Adapt();
await examDataReportService.AddAttachment(addParams);
}
///
/// 删除附件
///
///
///
public async Task DelAttachment(DeleteAttachmentInput input)
{
await examDataReportService.DelAttachment(input);
}
#endregion
#region 状态处理
///
/// 开始
///
///
///
public async Task Start(BaseId input)
{
await examDataReportService.Start(input);
}
///
/// 结束
///
///
///
public async Task Stop(BaseId input)
{
await examDataReportService.Stop(input);
}
///
/// 取消
///
///
///
public async Task Cancel(BaseId input)
{
await examDataReportService.Cancel(input);
}
#endregion
#region 查询
///
/// 根据ID获取监测数据上报类型
///
///
///
public async Task GetById([FromQuery][Required] int id)
{
return await examDataReportService.GetById(id);
}
///
/// 根据监测计划ID获取数据上报类型列表
///
///
///
public async Task> GetListByExamPlanId([FromQuery][Required] int examPlanId)
{
return await examDataReportService.GetListByExamPlanId(examPlanId);
}
///
/// 获取数据上报计划列表
///
///
///
public async Task> QueryPlanPageList(ExamDataReportPageInput input)
{
return await examDataReportService.QueryPlanPageList(input);
}
#endregion
}