__init__.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from fastapi import APIRouter
  4. from admin.api.endpoints.homepage.statistics import (statistic_resource, resource_date_dist,
  5. statistic_marktask, get_top10_school_by_task,
  6. get_top10_subject_by_task, statistic_school,
  7. school_distribute)
  8. from schemas.homepage.statistic import (ResourceStatistic, ResourceDistribute, MarkTaskStatistic,
  9. Top10SchoolByTask, Top10SubjectByTask, SchoolStatistic,
  10. SchoolDistribute)
  11. router = APIRouter(tags=["后台首页"], prefix="/homepage")
  12. router.add_api_route("/res-stats",
  13. statistic_resource,
  14. methods=["get"],
  15. response_model=ResourceStatistic,
  16. response_model_exclude_none=True,
  17. summary="后台首页-资源统计数据")
  18. router.add_api_route("/res-dist",
  19. resource_date_dist,
  20. methods=["get"],
  21. response_model=ResourceDistribute,
  22. response_model_exclude_none=True,
  23. summary="后台首页-资源月度统计数据")
  24. router.add_api_route("/mark-stats",
  25. statistic_marktask,
  26. methods=["get"],
  27. response_model=MarkTaskStatistic,
  28. response_model_exclude_none=True,
  29. summary="后台首页-阅卷任务统计数据")
  30. router.add_api_route("/top10-schools",
  31. get_top10_school_by_task,
  32. methods=["get"],
  33. response_model=Top10SchoolByTask,
  34. response_model_exclude_none=True,
  35. summary="后台首页-阅卷任务Top10学校")
  36. router.add_api_route("/top10-subjects",
  37. get_top10_subject_by_task,
  38. methods=["get"],
  39. response_model=Top10SubjectByTask,
  40. response_model_exclude_none=True,
  41. summary="后台首页-阅卷任务Top10科目")
  42. router.add_api_route("/school-stats",
  43. statistic_school,
  44. methods=["get"],
  45. response_model=SchoolStatistic,
  46. response_model_exclude_none=True,
  47. summary="后台首页-学校/班级/教师/学生统计数据")
  48. router.add_api_route("/school-dist",
  49. school_distribute,
  50. methods=["get"],
  51. response_model=SchoolDistribute,
  52. response_model_exclude_none=True,
  53. summary="后台首页-学校地区分布")
  54. __all__ = [router]