Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 重构 #6

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft

v3 重构 #6

wants to merge 26 commits into from

Conversation

ricky8955555
Copy link
Collaborator

@ricky8955555 ricky8955555 commented Dec 27, 2024

目前处于 Draft (草稿) 阶段,在完成工作后将会转为 Ready (就绪) 拉取请求。

@ricky8955555 ricky8955555 self-assigned this Dec 27, 2024
@ricky8955555
Copy link
Collaborator Author

ricky8955555 commented Dec 27, 2024

API

返回类型

API 统一返回 api/types.py 中定义的 ApiResponse[T] 类型。

定义

路由中 {...} 对应待完善参数,路由具体定义参见 api/ 相应路由的注释。

若请求方法不带请求体,路由后 () 内为返回类型;若请求方法带请求体,则第一个为请求体类型,第二个为返回类型。

类型相关定义参见 api/types.pymodels/__init__.py

教务系统相关

  • GET /api/eas/courses (list[Course]): 获取公选课课程列表
  • GET /api/courses/{id}/lessons (list[Lesson]): 获取公选课的节次详情列表

抢课工具相关

  • GET /api/grabber (list[KeyValuePair[int, GrabberTask]]]): 获取抢课任务列表
  • POST /api/grabber (GrabberTask, None): 添加抢课任务
  • DELETE /api/grabber/{id} (None): 销毁抢课任务
  • GET /api/grabber/{id} (GrabberTask): 获取抢课任务
  • GET /api/grabber/{id}/reset (None): 重置抢课任务
  • GET /api/grabber/{id}/start (bool): 启动抢课任务
  • GET /api/grabber/{id}/cancel (bool): 取消抢课任务
  • PUT /api/grabber/{id} (GrabberTask, None): 更新抢课任务

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants