ExamDataPublishAppService.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 监测发布内容管理服务
  5. /// </summary>
  6. public class ExamDataPublishAppService : IDynamicApiController
  7. {
  8. private readonly IExamDataPublishService _examDataPublishService;
  9. public ExamDataPublishAppService(IExamDataPublishService examDataPublishService)
  10. {
  11. _examDataPublishService = examDataPublishService;
  12. }
  13. #region 创建更新
  14. /// <summary>
  15. /// 添加发布内容
  16. /// </summary>
  17. /// <param name="input"></param>
  18. /// <returns></returns>
  19. public async Task Add(AddExamDataPublishInput input)
  20. {
  21. await _examDataPublishService.Add(input);
  22. }
  23. /// <summary>
  24. /// 更新发布内容
  25. /// </summary>
  26. /// <param name="input"></param>
  27. /// <returns></returns>
  28. public async Task Update(UpdateExamDataPublishInput input)
  29. {
  30. await _examDataPublishService.Update(input);
  31. }
  32. /// <summary>
  33. /// 删除发布内容
  34. /// </summary>
  35. /// <param name="input"></param>
  36. /// <returns></returns>
  37. public async Task Del(BaseId input)
  38. {
  39. await _examDataPublishService.Del(input);
  40. }
  41. #endregion
  42. #region 状态处理
  43. /// <summary>
  44. /// 发布
  45. /// </summary>
  46. /// <param name="input"></param>
  47. /// <returns></returns>
  48. public async Task Publish(BaseId input)
  49. {
  50. await _examDataPublishService.Publish(input);
  51. }
  52. /// <summary>
  53. /// 取消
  54. /// </summary>
  55. /// <param name="input"></param>
  56. /// <returns></returns>
  57. public async Task Unpublish(BaseId input)
  58. {
  59. await _examDataPublishService.Unpublish(input);
  60. }
  61. #endregion
  62. #region 查询
  63. /// <summary>
  64. /// 根据ID获取监测数据发布内容
  65. /// </summary>
  66. /// <param name="id"></param>
  67. /// <returns></returns>
  68. public async Task<ExamDataPublishOutput> GetById(int id)
  69. {
  70. return await _examDataPublishService.GetById(id);
  71. }
  72. /// <summary>
  73. /// 根据监测计划ID获取数据发布内容列表
  74. /// </summary>
  75. /// <param name="examPlanId"></param>
  76. /// <returns></returns>
  77. public async Task<List<ExamDataPublishOutput>> GetListByExamPlanId(int examPlanId)
  78. {
  79. return await _examDataPublishService.GetListByExamPlanId(examPlanId);
  80. }
  81. #endregion
  82. }