GradeAppService.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 年级信息服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "base-grade")]
  7. [Route("base/grade")]
  8. public class GradeAppService : IDynamicApiController
  9. {
  10. private readonly IGradeService _gradeService;
  11. public GradeAppService(IGradeService gradeService)
  12. {
  13. _gradeService = gradeService;
  14. }
  15. /// <summary>
  16. /// 根据ID获取年级信息
  17. /// </summary>
  18. /// <param name="id"></param>
  19. /// <returns></returns>
  20. public async Task<GradeOutput> GetById([FromQuery][Required] int id)
  21. {
  22. return await _gradeService.GetById(id);
  23. }
  24. /// <summary>
  25. /// 根据学段获取年级列表
  26. /// </summary>
  27. /// <param name="stage"></param>
  28. /// <returns></returns>
  29. public async Task<List<GradeOutput>> GetListByEducationStage([FromQuery][Required] EducationStage stage)
  30. {
  31. return await _gradeService.GetListByEducationStage(stage);
  32. }
  33. /// <summary>
  34. /// 根据学期和学段获取年级年份
  35. /// </summary>
  36. /// <param name="input"></param>
  37. /// <returns></returns>
  38. public async Task<List<GradeYearOutput>> QueryGradeYearList(QueryGradeYearInput input)
  39. {
  40. return await _gradeService.QueryGradeYearList(input);
  41. }
  42. /// <summary>
  43. /// 获取全部年级列表
  44. /// </summary>
  45. /// <returns></returns>
  46. public async Task<List<GradeOutput>> GetAllList()
  47. {
  48. return await _gradeService.GetAllList();
  49. }
  50. }