SchoolClassAppService.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 学校班级信息管理服务
  5. /// </summary>
  6. [ApiDescriptionSettings(Name = "base-school-class")]
  7. [Route("base/school/class")]
  8. public class SchoolClassAppService : IDynamicApiController
  9. {
  10. private readonly ISchoolClassService _schoolClassService;
  11. public SchoolClassAppService(ISchoolClassService schoolClassService)
  12. {
  13. _schoolClassService = schoolClassService;
  14. }
  15. /// <summary>
  16. /// 添加学校班级
  17. /// </summary>
  18. /// <param name="input"></param>
  19. /// <returns></returns>
  20. public async Task Add(AddSchoolClassInput input)
  21. {
  22. await _schoolClassService.Add(input);
  23. }
  24. /// <summary>
  25. /// 批量添加学校班级
  26. /// </summary>
  27. /// <param name="input"></param>
  28. /// <returns></returns>
  29. public async Task BatchAdd(BatchAddSchoolClassInput input)
  30. {
  31. await _schoolClassService.BatchAdd(input);
  32. }
  33. /// <summary>
  34. /// 根据ID获取学校班级信息
  35. /// </summary>
  36. /// <param name="id"></param>
  37. /// <returns></returns>
  38. public async Task<SchoolClassOutput> GetById([FromQuery][Required] long id)
  39. {
  40. return await _schoolClassService.GetById(id);
  41. }
  42. /// <summary>
  43. /// 根据级获取学校班级列表
  44. /// </summary>
  45. /// <param name="gradeBeginYear"></param>
  46. /// <returns></returns>
  47. public async Task<List<SchoolClassOutput>> GetListByGradeBeginYear([FromQuery][Required] short gradeBeginYear)
  48. {
  49. return await _schoolClassService.GetListByGradeBeginYear(gradeBeginYear);
  50. }
  51. /// <summary>
  52. /// 分页查询班级列表
  53. /// </summary>
  54. /// <param name="input"></param>
  55. /// <returns></returns>
  56. public async Task<PageResult<SchoolClassOutput>> QueryPageList(SchoolClassPageInput input)
  57. {
  58. return await _schoolClassService.QueryPageList(input);
  59. }
  60. }