diff --git a/README.md b/README.md index 56a6123..84d2328 100644 --- a/README.md +++ b/README.md @@ -1,195 +1,41 @@ # Life@USTC CLI -Command-line client for the [Life@USTC](https://life-ustc.tiankaima.dev) campus platform. +终端里使用 [Life@USTC](https://life-ustc.tiankaima.dev) 的命令行客户端 +(`life-ustc`)。数据与权限来自 +[server](https://github.com/Life-USTC/server);域与能力名与 Web / Bot / MCP 同一棵树 +([interface hierarchy](https://github.com/Life-USTC/server/blob/main/docs/interface-hierarchy.md))。 -Built with Go around a [GitHub CLI](https://github.com/cli/cli)-style command model. +## 面向谁 -## Installation +- 习惯 shell 管理课表、待办、作业与订阅的同学 +- 需要脚本化调用 REST、或从官方教务站同步数据的用户 +- 做内容治理的管理员 -### From release binaries +## 命令域 -Download the latest release from [GitHub Releases](https://github.com/Life-USTC/CLI/releases). +| 域 | 能做什么 | +|----|----------| +| `catalog` | 公开事实:学期、课程、教学班、教师、课表、校车、校园链接、元数据 | +| `workspace` | 个人概览、日历 / iCal、课表、考试、待办 CRUD、作业完成态、教学班订阅、校车偏好、链接置顶、上传 | +| `workspace school` | 直连校方站点:本科/研究生学期、课表、考试、成绩、作业,并可 `sync` 回 Life@USTC 订阅 | +| `community` | 评论(含反应)、描述、教学班作业 | +| `account` | 登录 / 登出、session、token、资料、语言 | +| `admin` | 用户、封禁、评论 / 描述 / 作业治理 | +| `api` | 对任意 REST 路径的逃生舱(适合脚本) | +| `config` / `completion` | 默认 server、教务程序偏好、shell 补全 | -### From source +交互终端下,裸的 `course` / `section` / `teacher` 列表会打开 TUI;加过滤或 +`--no-interactive` 则输出表格。机器可读输出:`--json` / `--format json`,可用 `--jq`。 -```bash -go install github.com/Life-USTC/CLI/cmd/life-ustc@latest -``` - -### Build from source - -```bash -git clone https://github.com/Life-USTC/CLI.git -cd CLI -make build -``` - -## Usage - -```bash -# Set server (default: https://life-ustc.tiankaima.dev) -life-ustc --server http://localhost:3000 account login - -# Or set default server -life-ustc config set-server http://localhost:3000 - -# Authenticate -life-ustc account login -life-ustc account session -life-ustc account profile -life-ustc account locale zh-cn - -# Personal workflows -life-ustc workspace overview -life-ustc workspace todo --pending -life-ustc workspace todo create --title "Write report" --priority high -life-ustc workspace todo complete -life-ustc workspace homework --pending -life-ustc workspace homework complete -life-ustc workspace schedule -life-ustc workspace exam -life-ustc workspace subscription list -life-ustc workspace subscription set -life-ustc workspace subscription import -life-ustc workspace calendar events -life-ustc workspace calendar feed -life-ustc workspace bus-preferences get -life-ustc workspace link-pin list -life-ustc workspace link-pin pin jw -life-ustc workspace upload create ./report.pdf -life-ustc workspace upload download -o report.pdf - -# Browse (no auth required unless noted) -# In a terminal, bare course/section/teacher list commands open an interactive TUI. -life-ustc catalog course -life-ustc catalog course list --search "数学分析" -life-ustc catalog course --no-interactive --limit 20 -life-ustc catalog course get -life-ustc catalog section list --semester-id -life-ustc catalog teacher list --search "张" -life-ustc catalog semester current -life-ustc catalog bus timetable --from east --to west -life-ustc catalog link -life-ustc catalog metadata - -# Official USTC sources -life-ustc workspace school semesters -life-ustc workspace school semesters --graduate -life-ustc workspace school curriculum --semester-id -life-ustc workspace school exam -life-ustc workspace school score -life-ustc workspace school homework -life-ustc workspace school sync --dry-run - -# Community features -life-ustc community comment list --target-type section --target-id -life-ustc community comment create --target-type section --target-id --body "Great class!" -life-ustc community description get --target-type course --target-id -life-ustc community section-homework create --title "Problem Set 1" - -# Raw API access -life-ustc api catalog/semesters/current -life-ustc api workspace/todos -F title='Write report' -F priority=high -life-ustc api catalog/sections --jq '.data[].code' - -# Admin -life-ustc admin user list -life-ustc admin comment list --status active -life-ustc admin suspension create --user-id --reason "spam" -``` - -## Command Model - -- `catalog` contains public campus facts such as courses, sections, teachers, schedules, and buses. -- `workspace` contains the current user's todos, homework state, schedules, exams, subscriptions, files, and official-school imports. -- `community` contains shared comments, descriptions, and section homework entities. -- `account` contains profile, login, session, token, and locale operations. -- `admin` contains platform governance commands. -- `config`, `completion`, and `api` remain top-level CLI plumbing rather than product domains. -- Commands that benefit from guided input open their own TUI by default in an interactive terminal when no list/filter flags are provided, such as `course`, `section`, and `teacher`; use `--no-interactive` to force plain table output. - -## Official USTC Sources - -- `life-ustc workspace school semesters` reads undergraduate semesters from `catalog.ustc.edu.cn`, or graduate semesters from the official `yjs1.ustc.edu.cn` graduate apps with `--graduate`. -- `life-ustc workspace school curriculum`, `exam`, and `score` sign in directly from Go without a browser backend. -- `life-ustc workspace school homework` reads Blackboard or graduate homework data. -- `life-ustc workspace school sync` matches school-system lessons to Life@USTC sections and updates workspace subscriptions. - -Authenticated `school` commands accept `--username`, `--password`, `--totp`, `--undergraduate`, `--graduate`, and sync commands also accept `--all-programs`. If omitted, the CLI falls back to the configured school program list, then program-specific credentials, then undergraduate. Persist defaults with `life-ustc config set-school-programs undergraduate,graduate`. - -- Undergraduate username: `PASSPORT_UNDERGRADUATE_USERNAME` -- Graduate username: `PASSPORT_GRADUATE_USERNAME` -- Password: `PASSPORT_PASSWORD` -- TOTP: `PASSPORT_TOTP` - -## JSON output +登录支持浏览器 OAuth(PKCE)与设备码;默认 server 为生产站点,也可用 +`--server` / `LIFE_USTC_SERVER` 指向其它实例。 -All commands support `--format json` or `--json` for machine-readable output: +## 安装 -```bash -life-ustc --json semester list -life-ustc --json catalog course get 12345 -life-ustc catalog section list --jq '.data[].code' -``` - -## Shell Integration - -Install completion into your current shell without manually registering scripts: - -```bash -life-ustc completion install -``` - -You can also target a specific shell: - -```bash -life-ustc completion install --shell zsh -life-ustc completion install --shell bash -``` - -Manual script generation remains available for package managers or custom setups: - -```bash -life-ustc completion -s zsh -life-ustc completion -s fish -``` - -## Raw API - -Use `life-ustc api` for unsupported or newly added endpoints. +发布包:[GitHub Releases](https://github.com/Life-USTC/CLI/releases)。或: ```bash -# GET /api/catalog/metadata -life-ustc api catalog/metadata - -# POST /api/workspace/todos with JSON body inferred from fields -life-ustc api workspace/todos -F title='Write report' -F priority=high - -# POST exact request body from a file -life-ustc api -X POST workspace/todos --input ./todo.json - -# Include response headers -life-ustc api -i catalog/metadata +go install github.com/Life-USTC/CLI/cmd/life-ustc@latest ``` -## Configuration - -- Config directory: `~/.config/life-ustc/` (or `$XDG_CONFIG_HOME/life-ustc/`) -- Override server per-command: `--server URL` -- Environment variable: `LIFE_USTC_SERVER` -- School program default: `life-ustc config set-school-programs undergraduate,graduate` - -## Global Options - -| Option | Description | -|-------------|--------------------------------| -| `--server` | Server URL | -| `--format` | Output format (table/json) | -| `--jq` | Filter JSON output with jq | -| `--no-color`| Disable colored output | -| `--version` | Show version | -| `--help` | Show help | - -## License - -MIT +子命令细节以 `life-ustc --help` 为准。License: MIT。 diff --git a/api/openapi.json b/api/openapi.json index 065b4cb..eb21723 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -532,6 +532,30 @@ } } }, + "/api/search": { + "get": { + "operationId": "get-api-search", + "summary": "Global search across catalog and workspace entities", + "tags": [ + "Api" + ], + "responses": { + "200": { + "description": "Response 200" + }, + "400": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/openApiErrorSchema" + } + } + } + } + } + } + }, "/api/account/preferences": { "post": { "operationId": "setLocale", @@ -1261,7 +1285,9 @@ "name": "versionKey", "schema": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 120, + "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" } } ], @@ -4830,7 +4856,9 @@ "name": "versionKey", "schema": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 120, + "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" } }, { @@ -4910,7 +4938,9 @@ "name": "versionKey", "schema": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 120, + "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" } }, { @@ -5025,7 +5055,7 @@ "/api/catalog/links/resolve": { "get": { "operationId": "catalog_link_resolve", - "summary": "Resolve a public campus link", + "summary": "Resolve a public campus link and record an authenticated visit", "tags": [ "catalog.link" ], @@ -5042,37 +5072,7 @@ ], "responses": { "307": { - "description": "Temporary redirect to target link", - "headers": { - "Location": { - "description": "Redirect target URL", - "schema": { - "type": "string" - } - } - } - } - } - }, - "post": { - "operationId": "catalog_link_visit_record", - "summary": "Resolve a public campus link and record an authenticated visit", - "tags": [ - "catalog.link" - ], - "requestBody": { - "required": true, - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/catalogLinkVisitRequestSchema" - } - } - } - }, - "responses": { - "303": { - "description": "Redirect after recording link click", + "description": "Temporary redirect to target link after recording visit", "headers": { "Location": { "description": "Redirect target URL", @@ -5112,6 +5112,39 @@ "zh-cn" ] } + }, + { + "in": "query", + "name": "includeExams", + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } + }, + { + "in": "query", + "name": "includeSchedules", + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } + }, + { + "in": "query", + "name": "includeTeacherDepartments", + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } } ], "responses": { @@ -11327,52 +11360,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "email": { - "nullable": true, - "type": "string" - }, - "telephone": { - "nullable": true, - "type": "string" - }, - "mobile": { - "nullable": true, - "type": "string" - }, - "address": { - "nullable": true, - "type": "string" - }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, - "departmentId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "teacherTitleId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "namePrimary": { "type": "string" }, @@ -11421,6 +11408,68 @@ "nameSecondary" ], "additionalProperties": false + }, + "teacherTitle": { + "nullable": true, + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "nameCn": { + "type": "string" + }, + "nameEn": { + "nullable": true, + "type": "string" + }, + "code": { + "type": "string" + }, + "enabled": { + "nullable": true, + "type": "boolean" + }, + "namePrimary": { + "type": "string" + }, + "nameSecondary": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "jwId", + "nameCn", + "nameEn", + "code", + "enabled", + "namePrimary", + "nameSecondary" + ], + "additionalProperties": false + }, + "_count": { + "type": "object", + "properties": { + "sections": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "sections" + ], + "additionalProperties": false } }, "required": [ @@ -11430,16 +11479,6 @@ "code", "nameCn", "nameEn", - "age", - "email", - "telephone", - "mobile", - "address", - "postcode", - "qq", - "wechat", - "departmentId", - "teacherTitleId", "namePrimary", "nameSecondary", "department" @@ -12223,12 +12262,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -12245,18 +12278,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -12363,14 +12384,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "department", @@ -15937,52 +15954,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "email": { - "nullable": true, - "type": "string" - }, - "telephone": { - "nullable": true, - "type": "string" - }, - "mobile": { - "nullable": true, - "type": "string" - }, - "address": { - "nullable": true, - "type": "string" - }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, - "departmentId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "teacherTitleId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "namePrimary": { "type": "string" }, @@ -16031,25 +16002,77 @@ "nameSecondary" ], "additionalProperties": false - } - }, - "required": [ - "id", - "personId", - "teacherId", - "code", - "nameCn", - "nameEn", - "age", - "email", - "telephone", - "mobile", - "address", - "postcode", - "qq", - "wechat", - "departmentId", - "teacherTitleId", + }, + "teacherTitle": { + "nullable": true, + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "nameCn": { + "type": "string" + }, + "nameEn": { + "nullable": true, + "type": "string" + }, + "code": { + "type": "string" + }, + "enabled": { + "nullable": true, + "type": "boolean" + }, + "namePrimary": { + "type": "string" + }, + "nameSecondary": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "jwId", + "nameCn", + "nameEn", + "code", + "enabled", + "namePrimary", + "nameSecondary" + ], + "additionalProperties": false + }, + "_count": { + "type": "object", + "properties": { + "sections": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "sections" + ], + "additionalProperties": false + } + }, + "required": [ + "id", + "personId", + "teacherId", + "code", + "nameCn", + "nameEn", "namePrimary", "nameSecondary", "department" @@ -18010,52 +18033,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "email": { - "nullable": true, - "type": "string" - }, - "telephone": { - "nullable": true, - "type": "string" - }, - "mobile": { - "nullable": true, - "type": "string" - }, - "address": { - "nullable": true, - "type": "string" - }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, - "departmentId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, - "teacherTitleId": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "namePrimary": { "type": "string" }, @@ -18104,6 +18081,68 @@ "nameSecondary" ], "additionalProperties": false + }, + "teacherTitle": { + "nullable": true, + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "jwId": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "nameCn": { + "type": "string" + }, + "nameEn": { + "nullable": true, + "type": "string" + }, + "code": { + "type": "string" + }, + "enabled": { + "nullable": true, + "type": "boolean" + }, + "namePrimary": { + "type": "string" + }, + "nameSecondary": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "id", + "jwId", + "nameCn", + "nameEn", + "code", + "enabled", + "namePrimary", + "nameSecondary" + ], + "additionalProperties": false + }, + "_count": { + "type": "object", + "properties": { + "sections": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "sections" + ], + "additionalProperties": false } }, "required": [ @@ -18113,16 +18152,6 @@ "code", "nameCn", "nameEn", - "age", - "email", - "telephone", - "mobile", - "address", - "postcode", - "qq", - "wechat", - "departmentId", - "teacherTitleId", "namePrimary", "nameSecondary", "department" @@ -19094,12 +19123,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -19116,18 +19139,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -19155,14 +19166,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -19811,12 +19818,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -19833,18 +19834,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -19872,14 +19861,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -20540,12 +20525,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -20562,18 +20541,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -20601,14 +20568,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -22912,12 +22875,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -22934,18 +22891,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -22966,14 +22911,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId" ], @@ -23046,19 +22987,6 @@ ], "additionalProperties": false }, - "catalogLinkVisitRequestSchema": { - "type": "object", - "properties": { - "slug": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "slug" - ], - "additionalProperties": false - }, "sectionDetailSchema": { "type": "object", "properties": { @@ -23812,12 +23740,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -23834,18 +23756,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -23938,14 +23848,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "department", @@ -24034,12 +23940,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -24056,18 +23956,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -24088,14 +23976,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId" ], @@ -25040,12 +24924,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -25062,18 +24940,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -25101,14 +24967,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -25209,12 +25071,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -25231,18 +25087,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -25804,14 +25648,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "department", @@ -26135,7 +25975,8 @@ "enum": [ "not_found", "forbidden", - "locked" + "locked", + "suspended" ] }, "message": { @@ -27739,12 +27580,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -27761,18 +27596,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -27800,14 +27623,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -28438,12 +28257,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -28460,18 +28273,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -28499,14 +28300,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -29149,12 +28946,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -29171,18 +28962,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -29210,14 +28989,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -29886,12 +29661,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -29908,18 +29677,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -29947,14 +29704,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -30555,12 +30308,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -30577,18 +30324,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -30616,14 +30351,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -31224,12 +30955,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -31246,18 +30971,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -31285,14 +30998,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -31895,12 +31604,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -31917,18 +31620,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -31956,14 +31647,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", @@ -32693,12 +32380,6 @@ "nullable": true, "type": "string" }, - "age": { - "nullable": true, - "type": "integer", - "minimum": -9007199254740991, - "maximum": 9007199254740991 - }, "email": { "nullable": true, "type": "string" @@ -32715,18 +32396,6 @@ "nullable": true, "type": "string" }, - "postcode": { - "nullable": true, - "type": "string" - }, - "qq": { - "nullable": true, - "type": "string" - }, - "wechat": { - "nullable": true, - "type": "string" - }, "departmentId": { "nullable": true, "type": "integer", @@ -32754,14 +32423,10 @@ "code", "nameCn", "nameEn", - "age", "email", "telephone", "mobile", "address", - "postcode", - "qq", - "wechat", "departmentId", "teacherTitleId", "namePrimary", diff --git a/internal/cmd/apicmd/api_paths_gen.go b/internal/cmd/apicmd/api_paths_gen.go index 117f0c2..a65e443 100644 --- a/internal/cmd/apicmd/api_paths_gen.go +++ b/internal/cmd/apicmd/api_paths_gen.go @@ -60,6 +60,7 @@ var generatedAPIPaths = []string{ "/api/mcp/.well-known/oauth-authorization-server", "/api/mcp/.well-known/openid-configuration", "/api/openapi", + "/api/search", "/api/workspace/bus-preferences", "/api/workspace/homeworks", "/api/workspace/homeworks/completions", diff --git a/internal/cmd/todo/todo.go b/internal/cmd/todo/todo.go index e70f29d..2120b8f 100644 --- a/internal/cmd/todo/todo.go +++ b/internal/cmd/todo/todo.go @@ -76,11 +76,11 @@ func runTodoList(cmd *cobra.Command, opts todoListOpts) error { return fmt.Errorf("--done and --pending cannot be used together") } if opts.done { - v := openapi.True + v := openapi.ListTodosParamsCompletedTrue params.Completed = &v } if opts.pending { - v := openapi.False + v := openapi.ListTodosParamsCompletedFalse params.Completed = &v } if opts.priority != "" { @@ -294,11 +294,11 @@ func fetchTodoPickList(cmd *cobra.Command, opts todoListOpts) ([]map[string]any, } params := &openapi.ListTodosParams{} if opts.done { - v := openapi.True + v := openapi.ListTodosParamsCompletedTrue params.Completed = &v } if opts.pending { - v := openapi.False + v := openapi.ListTodosParamsCompletedFalse params.Completed = &v } data, err := api.ParseResponseRaw(c.ListTodos(api.Ctx(), params)) diff --git a/internal/openapi/client.gen.go b/internal/openapi/client.gen.go index 376d440..156de51 100644 --- a/internal/openapi/client.gen.go +++ b/internal/openapi/client.gen.go @@ -472,6 +472,7 @@ const ( CommentBatchDeleteResponseSchemaResults1ErrorCodeForbidden CommentBatchDeleteResponseSchemaResults1ErrorCode = "forbidden" CommentBatchDeleteResponseSchemaResults1ErrorCodeLocked CommentBatchDeleteResponseSchemaResults1ErrorCode = "locked" CommentBatchDeleteResponseSchemaResults1ErrorCodeNotFound CommentBatchDeleteResponseSchemaResults1ErrorCode = "not_found" + CommentBatchDeleteResponseSchemaResults1ErrorCodeSuspended CommentBatchDeleteResponseSchemaResults1ErrorCode = "suspended" ) // Valid indicates whether the value is a known member of the CommentBatchDeleteResponseSchemaResults1ErrorCode enum. @@ -483,6 +484,8 @@ func (e CommentBatchDeleteResponseSchemaResults1ErrorCode) Valid() bool { return true case CommentBatchDeleteResponseSchemaResults1ErrorCodeNotFound: return true + case CommentBatchDeleteResponseSchemaResults1ErrorCodeSuspended: + return true default: return false } @@ -1523,6 +1526,60 @@ func (e GetSectionParamsLocale) Valid() bool { } } +// Defines values for GetSectionParamsIncludeExams. +const ( + GetSectionParamsIncludeExamsFalse GetSectionParamsIncludeExams = "false" + GetSectionParamsIncludeExamsTrue GetSectionParamsIncludeExams = "true" +) + +// Valid indicates whether the value is a known member of the GetSectionParamsIncludeExams enum. +func (e GetSectionParamsIncludeExams) Valid() bool { + switch e { + case GetSectionParamsIncludeExamsFalse: + return true + case GetSectionParamsIncludeExamsTrue: + return true + default: + return false + } +} + +// Defines values for GetSectionParamsIncludeSchedules. +const ( + GetSectionParamsIncludeSchedulesFalse GetSectionParamsIncludeSchedules = "false" + GetSectionParamsIncludeSchedulesTrue GetSectionParamsIncludeSchedules = "true" +) + +// Valid indicates whether the value is a known member of the GetSectionParamsIncludeSchedules enum. +func (e GetSectionParamsIncludeSchedules) Valid() bool { + switch e { + case GetSectionParamsIncludeSchedulesFalse: + return true + case GetSectionParamsIncludeSchedulesTrue: + return true + default: + return false + } +} + +// Defines values for GetSectionParamsIncludeTeacherDepartments. +const ( + GetSectionParamsIncludeTeacherDepartmentsFalse GetSectionParamsIncludeTeacherDepartments = "false" + GetSectionParamsIncludeTeacherDepartmentsTrue GetSectionParamsIncludeTeacherDepartments = "true" +) + +// Valid indicates whether the value is a known member of the GetSectionParamsIncludeTeacherDepartments enum. +func (e GetSectionParamsIncludeTeacherDepartments) Valid() bool { + switch e { + case GetSectionParamsIncludeTeacherDepartmentsFalse: + return true + case GetSectionParamsIncludeTeacherDepartmentsTrue: + return true + default: + return false + } +} + // Defines values for GetSectionScheduleGroupsParamsLocale. const ( GetSectionScheduleGroupsParamsLocaleEnUs GetSectionScheduleGroupsParamsLocale = "en-us" @@ -1738,16 +1795,16 @@ func (e WorkspaceScheduleListParamsLocale) Valid() bool { // Defines values for ListTodosParamsCompleted. const ( - False ListTodosParamsCompleted = "false" - True ListTodosParamsCompleted = "true" + ListTodosParamsCompletedFalse ListTodosParamsCompleted = "false" + ListTodosParamsCompletedTrue ListTodosParamsCompleted = "true" ) // Valid indicates whether the value is a known member of the ListTodosParamsCompleted enum. func (e ListTodosParamsCompleted) Valid() bool { switch e { - case False: + case ListTodosParamsCompletedFalse: return true - case True: + case ListTodosParamsCompletedTrue: return true default: return false @@ -2657,7 +2714,6 @@ type CalendarSubscriptionAppendResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -2668,12 +2724,9 @@ type CalendarSubscriptionAppendResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -2812,7 +2865,6 @@ type CalendarSubscriptionBatchResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -2823,12 +2875,9 @@ type CalendarSubscriptionBatchResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -2943,7 +2992,6 @@ type CalendarSubscriptionBatchResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -2954,12 +3002,9 @@ type CalendarSubscriptionBatchResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3088,7 +3133,6 @@ type CalendarSubscriptionCreateResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -3099,12 +3143,9 @@ type CalendarSubscriptionCreateResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3217,7 +3258,6 @@ type CalendarSubscriptionImportResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -3228,12 +3268,9 @@ type CalendarSubscriptionImportResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3340,7 +3377,6 @@ type CalendarSubscriptionImportResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -3351,12 +3387,9 @@ type CalendarSubscriptionImportResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3464,7 +3497,6 @@ type CalendarSubscriptionImportResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -3475,12 +3507,9 @@ type CalendarSubscriptionImportResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3595,7 +3624,6 @@ type CalendarSubscriptionImportResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -3606,12 +3634,9 @@ type CalendarSubscriptionImportResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3745,7 +3770,6 @@ type CalendarSubscriptionQueryResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -3756,12 +3780,9 @@ type CalendarSubscriptionQueryResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3889,7 +3910,6 @@ type CalendarSubscriptionRemoveResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -3900,12 +3920,9 @@ type CalendarSubscriptionRemoveResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -3943,11 +3960,6 @@ type CatalogLinkListResponseSchemaLinksIcon string // CatalogLinkListResponseSchemaLinksLocale defines model for CatalogLinkListResponseSchema.Links.Locale. type CatalogLinkListResponseSchemaLinksLocale string -// CatalogLinkVisitRequestSchema defines model for catalogLinkVisitRequestSchema. -type CatalogLinkVisitRequestSchema struct { - Slug string `json:"slug"` -} - // CommentBatchDeleteRequestSchema defines model for commentBatchDeleteRequestSchema. type CommentBatchDeleteRequestSchema struct { Ids []string `json:"ids"` @@ -4546,8 +4558,9 @@ type CompactOverviewResponseSchema struct { StartTime string `json:"startTime"` StartUnit int `json:"startUnit"` Teachers []struct { - Address *string `json:"address"` - Age *int `json:"age"` + UnderscoreCount *struct { + Sections int `json:"sections"` + } `json:"_count,omitempty"` Code *string `json:"code"` Department *struct { Code string `json:"code"` @@ -4558,21 +4571,23 @@ type CompactOverviewResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` } `json:"department"` - DepartmentId *int `json:"departmentId"` - Email *string `json:"email"` - Id int `json:"id"` - Mobile *string `json:"mobile"` - NameCn string `json:"nameCn"` - NameEn *string `json:"nameEn"` - NamePrimary string `json:"namePrimary"` - NameSecondary *string `json:"nameSecondary"` - PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` - TeacherId *int `json:"teacherId"` - TeacherTitleId *int `json:"teacherTitleId"` - Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` + Id int `json:"id"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + PersonId *int `json:"personId"` + TeacherId *int `json:"teacherId"` + TeacherTitle *struct { + Code string `json:"code"` + Enabled *bool `json:"enabled"` + Id int `json:"id"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + } `json:"teacherTitle,omitempty"` } `json:"teachers"` WeekIndex int `json:"weekIndex"` Weekday int `json:"weekday"` @@ -4691,7 +4706,6 @@ type CourseDetailSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -4700,12 +4714,9 @@ type CourseDetailSchema struct { NameCn string `json:"nameCn"` NameEn *string `json:"nameEn"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -4825,7 +4836,6 @@ type CurrentCalendarSubscriptionResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -4836,12 +4846,9 @@ type CurrentCalendarSubscriptionResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -5719,7 +5726,6 @@ type MatchSectionCodesResponseSchema struct { TeachLanguageId *int `json:"teachLanguageId"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -5730,12 +5736,9 @@ type MatchSectionCodesResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -6094,8 +6097,9 @@ type PaginatedScheduleResponseSchema struct { StartTime string `json:"startTime"` StartUnit int `json:"startUnit"` Teachers []struct { - Address *string `json:"address"` - Age *int `json:"age"` + UnderscoreCount *struct { + Sections int `json:"sections"` + } `json:"_count,omitempty"` Code *string `json:"code"` Department *struct { Code string `json:"code"` @@ -6106,21 +6110,23 @@ type PaginatedScheduleResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` } `json:"department"` - DepartmentId *int `json:"departmentId"` - Email *string `json:"email"` - Id int `json:"id"` - Mobile *string `json:"mobile"` - NameCn string `json:"nameCn"` - NameEn *string `json:"nameEn"` - NamePrimary string `json:"namePrimary"` - NameSecondary *string `json:"nameSecondary"` - PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` - TeacherId *int `json:"teacherId"` - TeacherTitleId *int `json:"teacherTitleId"` - Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` + Id int `json:"id"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + PersonId *int `json:"personId"` + TeacherId *int `json:"teacherId"` + TeacherTitle *struct { + Code string `json:"code"` + Enabled *bool `json:"enabled"` + Id int `json:"id"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + } `json:"teacherTitle,omitempty"` } `json:"teachers"` WeekIndex int `json:"weekIndex"` Weekday int `json:"weekday"` @@ -6201,7 +6207,6 @@ type PaginatedTeacherResponseSchema struct { Sections int `json:"sections"` } `json:"_count"` Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` Department *struct { Code string `json:"code"` @@ -6217,8 +6222,6 @@ type PaginatedTeacherResponseSchema struct { NameCn string `json:"nameCn"` NameEn *string `json:"nameEn"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitle *struct { Code string `json:"code"` @@ -6230,7 +6233,6 @@ type PaginatedTeacherResponseSchema struct { } `json:"teacherTitle"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"data"` Pagination struct { Page int `json:"page"` @@ -6444,7 +6446,6 @@ type SectionDetailSchema struct { SectionId int `json:"sectionId"` Teacher struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` DepartmentId *int `json:"departmentId"` Email *string `json:"email"` @@ -6453,12 +6454,9 @@ type SectionDetailSchema struct { NameCn string `json:"nameCn"` NameEn *string `json:"nameEn"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teacher"` TeacherId int `json:"teacherId"` TeacherLessonType *struct { @@ -6476,7 +6474,6 @@ type SectionDetailSchema struct { } `json:"teacherAssignments"` Teachers []struct { Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` Department *struct { Code string `json:"code"` @@ -6492,8 +6489,6 @@ type SectionDetailSchema struct { NameCn string `json:"nameCn"` NameEn *string `json:"nameEn"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` TeacherId *int `json:"teacherId"` TeacherTitle *struct { Code string `json:"code"` @@ -6505,7 +6500,6 @@ type SectionDetailSchema struct { } `json:"teacherTitle"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } `json:"teachers"` TestPeriods *float32 `json:"testPeriods"` TheoryPeriods *float32 `json:"theoryPeriods"` @@ -6785,8 +6779,9 @@ type SubscribedSchedulesResponseSchema struct { StartTime string `json:"startTime"` StartUnit int `json:"startUnit"` Teachers []struct { - Address *string `json:"address"` - Age *int `json:"age"` + UnderscoreCount *struct { + Sections int `json:"sections"` + } `json:"_count,omitempty"` Code *string `json:"code"` Department *struct { Code string `json:"code"` @@ -6797,21 +6792,23 @@ type SubscribedSchedulesResponseSchema struct { NamePrimary string `json:"namePrimary"` NameSecondary *string `json:"nameSecondary"` } `json:"department"` - DepartmentId *int `json:"departmentId"` - Email *string `json:"email"` - Id int `json:"id"` - Mobile *string `json:"mobile"` - NameCn string `json:"nameCn"` - NameEn *string `json:"nameEn"` - NamePrimary string `json:"namePrimary"` - NameSecondary *string `json:"nameSecondary"` - PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` - TeacherId *int `json:"teacherId"` - TeacherTitleId *int `json:"teacherTitleId"` - Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` + Id int `json:"id"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + PersonId *int `json:"personId"` + TeacherId *int `json:"teacherId"` + TeacherTitle *struct { + Code string `json:"code"` + Enabled *bool `json:"enabled"` + Id int `json:"id"` + JwId int `json:"jwId"` + NameCn string `json:"nameCn"` + NameEn *string `json:"nameEn"` + NamePrimary string `json:"namePrimary"` + NameSecondary *string `json:"nameSecondary"` + } `json:"teacherTitle,omitempty"` } `json:"teachers"` WeekIndex int `json:"weekIndex"` Weekday int `json:"weekday"` @@ -6829,7 +6826,6 @@ type TeacherDetailSchema struct { Sections int `json:"sections"` } `json:"_count"` Address *string `json:"address"` - Age *int `json:"age"` Code *string `json:"code"` Department *struct { Code string `json:"code"` @@ -6845,8 +6841,6 @@ type TeacherDetailSchema struct { NameCn string `json:"nameCn"` NameEn *string `json:"nameEn"` PersonId *int `json:"personId"` - Postcode *string `json:"postcode"` - Qq *string `json:"qq"` Sections []struct { ActualPeriods *int `json:"actualPeriods"` BizTypeId *int `json:"bizTypeId"` @@ -6940,7 +6934,6 @@ type TeacherDetailSchema struct { } `json:"teacherTitle"` TeacherTitleId *int `json:"teacherTitleId"` Telephone *string `json:"telephone"` - Wechat *string `json:"wechat"` } // TodoBatchDeleteRequestSchema defines model for todoBatchDeleteRequestSchema. @@ -7435,12 +7428,24 @@ type GetSectionsCalendarParams struct { // GetSectionParams defines parameters for GetSection. type GetSectionParams struct { - Locale *GetSectionParamsLocale `form:"locale,omitempty" json:"locale,omitempty"` + Locale *GetSectionParamsLocale `form:"locale,omitempty" json:"locale,omitempty"` + IncludeExams *GetSectionParamsIncludeExams `form:"includeExams,omitempty" json:"includeExams,omitempty"` + IncludeSchedules *GetSectionParamsIncludeSchedules `form:"includeSchedules,omitempty" json:"includeSchedules,omitempty"` + IncludeTeacherDepartments *GetSectionParamsIncludeTeacherDepartments `form:"includeTeacherDepartments,omitempty" json:"includeTeacherDepartments,omitempty"` } // GetSectionParamsLocale defines parameters for GetSection. type GetSectionParamsLocale string +// GetSectionParamsIncludeExams defines parameters for GetSection. +type GetSectionParamsIncludeExams string + +// GetSectionParamsIncludeSchedules defines parameters for GetSection. +type GetSectionParamsIncludeSchedules string + +// GetSectionParamsIncludeTeacherDepartments defines parameters for GetSection. +type GetSectionParamsIncludeTeacherDepartments string + // GetSectionScheduleGroupsParams defines parameters for GetSectionScheduleGroups. type GetSectionScheduleGroupsParams struct { Locale *GetSectionScheduleGroupsParamsLocale `form:"locale,omitempty" json:"locale,omitempty"` @@ -7619,9 +7624,6 @@ type CreateAdminSuspensionJSONRequestBody = AdminCreateSuspensionRequestSchema // UpdateAdminUserJSONRequestBody defines body for UpdateAdminUser for application/json ContentType. type UpdateAdminUserJSONRequestBody = AdminUpdateUserRequestSchema -// CatalogLinkVisitRecordFormdataRequestBody defines body for CatalogLinkVisitRecord for application/x-www-form-urlencoded ContentType. -type CatalogLinkVisitRecordFormdataRequestBody = CatalogLinkVisitRequestSchema - // MatchSectionCodesJSONRequestBody defines body for MatchSectionCodes for application/json ContentType. type MatchSectionCodesJSONRequestBody = MatchSectionCodesRequestSchema @@ -10606,11 +10608,6 @@ type ClientInterface interface { // CatalogLinkResolve request CatalogLinkResolve(ctx context.Context, params *CatalogLinkResolveParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // CatalogLinkVisitRecordWithBody request with any body - CatalogLinkVisitRecordWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CatalogLinkVisitRecordWithFormdataBody(ctx context.Context, body CatalogLinkVisitRecordFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetMetadata request GetMetadata(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -11153,30 +11150,6 @@ func (c *Client) CatalogLinkResolve(ctx context.Context, params *CatalogLinkReso return c.Client.Do(req) } -func (c *Client) CatalogLinkVisitRecordWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCatalogLinkVisitRecordRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CatalogLinkVisitRecordWithFormdataBody(ctx context.Context, body CatalogLinkVisitRecordFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCatalogLinkVisitRecordRequestWithFormdataBody(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - func (c *Client) GetMetadata(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetMetadataRequest(c.Server) if err != nil { @@ -13598,46 +13571,6 @@ func NewCatalogLinkResolveRequest(server string, params *CatalogLinkResolveParam return req, nil } -// NewCatalogLinkVisitRecordRequestWithFormdataBody calls the generic CatalogLinkVisitRecord builder with application/x-www-form-urlencoded body -func NewCatalogLinkVisitRecordRequestWithFormdataBody(server string, body CatalogLinkVisitRecordFormdataRequestBody) (*http.Request, error) { - var bodyReader io.Reader - bodyStr, err := runtime.MarshalForm(body, nil) - if err != nil { - return nil, err - } - bodyReader = strings.NewReader(bodyStr.Encode()) - return NewCatalogLinkVisitRecordRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) -} - -// NewCatalogLinkVisitRecordRequestWithBody generates requests for CatalogLinkVisitRecord with any type of body -func NewCatalogLinkVisitRecordRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/catalog/links/resolve") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - // NewGetMetadataRequest generates requests for GetMetadata func NewGetMetadataRequest(server string) (*http.Request, error) { var err error @@ -14325,6 +14258,54 @@ func NewGetSectionRequest(server string, jwId int64, params *GetSectionParams) ( } + if params.IncludeExams != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeExams", *params.IncludeExams, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.IncludeSchedules != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeSchedules", *params.IncludeSchedules, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.IncludeTeacherDepartments != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeTeacherDepartments", *params.IncludeTeacherDepartments, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -17284,11 +17265,6 @@ type ClientWithResponsesInterface interface { // CatalogLinkResolveWithResponse request CatalogLinkResolveWithResponse(ctx context.Context, params *CatalogLinkResolveParams, reqEditors ...RequestEditorFn) (*CatalogLinkResolveResponse, error) - // CatalogLinkVisitRecordWithBodyWithResponse request with any body - CatalogLinkVisitRecordWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CatalogLinkVisitRecordResponse, error) - - CatalogLinkVisitRecordWithFormdataBodyWithResponse(ctx context.Context, body CatalogLinkVisitRecordFormdataRequestBody, reqEditors ...RequestEditorFn) (*CatalogLinkVisitRecordResponse, error) - // GetMetadataWithResponse request GetMetadataWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetadataResponse, error) @@ -18037,27 +18013,6 @@ func (r CatalogLinkResolveResponse) StatusCode() int { return 0 } -type CatalogLinkVisitRecordResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r CatalogLinkVisitRecordResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CatalogLinkVisitRecordResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - type GetMetadataResponse struct { Body []byte HTTPResponse *http.Response @@ -19779,23 +19734,6 @@ func (c *ClientWithResponses) CatalogLinkResolveWithResponse(ctx context.Context return ParseCatalogLinkResolveResponse(rsp) } -// CatalogLinkVisitRecordWithBodyWithResponse request with arbitrary body returning *CatalogLinkVisitRecordResponse -func (c *ClientWithResponses) CatalogLinkVisitRecordWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CatalogLinkVisitRecordResponse, error) { - rsp, err := c.CatalogLinkVisitRecordWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCatalogLinkVisitRecordResponse(rsp) -} - -func (c *ClientWithResponses) CatalogLinkVisitRecordWithFormdataBodyWithResponse(ctx context.Context, body CatalogLinkVisitRecordFormdataRequestBody, reqEditors ...RequestEditorFn) (*CatalogLinkVisitRecordResponse, error) { - rsp, err := c.CatalogLinkVisitRecordWithFormdataBody(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCatalogLinkVisitRecordResponse(rsp) -} - // GetMetadataWithResponse request returning *GetMetadataResponse func (c *ClientWithResponses) GetMetadataWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetadataResponse, error) { rsp, err := c.GetMetadata(ctx, reqEditors...) @@ -21470,22 +21408,6 @@ func ParseCatalogLinkResolveResponse(rsp *http.Response) (*CatalogLinkResolveRes return response, nil } -// ParseCatalogLinkVisitRecordResponse parses an HTTP response from a CatalogLinkVisitRecordWithResponse call -func ParseCatalogLinkVisitRecordResponse(rsp *http.Response) (*CatalogLinkVisitRecordResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CatalogLinkVisitRecordResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - // ParseGetMetadataResponse parses an HTTP response from a GetMetadataWithResponse call func ParseGetMetadataResponse(rsp *http.Response) (*GetMetadataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body)