CourseAppService.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 科目基础数据管理服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "base-course")]
  7. [Route("base/course")]
  8. public class CourseAppService : IDynamicApiController
  9. {
  10. private readonly ICourseService _courseService;
  11. public CourseAppService(ICourseService courseService)
  12. {
  13. _courseService = courseService;
  14. }
  15. /// <summary>
  16. /// 添加科目
  17. /// </summary>
  18. /// <param name="input"></param>
  19. /// <returns></returns>
  20. public async Task Add(AddCourseInput input)
  21. {
  22. await _courseService.Add(input);
  23. }
  24. /// <summary>
  25. /// 更新科目
  26. /// </summary>
  27. /// <param name="input"></param>
  28. /// <returns></returns>
  29. public async Task Update(UpdateCourseInput input)
  30. {
  31. await _courseService.Update(input);
  32. }
  33. /// <summary>
  34. /// 软删除科目
  35. /// </summary>
  36. /// <param name="input"></param>
  37. /// <returns></returns>
  38. public async Task Del(BaseId input)
  39. {
  40. await _courseService.Del(input);
  41. }
  42. /// <summary>
  43. /// 根据ID获取单个科目
  44. /// </summary>
  45. /// <param name="id"></param>
  46. /// <returns></returns>
  47. public async Task<CourseOutput> GetById([FromQuery][Required] int id)
  48. {
  49. return await _courseService.GetById(id);
  50. }
  51. /// <summary>
  52. /// 获取全部科目完整信息列表
  53. /// </summary>
  54. /// <returns></returns>
  55. public async Task<List<CourseOutput>> GetAllList()
  56. {
  57. return await _courseService.GetAllList();
  58. }
  59. /// <summary>
  60. /// 获取全部科目简要信息列表
  61. /// </summary>
  62. /// <returns></returns>
  63. public async Task<List<CourseLiteOutput>> GetAllLiteList()
  64. {
  65. return await _courseService.GetAllLiteList();
  66. }
  67. }