From 1d4bf52d0539e761a62564fbc7102337b70327f5 Mon Sep 17 00:00:00 2001 From: En Date: Thu, 19 Mar 2026 09:34:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=80=89=E6=8B=A9=E5=A5=97=E9=A4=90=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=20NaN=20=E5=85=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题原因: - 租户管理页面调用 /api/v1/admin/packages/all 获取课程包 - 但 CoursePackage 实体没有 price 和 discountPrice 字段 - 这些字段在 CourseCollection(课程套餐)实体中 后端修改: - AdminCourseCollectionController 新增 GET /all 接口 - 返回已发布的课程套餐列表(含价格信息) - 添加 @Slf4j 注解和必要导入 前端修改: - src/api/admin.ts 修改 API 调用路径为 /collections/all - 修改返回类型为 CourseCollectionResponse[] - TenantListView.vue 修改 packageList 类型 - 修复 formatPackagePrice 处理 undefined 值 - 修复 handlePackageTypeChange 类型检查 数据库迁移: - 添加 V38 脚本为 course_collection 表添加自增主键 其他修改: - .gitignore 移除 *.sql 排除规则(允许迁移脚本) - CourseCollectionRejectRequest 和 CourseRejectRequest 用于审核驳回 修复的 TypeScript 错误: - formatPackagePrice 参数改为可选类型 - selectedPackage.name 添加可选链操作符 --- .claude/CLAUDE.md | 86 ++ .claude/settings.local.json | 7 + .gitignore | 1 - reading-platform-frontend/openapi.json | 931 ++++++++---------- reading-platform-frontend/orval.config.ts | 5 +- reading-platform-frontend/src/api/admin.ts | 5 +- reading-platform-frontend/src/api/course.ts | 31 +- reading-platform-frontend/src/api/file.ts | 18 +- .../src/api/generated/index.ts | 736 +++++++------- .../model/courseCollectionRejectRequest.ts | 15 + .../generated/model/courseRejectRequest.ts | 15 + .../src/api/generated/model/index.ts | 2 + .../generated/model/tenantCreateRequest.ts | 2 + .../src/api/generated/mutator.ts | 2 +- reading-platform-frontend/src/api/package.ts | 292 ++++-- reading-platform-frontend/src/api/school.ts | 36 +- .../admin/collections/CollectionEditView.vue | 258 ++++- .../admin/packages/PackageDetailView.vue | 77 +- .../views/admin/packages/PackageEditView.vue | 146 +-- .../views/admin/packages/PackageListView.vue | 45 +- .../admin/packages/PackageReviewView.vue | 95 +- .../views/admin/tenants/TenantListView.vue | 15 +- .../src/views/school/PackageView.vue | 17 +- .../AdminCourseCollectionController.java | 45 +- .../admin/AdminCourseController.java | 31 + .../CourseCollectionRejectRequest.java | 15 + .../dto/request/CourseRejectRequest.java | 17 + .../platform/dto/response/ThemeResponse.java | 4 + .../service/CourseCollectionService.java | 51 +- .../service/CoursePackageService.java | 5 + .../impl/CoursePackageServiceImpl.java | 10 + ...dd_auto_increment_to_course_collection.sql | 5 + restart-frontend.sh | 13 + 33 files changed, 1847 insertions(+), 1186 deletions(-) create mode 100644 .claude/settings.local.json create mode 100644 reading-platform-frontend/src/api/generated/model/courseCollectionRejectRequest.ts create mode 100644 reading-platform-frontend/src/api/generated/model/courseRejectRequest.ts create mode 100644 reading-platform-java/src/main/java/com/reading/platform/dto/request/CourseCollectionRejectRequest.java create mode 100644 reading-platform-java/src/main/java/com/reading/platform/dto/request/CourseRejectRequest.java create mode 100644 reading-platform-java/src/main/resources/db/migration/V38__add_auto_increment_to_course_collection.sql create mode 100644 restart-frontend.sh diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 9d46624..40ccda0 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -753,3 +753,89 @@ npm run test:e2e:ui *本规范最后更新于 2026-03-18* *技术栈:统一使用 Spring Boot (Java) 后端* *JDK 版本:17(必须)* + +--- + +## 套餐管理重构记录(2026-03-18) + +### 后端架构(两层结构) + +``` +CourseCollection(课程套餐) ← 超管端管理 + ↓ 1 对多 +CourseCollectionPackage(关联表) + ↓ 多对 1 +CoursePackage(课程包) ← 7 步流程创建的教学资源 + ↓ 1 对多 +CourseLesson(课程环节) +``` + +### 后端 API 路径 + +**超管端套餐管理(CourseCollection)**: +- `GET /api/v1/admin/collections` - 分页查询套餐 +- `GET /api/v1/admin/collections/{id}` - 套餐详情 +- `POST /api/v1/admin/collections` - 创建套餐 +- `PUT /api/v1/admin/collections/{id}` - 更新套餐 +- `DELETE /api/v1/admin/collections/{id}` - 删除套餐 +- `PUT /api/v1/admin/collections/{id}/packages` - 设置套餐包含的课程包 +- `POST /api/v1/admin/collections/{id}/publish` - 发布套餐 +- `POST /api/v1/admin/collections/{id}/archive` - 下架套餐 + +**超管端课程包管理(CoursePackage)**: +- `GET /api/v1/admin/packages` - 分页查询课程包 +- `GET /api/v1/admin/packages/{id}` - 课程包详情 +- `POST /api/v1/admin/packages` - 创建课程包 +- `PUT /api/v1/admin/packages/{id}` - 更新课程包 +- `DELETE /api/v1/admin/packages/{id}` - 删除课程包 +- `POST /api/v1/admin/packages/{id}/publish` - 发布课程包 + +**学校端套餐查询**: +- `GET /api/v1/school/packages` - 获取学校已授权的套餐列表 +- `GET /api/v1/school/packages/{collectionId}/packages` - 获取套餐下的课程包 +- `GET /api/v1/school/packages/{packageId}/courses` - 获取课程包下的课程环节 + +### 前端类型映射 + +| 前端类型 | 后端 DTO | 说明 | +|---------|---------|------| +| `CourseCollection` | `CourseCollectionResponse` | 课程套餐(最上层) | +| `CoursePackageItem` | `CourseCollectionResponse.CoursePackageItem` | 套餐中的课程包项 | +| `CoursePackage` | `CoursePackageResponse` | 课程包(7 步创建的教学资源) | + +### 前端 API 文件 + +| 文件 | 用途 | +|-----|------| +| `src/api/package.ts` | 超管端套餐管理 API + 课程包管理 API | +| `src/api/course.ts` | 课程包(CoursePackage)相关 API | +| `src/api/school.ts` | 学校端套餐查询 API | + +### 注意事项 + +1. **后端 `CoursePackage` = 课程包**:通过 7 步流程创建的教学资源,包含教案、活动、PPT 等 +2. **后端 `CourseCollection` = 课程套餐**:包含多个课程包,有价格、状态、审核流程 +3. **前端 `package.ts`**:主要定义课程套餐(CourseCollection)相关的 API 和类型 +4. **前端 `course.ts`**:主要定义课程包(CoursePackage)相关的 API 和类型 +5. **ID 类型**:所有 ID 使用 `number | string` 类型,避免后端 Long 序列化后精度丢失 + +### 前端修复记录(2026-03-18) + +| 文件 | 修复内容 | +|-----|---------| +| `PackageDetailView.vue` | 编辑按钮显示条件扩展:`DRAFT` → `DRAFT \|\| REJECTED`,驳回后可重新编辑 | +| `PackageEditView.vue` | `createCollection` 已正确使用 POST 请求 ✅ | +| `src/api/package.ts` | `createCollection` 使用 `http.post` ✅ | + +### 套餐状态流转 + +``` +DRAFT(草稿)→ 提交审核 → PENDING(待审核)→ 审核通过 → APPROVED(已通过)→ 发布 → PUBLISHED(已发布) + ↓ ↓ + 驳回 ← REJECTED(已拒绝) 下架 → OFFLINE(已下架) +``` + +- **DRAFT/REJECTED**: 可编辑、可提交审核 +- **APPROVED**: 可发布 +- **PUBLISHED**: 可下架 +- **OFFLINE**: 终止状态 diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..963cb33 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "Bash(mvn compile:*)" + ] + } +} diff --git a/.gitignore b/.gitignore index 30c3893..b09f9b1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ Thumbs.db # === 备份文件 === backups/ -*.sql *.db # === IDE 和编辑器 === diff --git a/reading-platform-frontend/openapi.json b/reading-platform-frontend/openapi.json index af5c98f..571910f 100644 --- a/reading-platform-frontend/openapi.json +++ b/reading-platform-frontend/openapi.json @@ -22,12 +22,8 @@ ], "tags": [ { - "name": "教师端 - 任务模板", - "description": "Teacher Task Template APIs" - }, - { - "name": "教师端 - 反馈管理", - "description": "Teacher Feedback APIs" + "name": "教师端 - 课时管理", + "description": "教师端课时 API" }, { "name": "School - Task", @@ -45,6 +41,10 @@ "name": "学校端 - 操作日志", "description": "School Operation Log APIs" }, + { + "name": "教师端 - 反馈管理", + "description": "教师端反馈 API" + }, { "name": "School - Parent", "description": "Parent Management APIs for School" @@ -53,17 +53,17 @@ "name": "Parent - Child", "description": "Child Information APIs for Parent" }, - { - "name": "Teacher - Task", - "description": "Task APIs for Teacher" - }, { "name": "学校端 - 排课管理", "description": "School Schedule APIs" }, { - "name": "数据修复", - "description": "临时数据修复接口" + "name": "教师端 - 任务模板", + "description": "教师端任务模板 API" + }, + { + "name": "教师端 - 任务管理", + "description": "教师端任务 API" }, { "name": "阿里云 IMM 服务", @@ -74,8 +74,12 @@ "description": "School Feedback APIs" }, { - "name": "Teacher - Notification", - "description": "Notification APIs for Teacher" + "name": "教师端 - 排课管理", + "description": "教师端排课 API" + }, + { + "name": "教师端 - 课程管理", + "description": "教师端课程 API" }, { "name": "School - Student", @@ -85,6 +89,14 @@ "name": "School - Class", "description": "Class Management APIs for School" }, + { + "name": "教师端 - 成长记录", + "description": "教师端成长记录 API" + }, + { + "name": "教师端 - 通知管理", + "description": "教师端通知 API" + }, { "name": "Parent - Growth Record", "description": "Growth Record APIs for Parent" @@ -93,14 +105,14 @@ "name": "学校端 - 数据报告", "description": "School Report APIs" }, - { - "name": "Teacher - Course", - "description": "Course APIs for Teacher" - }, { "name": "学校端 - 数据导出", "description": "School Export APIs" }, + { + "name": "教师端 - 统计数据", + "description": "教师端统计数据 API" + }, { "name": "School - Teacher", "description": "Teacher Management APIs for School" @@ -109,10 +121,6 @@ "name": "认证管理", "description": "Authentication APIs" }, - { - "name": "教师端 - 排课管理", - "description": "Teacher Schedule APIs" - }, { "name": "超管端 - 租户管理", "description": "Tenant Management APIs for Admin" @@ -121,18 +129,10 @@ "name": "学校端 - 任务模板", "description": "School Task Template APIs" }, - { - "name": "Teacher - Growth Record", - "description": "Growth Record APIs for Teacher" - }, { "name": "学校端 - 系统设置", "description": "School Settings APIs" }, - { - "name": "Teacher - Lesson", - "description": "Lesson APIs for Teacher" - }, { "name": "School - Growth Record", "description": "Growth Record Management APIs for School" @@ -146,9 +146,9 @@ "/api/v1/teacher/tasks/{id}": { "get": { "tags": [ - "Teacher - Task" + "教师端 - 任务管理" ], - "summary": "Get task by ID", + "summary": "根据 ID 获取任务", "operationId": "getTask", "parameters": [ { @@ -236,9 +236,9 @@ }, "put": { "tags": [ - "Teacher - Task" + "教师端 - 任务管理" ], - "summary": "Update task", + "summary": "更新任务", "operationId": "updateTask", "parameters": [ { @@ -336,9 +336,9 @@ }, "delete": { "tags": [ - "Teacher - Task" + "教师端 - 任务管理" ], - "summary": "Delete task", + "summary": "删除任务", "operationId": "deleteTask", "parameters": [ { @@ -992,9 +992,9 @@ "/api/v1/teacher/lessons/{id}": { "get": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Get lesson by ID(含课程、班级,供上课页面使用)", + "summary": "根据 ID 获取课时(含课程、班级,供上课页面使用)", "operationId": "getLesson", "parameters": [ { @@ -1082,9 +1082,9 @@ }, "put": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Update lesson", + "summary": "更新课时", "operationId": "updateLesson", "parameters": [ { @@ -1184,9 +1184,9 @@ "/api/v1/teacher/lessons/{id}/progress": { "get": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Get lesson progress", + "summary": "获取课时进度", "operationId": "getLessonProgress", "parameters": [ { @@ -1274,9 +1274,9 @@ }, "put": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Save lesson progress", + "summary": "保存课时进度", "operationId": "saveLessonProgress", "parameters": [ { @@ -1376,9 +1376,9 @@ "/api/v1/teacher/growth-records/{id}": { "get": { "tags": [ - "Teacher - Growth Record" + "教师端 - 成长记录" ], - "summary": "Get growth record by ID", + "summary": "根据 ID 获取成长记录", "operationId": "getGrowthRecord", "parameters": [ { @@ -1466,9 +1466,9 @@ }, "put": { "tags": [ - "Teacher - Growth Record" + "教师端 - 成长记录" ], - "summary": "Update growth record", + "summary": "更新成长记录", "operationId": "updateGrowthRecord", "parameters": [ { @@ -1566,9 +1566,9 @@ }, "delete": { "tags": [ - "Teacher - Growth Record" + "教师端 - 成长记录" ], - "summary": "Delete growth record", + "summary": "删除成长记录", "operationId": "deleteGrowthRecord", "parameters": [ { @@ -8788,9 +8788,9 @@ "/api/v1/teacher/tasks": { "get": { "tags": [ - "Teacher - Task" + "教师端 - 任务管理" ], - "summary": "Get task page", + "summary": "获取任务分页列表", "operationId": "getTaskPage", "parameters": [ { @@ -8913,9 +8913,9 @@ }, "post": { "tags": [ - "Teacher - Task" + "教师端 - 任务管理" ], - "summary": "Create task", + "summary": "创建任务", "operationId": "createTask", "requestBody": { "content": { @@ -9505,9 +9505,9 @@ "/api/v1/teacher/notifications/{id}/read": { "post": { "tags": [ - "Teacher - Notification" + "教师端 - 通知管理" ], - "summary": "Mark notification as read", + "summary": "标记通知为已读", "operationId": "markAsRead", "parameters": [ { @@ -9597,9 +9597,9 @@ "/api/v1/teacher/notifications/read-all": { "post": { "tags": [ - "Teacher - Notification" + "教师端 - 通知管理" ], - "summary": "Mark all notifications as read", + "summary": "标记所有通知为已读", "operationId": "markAllAsRead", "responses": { "200": { @@ -9678,9 +9678,9 @@ "/api/v1/teacher/lessons": { "get": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Get my lessons", + "summary": "获取我的课时列表", "operationId": "getMyLessons", "parameters": [ { @@ -9805,9 +9805,9 @@ }, "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Create lesson", + "summary": "创建课时", "operationId": "createLesson", "requestBody": { "content": { @@ -9896,9 +9896,9 @@ "/api/v1/teacher/lessons/{id}/students/{studentId}/record": { "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Save student record", + "summary": "保存学生记录", "operationId": "saveStudentRecord", "parameters": [ { @@ -10007,9 +10007,9 @@ "/api/v1/teacher/lessons/{id}/students/batch-records": { "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Batch save student records", + "summary": "批量保存学生记录", "operationId": "batchSaveStudentRecords", "parameters": [ { @@ -10112,9 +10112,9 @@ "/api/v1/teacher/lessons/{id}/start": { "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Start lesson", + "summary": "开始上课", "operationId": "startLesson", "parameters": [ { @@ -10204,9 +10204,9 @@ "/api/v1/teacher/lessons/{id}/feedback": { "get": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Get lesson feedback", + "summary": "获取课时反馈", "operationId": "getLessonFeedback", "parameters": [ { @@ -10294,9 +10294,9 @@ }, "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Submit lesson feedback", + "summary": "提交课时反馈", "operationId": "submitFeedback", "parameters": [ { @@ -10396,9 +10396,9 @@ "/api/v1/teacher/lessons/{id}/complete": { "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Complete lesson", + "summary": "完成课时", "operationId": "completeLesson", "parameters": [ { @@ -10488,9 +10488,9 @@ "/api/v1/teacher/lessons/{id}/cancel": { "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Cancel lesson", + "summary": "取消课时", "operationId": "cancelLesson", "parameters": [ { @@ -10580,9 +10580,9 @@ "/api/v1/teacher/lessons/from-schedule/{schedulePlanId}": { "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Create lesson from schedule", + "summary": "从排课创建课时", "operationId": "createLessonFromSchedule", "parameters": [ { @@ -10672,9 +10672,9 @@ "/api/v1/teacher/lessons/from-schedule/{schedulePlanId}/start": { "post": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Start lesson from schedule", + "summary": "从排课开始上课", "operationId": "startLessonFromSchedule", "parameters": [ { @@ -10764,9 +10764,9 @@ "/api/v1/teacher/growth-records": { "get": { "tags": [ - "Teacher - Growth Record" + "教师端 - 成长记录" ], - "summary": "Get growth record page", + "summary": "获取成长记录分页列表", "operationId": "getGrowthRecordPage", "parameters": [ { @@ -10882,9 +10882,9 @@ }, "post": { "tags": [ - "Teacher - Growth Record" + "教师端 - 成长记录" ], - "summary": "Create growth record", + "summary": "创建成长记录", "operationId": "createGrowthRecord", "requestBody": { "content": { @@ -14950,86 +14950,6 @@ } } }, - "/api/v1/admin/util/repair-flyway": { - "post": { - "tags": [ - "admin-util-controller" - ], - "operationId": "repairFlyway", - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultString" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - } - } - } - }, "/api/v1/admin/themes": { "get": { "tags": [ @@ -16198,6 +16118,200 @@ } } }, + "/api/v1/admin/packages/{id}/submit": { + "post": { + "tags": [ + "超管端 - 课程包管理" + ], + "summary": "提交课程包审核", + "operationId": "submitCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + } + } + } + }, + "/api/v1/admin/packages/{id}/reject": { + "post": { + "tags": [ + "超管端 - 课程包管理" + ], + "summary": "驳回课程包审核", + "operationId": "rejectCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CourseRejectRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + } + } + } + }, "/api/v1/admin/packages/{id}/publish": { "post": { "tags": [ @@ -16382,190 +16496,6 @@ } } }, - "/api/v1/admin/data-fix/fix-collection-packages": { - "post": { - "tags": [ - "数据修复" - ], - "summary": "修复套餐关联数据", - "description": "修复 packageCount 与实际关联数据不一致的问题", - "operationId": "fixCollectionPackages", - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultMapStringObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - } - } - } - }, - "/api/v1/admin/data-fix/add-package-to-collection": { - "post": { - "tags": [ - "数据修复" - ], - "summary": "添加课程包到套餐", - "description": "手动添加课程包关联", - "operationId": "addPackageToCollection", - "parameters": [ - { - "name": "collectionId", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "packageId", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultString" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - } - } - } - }, "/api/v1/admin/courses/{courseId}/lessons": { "get": { "tags": [ @@ -17240,6 +17170,98 @@ } } }, + "/api/v1/admin/collections/{id}/submit": { + "post": { + "tags": [ + "超管端 - 课程套餐管理" + ], + "summary": "提交审核", + "operationId": "submit", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "405": { + "description": "Method Not Allowed", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ResultVoid" + } + } + } + } + } + } + }, "/api/v1/admin/collections/{id}/republish": { "post": { "tags": [ @@ -17332,13 +17354,13 @@ } } }, - "/api/v1/admin/collections/{id}/publish": { + "/api/v1/admin/collections/{id}/reject": { "post": { "tags": [ "超管端 - 课程套餐管理" ], - "summary": "发布套餐", - "operationId": "publish", + "summary": "审核驳回", + "operationId": "reject", "parameters": [ { "name": "id", @@ -17350,6 +17372,16 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CourseCollectionRejectRequest" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", @@ -17424,13 +17456,13 @@ } } }, - "/api/v1/admin/collections/{id}/grant": { + "/api/v1/admin/collections/{id}/publish": { "post": { "tags": [ "超管端 - 课程套餐管理" ], - "summary": "授权课程套餐给租户", - "operationId": "grantToTenant", + "summary": "发布套餐", + "operationId": "publish", "parameters": [ { "name": "id", @@ -17442,16 +17474,6 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GrantCollectionRequest" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", @@ -17874,9 +17896,9 @@ "/api/v1/teacher/students": { "get": { "tags": [ - "Teacher - Course" + "教师端 - 课程管理" ], - "summary": "Get all students of teacher", + "summary": "获取教师教授的所有学生", "operationId": "getAllStudents", "parameters": [ { @@ -18248,9 +18270,9 @@ "/api/v1/teacher/notifications": { "get": { "tags": [ - "Teacher - Notification" + "教师端 - 通知管理" ], - "summary": "Get my notifications", + "summary": "获取我的通知列表", "operationId": "getMyNotifications", "parameters": [ { @@ -18360,9 +18382,9 @@ "/api/v1/teacher/notifications/{id}": { "get": { "tags": [ - "Teacher - Notification" + "教师端 - 通知管理" ], - "summary": "Get notification by ID", + "summary": "根据 ID 获取通知", "operationId": "getNotification", "parameters": [ { @@ -18452,9 +18474,9 @@ "/api/v1/teacher/notifications/unread-count": { "get": { "tags": [ - "Teacher - Notification" + "教师端 - 通知管理" ], - "summary": "Get unread count", + "summary": "获取未读数量", "operationId": "getUnreadCount", "responses": { "200": { @@ -18533,9 +18555,9 @@ "/api/v1/teacher/lessons/{id}/students/records": { "get": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Get student records", + "summary": "获取学生记录", "operationId": "getStudentRecords", "parameters": [ { @@ -18625,9 +18647,9 @@ "/api/v1/teacher/lessons/today": { "get": { "tags": [ - "Teacher - Lesson" + "教师端 - 课时管理" ], - "summary": "Get today's lessons", + "summary": "获取今日课程", "operationId": "getTodayLessons_1", "responses": { "200": { @@ -19064,9 +19086,9 @@ "/api/v1/teacher/courses": { "get": { "tags": [ - "Teacher - Course" + "教师端 - 课程管理" ], - "summary": "Get course page", + "summary": "获取课程分页列表", "operationId": "getCoursePage", "parameters": [ { @@ -19183,9 +19205,9 @@ "/api/v1/teacher/courses/{id}": { "get": { "tags": [ - "Teacher - Course" + "教师端 - 课程管理" ], - "summary": "Get course by ID", + "summary": "根据 ID 获取课程", "operationId": "getCourse", "parameters": [ { @@ -19275,9 +19297,9 @@ "/api/v1/teacher/courses/all": { "get": { "tags": [ - "Teacher - Course" + "教师端 - 课程管理" ], - "summary": "Get all courses", + "summary": "获取所有课程", "operationId": "getAllCourses", "responses": { "200": { @@ -19437,9 +19459,9 @@ "/api/v1/teacher/classes": { "get": { "tags": [ - "Teacher - Course" + "教师端 - 课程管理" ], - "summary": "Get teacher's classes", + "summary": "获取教师的班级列表", "operationId": "getClasses", "responses": { "200": { @@ -19518,9 +19540,9 @@ "/api/v1/teacher/classes/{id}/teachers": { "get": { "tags": [ - "Teacher - Course" + "教师端 - 课程管理" ], - "summary": "Get teachers of class", + "summary": "获取班级教师列表", "operationId": "getClassTeachers", "parameters": [ { @@ -19610,9 +19632,9 @@ "/api/v1/teacher/classes/{id}/students": { "get": { "tags": [ - "Teacher - Course" + "教师端 - 课程管理" ], - "summary": "Get students of class", + "summary": "获取班级学生列表", "operationId": "getClassStudents", "parameters": [ { @@ -24866,88 +24888,6 @@ } } }, - "/api/v1/admin/data-fix/check-consistency": { - "get": { - "tags": [ - "数据修复" - ], - "summary": "检查数据一致性", - "description": "检查所有套餐的 packageCount 与实际关联记录是否一致", - "operationId": "checkConsistency", - "responses": { - "200": { - "description": "OK", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultMapStringObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "403": { - "description": "Forbidden", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "405": { - "description": "Method Not Allowed", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/ResultVoid" - } - } - } - } - } - } - }, "/api/v1/admin/courses/{courseId}/lessons/type/{lessonType}": { "get": { "tags": [ @@ -29200,21 +29140,6 @@ } } }, - "ResultString": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "data": { - "type": "string" - } - } - }, "TenantCreateRequest": { "required": [ "code", @@ -29230,6 +29155,10 @@ "type": "string", "description": "租户编码/登录账号" }, + "password": { + "type": "string", + "description": "初始密码(留空默认 123456)" + }, "contactName": { "type": "string", "description": "联系人" @@ -29528,24 +29457,28 @@ }, "description": "课程创建请求" }, - "GrantCollectionRequest": { + "CourseRejectRequest": { + "required": [ + "comment" + ], "type": "object", "properties": { - "tenantId": { - "type": "integer", - "description": "租户ID", - "format": "int64" - }, - "endDate": { + "comment": { "type": "string", - "description": "结束日期(ISO格式,如:2024-12-31)" - }, - "pricePaid": { - "type": "integer", - "description": "支付价格(分)", - "format": "int64" + "description": "驳回意见" } - } + }, + "description": "课程包审核驳回请求" + }, + "CourseCollectionRejectRequest": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "驳回意见" + } + }, + "description": "课程套餐审核驳回请求" }, "Lesson": { "type": "object", diff --git a/reading-platform-frontend/orval.config.ts b/reading-platform-frontend/orval.config.ts index ebaecdb..8a7ed88 100644 --- a/reading-platform-frontend/orval.config.ts +++ b/reading-platform-frontend/orval.config.ts @@ -38,12 +38,11 @@ export default defineConfig({ target: './openapi.json', // 路径重写:确保 OpenAPI 文档中的路径正确 override: { - // 使用转换器修复路径 - 将 `/api/xxx` 转换为 `/api/v1/xxx` + // 使用转换器修复路径 - 将 `/api/v1/xxx` 转换为 `/v1/xxx`(因为 baseURL 已经是 `/api`) transformer: (spec) => { const paths = spec.paths || {}; for (const path of Object.keys(paths)) { - let newKey = path.replace(/\/v1\/v1\//g, '/v1/'); - if (newKey === path) newKey = path.replace(/^\/api\/(?!v1\/)/, '/api/v1/'); + let newKey = path.replace(/^\/api\/v1\//, '/v1/'); if (newKey !== path) { paths[newKey] = paths[path]; delete paths[path]; diff --git a/reading-platform-frontend/src/api/admin.ts b/reading-platform-frontend/src/api/admin.ts index eb6f8e8..932dde2 100644 --- a/reading-platform-frontend/src/api/admin.ts +++ b/reading-platform-frontend/src/api/admin.ts @@ -1,4 +1,7 @@ import { http } from './index'; +import type { CourseCollectionResponse } from './generated/model'; + +export type { CourseCollectionResponse }; // ==================== 类型定义 ==================== @@ -331,7 +334,7 @@ export const getPopularCourses = async (limit?: number) => { // ==================== 课程套餐 ==================== export const getPublishedPackages = () => - http.get('/v1/admin/packages/all'); + http.get('/v1/admin/collections/all'); // ==================== 系统设置 ==================== diff --git a/reading-platform-frontend/src/api/course.ts b/reading-platform-frontend/src/api/course.ts index 1dc63a2..3fe60fb 100644 --- a/reading-platform-frontend/src/api/course.ts +++ b/reading-platform-frontend/src/api/course.ts @@ -137,7 +137,8 @@ function normalizePageResult(raw: any): { }; } -// 获取课程包列表 +// 获取课程包列表(7 步流程创建的教学资源) +// 注意:这里的 Course 实际对应后端的 CoursePackage(课程包) export function getCourses(params: CourseQueryParams): Promise<{ items: Course[]; total: number; @@ -178,13 +179,19 @@ export function deleteCourse(id: number | string): Promise { } // 验证课程完整性 (暂时返回 true,后端可能没有此接口) -export function validateCourse(id: number): Promise { +export function validateCourse(_id: number): Promise { return Promise.resolve({ valid: true, errors: [], warnings: [] }); } // 提交审核 -export function submitCourse(id: number, copyrightConfirmed?: boolean): Promise { - return api.submit(id) as any; +export function submitCourse(id: number | string): Promise { + return http.post(`/v1/admin/packages/${id}/submit`).then((res: any) => { + const body = res; + if (body && typeof body === 'object' && 'code' in body && body.code !== 200 && body.code !== 0) { + throw new Error(body.message || '提交失败'); + } + return body?.data; + }); } // 撤销审核 (暂时使用更新接口,需要确认后端是否有此功能) @@ -193,14 +200,14 @@ export function withdrawCourse(id: number): Promise { } // 审核通过 -export function approveCourse(id: number, data: { checklist?: any; comment?: string }): Promise { +export function approveCourse(id: number, _data: { checklist?: any; comment?: string }): Promise { return api.publishCourse(id) as any; } -// 审核驳回(课程专用,调用 POST /api/v1/admin/packages/{id}/reject) -export function rejectCourse(id: number, data: { checklist?: any; comment: string }): Promise { - return axios.post(`/api/v1/admin/packages/${id}/reject`, { comment: data.comment }).then((res: any) => { - const body = res?.data; +// 审核驳回(课程专用,调用 POST /v1/admin/packages/{id}/reject) +export function rejectCourse(id: number | string, data: { comment: string }): Promise { + return http.post(`/v1/admin/packages/${id}/reject`, data).then((res: any) => { + const body = res; if (body && typeof body === 'object' && 'code' in body && body.code !== 200 && body.code !== 0) { throw new Error(body.message || '驳回失败'); } @@ -209,7 +216,7 @@ export function rejectCourse(id: number, data: { checklist?: any; comment: strin } // 直接发布(超级管理员) -export function directPublishCourse(id: number, skipValidation?: boolean): Promise { +export function directPublishCourse(id: number, _skipValidation?: boolean): Promise { return api.publishCourse(id) as any; } @@ -229,12 +236,12 @@ export function republishCourse(id: number): Promise { } // 获取课程包统计数据 (暂时返回空对象) -export function getCourseStats(id: number | string): Promise { +export function getCourseStats(_id: number | string): Promise { return Promise.resolve({}); } // 获取版本历史 (暂时返回空数组) -export function getCourseVersions(id: number): Promise { +export function getCourseVersions(_id: number): Promise { return Promise.resolve([]); } diff --git a/reading-platform-frontend/src/api/file.ts b/reading-platform-frontend/src/api/file.ts index 3aab427..2b45a99 100644 --- a/reading-platform-frontend/src/api/file.ts +++ b/reading-platform-frontend/src/api/file.ts @@ -1,8 +1,6 @@ -import axios from "axios"; +import { http } from "./index"; import { buildOssDirPath } from "@/utils/env"; -const API_BASE = import.meta.env.VITE_API_BASE_URL; - /** 上传请求 AbortController 映射,用于取消上传 */ const uploadControllers = new Map(); @@ -82,13 +80,13 @@ export const fileApi = { // 自动添加环境前缀 const fullDir = buildOssDirPath(dir); - const response = await axios.get<{ data: OssToken }>( - `${API_BASE}/api/v1/files/oss/token`, + const response = await http.get<{ data: OssToken }>( + `/v1/files/oss/token`, { params: { fileName, dir: fullDir }, }, ); - return response.data.data; + return response.data; }, /** @@ -206,13 +204,13 @@ export const fileApi = { * 删除文件 */ deleteFile: async (filePath: string): Promise => { - const response = await axios.delete( - `${API_BASE}/api/v1/files/delete`, + const response = await http.post( + `/v1/files/delete`, { - data: { filePath }, + filePath, }, ); - return response.data; + return response; }, /** diff --git a/reading-platform-frontend/src/api/generated/index.ts b/reading-platform-frontend/src/api/generated/index.ts index 62d2c15..528137d 100644 --- a/reading-platform-frontend/src/api/generated/index.ts +++ b/reading-platform-frontend/src/api/generated/index.ts @@ -6,7 +6,6 @@ * OpenAPI spec version: 1.0.0 */ import type { - AddPackageToCollectionParams, BasicSettingsUpdateRequest, BindStudentParams, ChangePasswordParams, @@ -14,8 +13,10 @@ import type { ClassCreateRequest, ClassUpdateRequest, CompleteTaskParams, + CourseCollectionRejectRequest, CourseCreateRequest, CourseLessonCreateRequest, + CourseRejectRequest, CourseUpdateRequest, CreateCollectionRequest, CreateTaskFromTemplateRequest, @@ -66,7 +67,6 @@ import type { GetTenantPageParams, GetTimetable1Params, GetTimetableParams, - GrantCollectionRequest, GrowthRecordCreateRequest, GrowthRecordUpdateRequest, LessonCreateRequest, @@ -121,27 +121,27 @@ import { customMutator } from './mutator'; export const getReadingPlatformAPI = () => { /** - * @summary Get task by ID + * @summary 根据 ID 获取任务 */ const getTask = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/tasks/${id}`, method: 'GET', + {url: `/v1/teacher/tasks/${id}`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Update task + * @summary 更新任务 */ const updateTask = ( id: number, taskUpdateRequest: TaskUpdateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/tasks/${id}`, method: 'PUT', + {url: `/v1/teacher/tasks/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: taskUpdateRequest, responseType: 'blob' @@ -150,13 +150,13 @@ const updateTask = ( } /** - * @summary Delete task + * @summary 删除任务 */ const deleteTask = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/tasks/${id}`, method: 'DELETE', + {url: `/v1/teacher/tasks/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -169,7 +169,7 @@ const getTemplate = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/task-templates/${id}`, method: 'GET', + {url: `/v1/teacher/task-templates/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -183,7 +183,7 @@ const updateTemplate = ( taskTemplateCreateRequest: TaskTemplateCreateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/task-templates/${id}`, method: 'PUT', + {url: `/v1/teacher/task-templates/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: taskTemplateCreateRequest, responseType: 'blob' @@ -198,7 +198,7 @@ const deleteTemplate = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/task-templates/${id}`, method: 'DELETE', + {url: `/v1/teacher/task-templates/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -211,7 +211,7 @@ const getSchedule = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/schedules/${id}`, method: 'GET', + {url: `/v1/teacher/schedules/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -225,7 +225,7 @@ const updateSchedule = ( schedulePlanUpdateRequest: SchedulePlanUpdateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/schedules/${id}`, method: 'PUT', + {url: `/v1/teacher/schedules/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: schedulePlanUpdateRequest, responseType: 'blob' @@ -240,34 +240,34 @@ const cancelSchedule = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/schedules/${id}`, method: 'DELETE', + {url: `/v1/teacher/schedules/${id}`, method: 'DELETE', responseType: 'blob' }, ); } /** - * @summary Get lesson by ID(含课程、班级,供上课页面使用) + * @summary 根据 ID 获取课时(含课程、班级,供上课页面使用) */ const getLesson = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}`, method: 'GET', + {url: `/v1/teacher/lessons/${id}`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Update lesson + * @summary 更新课时 */ const updateLesson = ( id: number, lessonUpdateRequest: LessonUpdateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}`, method: 'PUT', + {url: `/v1/teacher/lessons/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: lessonUpdateRequest, responseType: 'blob' @@ -276,27 +276,27 @@ const updateLesson = ( } /** - * @summary Get lesson progress + * @summary 获取课时进度 */ const getLessonProgress = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/progress`, method: 'GET', + {url: `/v1/teacher/lessons/${id}/progress`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Save lesson progress + * @summary 保存课时进度 */ const saveLessonProgress = ( id: number, lessonProgressRequest: LessonProgressRequest, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/progress`, method: 'PUT', + {url: `/v1/teacher/lessons/${id}/progress`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: lessonProgressRequest, responseType: 'blob' @@ -305,27 +305,27 @@ const saveLessonProgress = ( } /** - * @summary Get growth record by ID + * @summary 根据 ID 获取成长记录 */ const getGrowthRecord = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/growth-records/${id}`, method: 'GET', + {url: `/v1/teacher/growth-records/${id}`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Update growth record + * @summary 更新成长记录 */ const updateGrowthRecord = ( id: number, growthRecordUpdateRequest: GrowthRecordUpdateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/growth-records/${id}`, method: 'PUT', + {url: `/v1/teacher/growth-records/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: growthRecordUpdateRequest, responseType: 'blob' @@ -334,13 +334,13 @@ const updateGrowthRecord = ( } /** - * @summary Delete growth record + * @summary 删除成长记录 */ const deleteGrowthRecord = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/growth-records/${id}`, method: 'DELETE', + {url: `/v1/teacher/growth-records/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -353,7 +353,7 @@ const getTeacher = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/teachers/${id}`, method: 'GET', + {url: `/v1/school/teachers/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -367,7 +367,7 @@ const updateTeacher = ( teacherUpdateRequest: TeacherUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/teachers/${id}`, method: 'PUT', + {url: `/v1/school/teachers/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: teacherUpdateRequest, responseType: 'blob' @@ -382,7 +382,7 @@ const deleteTeacher = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/teachers/${id}`, method: 'DELETE', + {url: `/v1/school/teachers/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -395,7 +395,7 @@ const getTask1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/tasks/${id}`, method: 'GET', + {url: `/v1/school/tasks/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -409,7 +409,7 @@ const updateTask1 = ( taskUpdateRequest: TaskUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/tasks/${id}`, method: 'PUT', + {url: `/v1/school/tasks/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: taskUpdateRequest, responseType: 'blob' @@ -424,7 +424,7 @@ const deleteTask1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/tasks/${id}`, method: 'DELETE', + {url: `/v1/school/tasks/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -437,7 +437,7 @@ const getTemplate1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/task-templates/${id}`, method: 'GET', + {url: `/v1/school/task-templates/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -451,7 +451,7 @@ const updateTemplate1 = ( taskTemplateCreateRequest: TaskTemplateCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/task-templates/${id}`, method: 'PUT', + {url: `/v1/school/task-templates/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: taskTemplateCreateRequest, responseType: 'blob' @@ -466,7 +466,7 @@ const deleteTemplate1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/task-templates/${id}`, method: 'DELETE', + {url: `/v1/school/task-templates/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -479,7 +479,7 @@ const getStudent = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/students/${id}`, method: 'GET', + {url: `/v1/school/students/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -493,7 +493,7 @@ const updateStudent = ( studentUpdateRequest: StudentUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/students/${id}`, method: 'PUT', + {url: `/v1/school/students/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: studentUpdateRequest, responseType: 'blob' @@ -508,7 +508,7 @@ const deleteStudent = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/students/${id}`, method: 'DELETE', + {url: `/v1/school/students/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -521,7 +521,7 @@ const getSettings = ( ) => { return customMutator( - {url: `/api/v1/school/settings`, method: 'GET', + {url: `/v1/school/settings`, method: 'GET', responseType: 'blob' }, ); @@ -534,7 +534,7 @@ const updateSettings = ( schoolSettingsUpdateRequest: SchoolSettingsUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/settings`, method: 'PUT', + {url: `/v1/school/settings`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: schoolSettingsUpdateRequest, responseType: 'blob' @@ -549,7 +549,7 @@ const getSecuritySettings = ( ) => { return customMutator( - {url: `/api/v1/school/settings/security`, method: 'GET', + {url: `/v1/school/settings/security`, method: 'GET', responseType: 'blob' }, ); @@ -562,7 +562,7 @@ const updateSecuritySettings = ( securitySettingsUpdateRequest: SecuritySettingsUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/settings/security`, method: 'PUT', + {url: `/v1/school/settings/security`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: securitySettingsUpdateRequest, responseType: 'blob' @@ -577,7 +577,7 @@ const getNotificationSettings = ( ) => { return customMutator( - {url: `/api/v1/school/settings/notification`, method: 'GET', + {url: `/v1/school/settings/notification`, method: 'GET', responseType: 'blob' }, ); @@ -590,7 +590,7 @@ const updateNotificationSettings = ( notificationSettingsUpdateRequest: NotificationSettingsUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/settings/notification`, method: 'PUT', + {url: `/v1/school/settings/notification`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: notificationSettingsUpdateRequest, responseType: 'blob' @@ -605,7 +605,7 @@ const getBasicSettings = ( ) => { return customMutator( - {url: `/api/v1/school/settings/basic`, method: 'GET', + {url: `/v1/school/settings/basic`, method: 'GET', responseType: 'blob' }, ); @@ -618,7 +618,7 @@ const updateBasicSettings = ( basicSettingsUpdateRequest: BasicSettingsUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/settings/basic`, method: 'PUT', + {url: `/v1/school/settings/basic`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: basicSettingsUpdateRequest, responseType: 'blob' @@ -633,7 +633,7 @@ const getSchedule1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/schedules/${id}`, method: 'GET', + {url: `/v1/school/schedules/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -647,7 +647,7 @@ const updateSchedule1 = ( schedulePlanUpdateRequest: SchedulePlanUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/schedules/${id}`, method: 'PUT', + {url: `/v1/school/schedules/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: schedulePlanUpdateRequest, responseType: 'blob' @@ -662,7 +662,7 @@ const cancelSchedule1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/schedules/${id}`, method: 'DELETE', + {url: `/v1/school/schedules/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -675,7 +675,7 @@ const getParent = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/parents/${id}`, method: 'GET', + {url: `/v1/school/parents/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -689,7 +689,7 @@ const updateParent = ( parentUpdateRequest: ParentUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/parents/${id}`, method: 'PUT', + {url: `/v1/school/parents/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: parentUpdateRequest, responseType: 'blob' @@ -704,7 +704,7 @@ const deleteParent = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/parents/${id}`, method: 'DELETE', + {url: `/v1/school/parents/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -717,7 +717,7 @@ const getGrowthRecord1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/growth-records/${id}`, method: 'GET', + {url: `/v1/school/growth-records/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -731,7 +731,7 @@ const updateGrowthRecord1 = ( growthRecordUpdateRequest: GrowthRecordUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/growth-records/${id}`, method: 'PUT', + {url: `/v1/school/growth-records/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: growthRecordUpdateRequest, responseType: 'blob' @@ -746,7 +746,7 @@ const deleteGrowthRecord1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/growth-records/${id}`, method: 'DELETE', + {url: `/v1/school/growth-records/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -759,7 +759,7 @@ const getClass = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/classes/${id}`, method: 'GET', + {url: `/v1/school/classes/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -773,7 +773,7 @@ const updateClass = ( classUpdateRequest: ClassUpdateRequest, ) => { return customMutator( - {url: `/api/v1/school/classes/${id}`, method: 'PUT', + {url: `/v1/school/classes/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: classUpdateRequest, responseType: 'blob' @@ -788,7 +788,7 @@ const deleteClass = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/classes/${id}`, method: 'DELETE', + {url: `/v1/school/classes/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -803,7 +803,7 @@ const updateClassTeacher = ( updateClassTeacherBody: UpdateClassTeacherBody, ) => { return customMutator( - {url: `/api/v1/school/classes/${id}/teachers/${teacherId}`, method: 'PUT', + {url: `/v1/school/classes/${id}/teachers/${teacherId}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateClassTeacherBody, responseType: 'blob' @@ -819,7 +819,7 @@ const removeClassTeacher = ( teacherId: number, ) => { return customMutator( - {url: `/api/v1/school/classes/${id}/teachers/${teacherId}`, method: 'DELETE', + {url: `/v1/school/classes/${id}/teachers/${teacherId}`, method: 'DELETE', responseType: 'blob' }, ); @@ -832,7 +832,7 @@ const getGrowthRecord2 = ( id: number, ) => { return customMutator( - {url: `/api/v1/parent/growth-records/${id}`, method: 'GET', + {url: `/v1/parent/growth-records/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -846,7 +846,7 @@ const updateGrowthRecord2 = ( growthRecordUpdateRequest: GrowthRecordUpdateRequest, ) => { return customMutator( - {url: `/api/v1/parent/growth-records/${id}`, method: 'PUT', + {url: `/v1/parent/growth-records/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: growthRecordUpdateRequest, responseType: 'blob' @@ -861,7 +861,7 @@ const deleteGrowthRecord2 = ( id: number, ) => { return customMutator( - {url: `/api/v1/parent/growth-records/${id}`, method: 'DELETE', + {url: `/v1/parent/growth-records/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -874,7 +874,7 @@ const findOne = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/themes/${id}`, method: 'GET', + {url: `/v1/admin/themes/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -888,7 +888,7 @@ const update = ( themeCreateRequest: ThemeCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/themes/${id}`, method: 'PUT', + {url: `/v1/admin/themes/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: themeCreateRequest, responseType: 'blob' @@ -903,7 +903,7 @@ const _delete = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/themes/${id}`, method: 'DELETE', + {url: `/v1/admin/themes/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -916,7 +916,7 @@ const reorder = ( reorderBody: number[], ) => { return customMutator( - {url: `/api/v1/admin/themes/reorder`, method: 'PUT', + {url: `/v1/admin/themes/reorder`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: reorderBody, responseType: 'blob' @@ -931,7 +931,7 @@ const getTenant = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/tenants/${id}`, method: 'GET', + {url: `/v1/admin/tenants/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -945,7 +945,7 @@ const updateTenant = ( tenantUpdateRequest: TenantUpdateRequest, ) => { return customMutator( - {url: `/api/v1/admin/tenants/${id}`, method: 'PUT', + {url: `/v1/admin/tenants/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: tenantUpdateRequest, responseType: 'blob' @@ -960,7 +960,7 @@ const deleteTenant = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/tenants/${id}`, method: 'DELETE', + {url: `/v1/admin/tenants/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -974,7 +974,7 @@ const updateTenantStatus = ( updateTenantStatusBody: UpdateTenantStatusBody, ) => { return customMutator( - {url: `/api/v1/admin/tenants/${id}/status`, method: 'PUT', + {url: `/v1/admin/tenants/${id}/status`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateTenantStatusBody, responseType: 'blob' @@ -990,7 +990,7 @@ const updateTenantQuota = ( updateTenantQuotaBody: UpdateTenantQuotaBody, ) => { return customMutator( - {url: `/api/v1/admin/tenants/${id}/quota`, method: 'PUT', + {url: `/v1/admin/tenants/${id}/quota`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateTenantQuotaBody, responseType: 'blob' @@ -1005,7 +1005,7 @@ const getAllSettings = ( ) => { return customMutator( - {url: `/api/v1/admin/settings`, method: 'GET', + {url: `/v1/admin/settings`, method: 'GET', responseType: 'blob' }, ); @@ -1018,7 +1018,7 @@ const updateSettings1 = ( updateSettings1Body: UpdateSettings1Body, ) => { return customMutator( - {url: `/api/v1/admin/settings`, method: 'PUT', + {url: `/v1/admin/settings`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateSettings1Body, responseType: 'blob' @@ -1033,7 +1033,7 @@ const getStorageSettings = ( ) => { return customMutator( - {url: `/api/v1/admin/settings/storage`, method: 'GET', + {url: `/v1/admin/settings/storage`, method: 'GET', responseType: 'blob' }, ); @@ -1046,7 +1046,7 @@ const updateStorageSettings = ( updateStorageSettingsBody: UpdateStorageSettingsBody, ) => { return customMutator( - {url: `/api/v1/admin/settings/storage`, method: 'PUT', + {url: `/v1/admin/settings/storage`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateStorageSettingsBody, responseType: 'blob' @@ -1061,7 +1061,7 @@ const getSecuritySettings1 = ( ) => { return customMutator( - {url: `/api/v1/admin/settings/security`, method: 'GET', + {url: `/v1/admin/settings/security`, method: 'GET', responseType: 'blob' }, ); @@ -1074,7 +1074,7 @@ const updateSecuritySettings1 = ( updateSecuritySettings1Body: UpdateSecuritySettings1Body, ) => { return customMutator( - {url: `/api/v1/admin/settings/security`, method: 'PUT', + {url: `/v1/admin/settings/security`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateSecuritySettings1Body, responseType: 'blob' @@ -1089,7 +1089,7 @@ const getNotificationSettings1 = ( ) => { return customMutator( - {url: `/api/v1/admin/settings/notification`, method: 'GET', + {url: `/v1/admin/settings/notification`, method: 'GET', responseType: 'blob' }, ); @@ -1102,7 +1102,7 @@ const updateNotificationSettings1 = ( updateNotificationSettings1Body: UpdateNotificationSettings1Body, ) => { return customMutator( - {url: `/api/v1/admin/settings/notification`, method: 'PUT', + {url: `/v1/admin/settings/notification`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateNotificationSettings1Body, responseType: 'blob' @@ -1117,7 +1117,7 @@ const getBasicSettings1 = ( ) => { return customMutator( - {url: `/api/v1/admin/settings/basic`, method: 'GET', + {url: `/v1/admin/settings/basic`, method: 'GET', responseType: 'blob' }, ); @@ -1130,7 +1130,7 @@ const updateBasicSettings1 = ( updateBasicSettings1Body: UpdateBasicSettings1Body, ) => { return customMutator( - {url: `/api/v1/admin/settings/basic`, method: 'PUT', + {url: `/v1/admin/settings/basic`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: updateBasicSettings1Body, responseType: 'blob' @@ -1145,7 +1145,7 @@ const findLibrary = ( id: string, ) => { return customMutator( - {url: `/api/v1/admin/resources/libraries/${id}`, method: 'GET', + {url: `/v1/admin/resources/libraries/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -1159,7 +1159,7 @@ const updateLibrary = ( resourceLibraryUpdateRequest: ResourceLibraryUpdateRequest, ) => { return customMutator( - {url: `/api/v1/admin/resources/libraries/${id}`, method: 'PUT', + {url: `/v1/admin/resources/libraries/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: resourceLibraryUpdateRequest, responseType: 'blob' @@ -1174,7 +1174,7 @@ const deleteLibrary = ( id: string, ) => { return customMutator( - {url: `/api/v1/admin/resources/libraries/${id}`, method: 'DELETE', + {url: `/v1/admin/resources/libraries/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -1187,7 +1187,7 @@ const findItem = ( id: string, ) => { return customMutator( - {url: `/api/v1/admin/resources/items/${id}`, method: 'GET', + {url: `/v1/admin/resources/items/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -1201,7 +1201,7 @@ const updateItem = ( resourceItemUpdateRequest: ResourceItemUpdateRequest, ) => { return customMutator( - {url: `/api/v1/admin/resources/items/${id}`, method: 'PUT', + {url: `/v1/admin/resources/items/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: resourceItemUpdateRequest, responseType: 'blob' @@ -1216,7 +1216,7 @@ const deleteItem = ( id: string, ) => { return customMutator( - {url: `/api/v1/admin/resources/items/${id}`, method: 'DELETE', + {url: `/v1/admin/resources/items/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -1229,7 +1229,7 @@ const getCourse1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/packages/${id}`, method: 'GET', + {url: `/v1/admin/packages/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -1243,7 +1243,7 @@ const updateCourse = ( courseUpdateRequest: CourseUpdateRequest, ) => { return customMutator( - {url: `/api/v1/admin/packages/${id}`, method: 'PUT', + {url: `/v1/admin/packages/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: courseUpdateRequest, responseType: 'blob' @@ -1258,7 +1258,7 @@ const deleteCourse = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/packages/${id}`, method: 'DELETE', + {url: `/v1/admin/packages/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -1273,7 +1273,7 @@ const reorderSteps = ( reorderStepsBody: number[], ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/${lessonId}/steps/reorder`, method: 'PUT', + {url: `/v1/admin/courses/${courseId}/lessons/${lessonId}/steps/reorder`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: reorderStepsBody, responseType: 'blob' @@ -1289,7 +1289,7 @@ const findOne1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/${id}`, method: 'GET', + {url: `/v1/admin/courses/${courseId}/lessons/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -1304,7 +1304,7 @@ const update1 = ( courseLessonCreateRequest: CourseLessonCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/${id}`, method: 'PUT', + {url: `/v1/admin/courses/${courseId}/lessons/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: courseLessonCreateRequest, responseType: 'blob' @@ -1320,7 +1320,7 @@ const delete1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/${id}`, method: 'DELETE', + {url: `/v1/admin/courses/${courseId}/lessons/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -1335,7 +1335,7 @@ const updateStep = ( lessonStepCreateRequest: LessonStepCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/steps/${stepId}`, method: 'PUT', + {url: `/v1/admin/courses/${courseId}/lessons/steps/${stepId}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: lessonStepCreateRequest, responseType: 'blob' @@ -1351,7 +1351,7 @@ const removeStep = ( stepId: number, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/steps/${stepId}`, method: 'DELETE', + {url: `/v1/admin/courses/${courseId}/lessons/steps/${stepId}`, method: 'DELETE', responseType: 'blob' }, ); @@ -1365,7 +1365,7 @@ const reorder1 = ( reorder1Body: number[], ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/reorder`, method: 'PUT', + {url: `/v1/admin/courses/${courseId}/lessons/reorder`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: reorder1Body, responseType: 'blob' @@ -1380,7 +1380,7 @@ const findOne2 = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}`, method: 'GET', + {url: `/v1/admin/collections/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -1394,7 +1394,7 @@ const update2 = ( createCollectionRequest: CreateCollectionRequest, ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}`, method: 'PUT', + {url: `/v1/admin/collections/${id}`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: createCollectionRequest, responseType: 'blob' @@ -1409,7 +1409,7 @@ const delete2 = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}`, method: 'DELETE', + {url: `/v1/admin/collections/${id}`, method: 'DELETE', responseType: 'blob' }, ); @@ -1423,7 +1423,7 @@ const setPackages = ( setPackagesBody: number[], ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}/packages`, method: 'PUT', + {url: `/v1/admin/collections/${id}/packages`, method: 'PUT', headers: {'Content-Type': 'application/json', }, data: setPackagesBody, responseType: 'blob' @@ -1432,13 +1432,13 @@ const setPackages = ( } /** - * @summary Get task page + * @summary 获取任务分页列表 */ const getTaskPage = ( params?: GetTaskPageParams, ) => { return customMutator( - {url: `/api/v1/teacher/tasks`, method: 'GET', + {url: `/v1/teacher/tasks`, method: 'GET', params, responseType: 'blob' }, @@ -1446,13 +1446,13 @@ const getTaskPage = ( } /** - * @summary Create task + * @summary 创建任务 */ const createTask = ( taskCreateRequest: TaskCreateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/tasks`, method: 'POST', + {url: `/v1/teacher/tasks`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: taskCreateRequest, responseType: 'blob' @@ -1467,7 +1467,7 @@ const getTemplates = ( params?: GetTemplatesParams, ) => { return customMutator( - {url: `/api/v1/teacher/task-templates`, method: 'GET', + {url: `/v1/teacher/task-templates`, method: 'GET', params, responseType: 'blob' }, @@ -1481,7 +1481,7 @@ const createTemplate = ( taskTemplateCreateRequest: TaskTemplateCreateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/task-templates`, method: 'POST', + {url: `/v1/teacher/task-templates`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: taskTemplateCreateRequest, responseType: 'blob' @@ -1496,7 +1496,7 @@ const createFromTemplate = ( createTaskFromTemplateRequest: CreateTaskFromTemplateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/task-templates/from-template`, method: 'POST', + {url: `/v1/teacher/task-templates/from-template`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: createTaskFromTemplateRequest, responseType: 'blob' @@ -1511,7 +1511,7 @@ const getSchedules = ( params?: GetSchedulesParams, ) => { return customMutator( - {url: `/api/v1/teacher/schedules`, method: 'GET', + {url: `/v1/teacher/schedules`, method: 'GET', params, responseType: 'blob' }, @@ -1525,7 +1525,7 @@ const createSchedule = ( schedulePlanCreateRequest: SchedulePlanCreateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/schedules`, method: 'POST', + {url: `/v1/teacher/schedules`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: schedulePlanCreateRequest, responseType: 'blob' @@ -1534,39 +1534,39 @@ const createSchedule = ( } /** - * @summary Mark notification as read + * @summary 标记通知为已读 */ const markAsRead = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/notifications/${id}/read`, method: 'POST', + {url: `/v1/teacher/notifications/${id}/read`, method: 'POST', responseType: 'blob' }, ); } /** - * @summary Mark all notifications as read + * @summary 标记所有通知为已读 */ const markAllAsRead = ( ) => { return customMutator( - {url: `/api/v1/teacher/notifications/read-all`, method: 'POST', + {url: `/v1/teacher/notifications/read-all`, method: 'POST', responseType: 'blob' }, ); } /** - * @summary Get my lessons + * @summary 获取我的课时列表 */ const getMyLessons = ( params?: GetMyLessonsParams, ) => { return customMutator( - {url: `/api/v1/teacher/lessons`, method: 'GET', + {url: `/v1/teacher/lessons`, method: 'GET', params, responseType: 'blob' }, @@ -1574,13 +1574,13 @@ const getMyLessons = ( } /** - * @summary Create lesson + * @summary 创建课时 */ const createLesson = ( lessonCreateRequest: LessonCreateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/lessons`, method: 'POST', + {url: `/v1/teacher/lessons`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: lessonCreateRequest, responseType: 'blob' @@ -1589,7 +1589,7 @@ const createLesson = ( } /** - * @summary Save student record + * @summary 保存学生记录 */ const saveStudentRecord = ( id: number, @@ -1597,7 +1597,7 @@ const saveStudentRecord = ( studentRecordRequest: StudentRecordRequest, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/students/${studentId}/record`, method: 'POST', + {url: `/v1/teacher/lessons/${id}/students/${studentId}/record`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: studentRecordRequest, responseType: 'blob' @@ -1606,14 +1606,14 @@ const saveStudentRecord = ( } /** - * @summary Batch save student records + * @summary 批量保存学生记录 */ const batchSaveStudentRecords = ( id: number, studentRecordRequest: StudentRecordRequest[], ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/students/batch-records`, method: 'POST', + {url: `/v1/teacher/lessons/${id}/students/batch-records`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: studentRecordRequest, responseType: 'blob' @@ -1622,40 +1622,40 @@ const batchSaveStudentRecords = ( } /** - * @summary Start lesson + * @summary 开始上课 */ const startLesson = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/start`, method: 'POST', + {url: `/v1/teacher/lessons/${id}/start`, method: 'POST', responseType: 'blob' }, ); } /** - * @summary Get lesson feedback + * @summary 获取课时反馈 */ const getLessonFeedback = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/feedback`, method: 'GET', + {url: `/v1/teacher/lessons/${id}/feedback`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Submit lesson feedback + * @summary 提交课时反馈 */ const submitFeedback = ( id: number, lessonFeedbackRequest: LessonFeedbackRequest, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/feedback`, method: 'POST', + {url: `/v1/teacher/lessons/${id}/feedback`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: lessonFeedbackRequest, responseType: 'blob' @@ -1664,65 +1664,65 @@ const submitFeedback = ( } /** - * @summary Complete lesson + * @summary 完成课时 */ const completeLesson = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/complete`, method: 'POST', + {url: `/v1/teacher/lessons/${id}/complete`, method: 'POST', responseType: 'blob' }, ); } /** - * @summary Cancel lesson + * @summary 取消课时 */ const cancelLesson = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/cancel`, method: 'POST', + {url: `/v1/teacher/lessons/${id}/cancel`, method: 'POST', responseType: 'blob' }, ); } /** - * @summary Create lesson from schedule + * @summary 从排课创建课时 */ const createLessonFromSchedule = ( schedulePlanId: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/from-schedule/${schedulePlanId}`, method: 'POST', + {url: `/v1/teacher/lessons/from-schedule/${schedulePlanId}`, method: 'POST', responseType: 'blob' }, ); } /** - * @summary Start lesson from schedule + * @summary 从排课开始上课 */ const startLessonFromSchedule = ( schedulePlanId: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/from-schedule/${schedulePlanId}/start`, method: 'POST', + {url: `/v1/teacher/lessons/from-schedule/${schedulePlanId}/start`, method: 'POST', responseType: 'blob' }, ); } /** - * @summary Get growth record page + * @summary 获取成长记录分页列表 */ const getGrowthRecordPage = ( params?: GetGrowthRecordPageParams, ) => { return customMutator( - {url: `/api/v1/teacher/growth-records`, method: 'GET', + {url: `/v1/teacher/growth-records`, method: 'GET', params, responseType: 'blob' }, @@ -1730,13 +1730,13 @@ const getGrowthRecordPage = ( } /** - * @summary Create growth record + * @summary 创建成长记录 */ const createGrowthRecord = ( growthRecordCreateRequest: GrowthRecordCreateRequest, ) => { return customMutator( - {url: `/api/v1/teacher/growth-records`, method: 'POST', + {url: `/v1/teacher/growth-records`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: growthRecordCreateRequest, responseType: 'blob' @@ -1751,7 +1751,7 @@ const getTeacherPage = ( params?: GetTeacherPageParams, ) => { return customMutator( - {url: `/api/v1/school/teachers`, method: 'GET', + {url: `/v1/school/teachers`, method: 'GET', params, responseType: 'blob' }, @@ -1765,7 +1765,7 @@ const createTeacher = ( teacherCreateRequest: TeacherCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/teachers`, method: 'POST', + {url: `/v1/school/teachers`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: teacherCreateRequest, responseType: 'blob' @@ -1781,7 +1781,7 @@ const resetPassword = ( params: ResetPasswordParams, ) => { return customMutator( - {url: `/api/v1/school/teachers/${id}/reset-password`, method: 'POST', + {url: `/v1/school/teachers/${id}/reset-password`, method: 'POST', params, responseType: 'blob' }, @@ -1795,7 +1795,7 @@ const getTaskPage1 = ( params?: GetTaskPage1Params, ) => { return customMutator( - {url: `/api/v1/school/tasks`, method: 'GET', + {url: `/v1/school/tasks`, method: 'GET', params, responseType: 'blob' }, @@ -1809,7 +1809,7 @@ const createTask1 = ( taskCreateRequest: TaskCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/tasks`, method: 'POST', + {url: `/v1/school/tasks`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: taskCreateRequest, responseType: 'blob' @@ -1824,7 +1824,7 @@ const getTemplates1 = ( params?: GetTemplates1Params, ) => { return customMutator( - {url: `/api/v1/school/task-templates`, method: 'GET', + {url: `/v1/school/task-templates`, method: 'GET', params, responseType: 'blob' }, @@ -1838,7 +1838,7 @@ const createTemplate1 = ( taskTemplateCreateRequest: TaskTemplateCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/task-templates`, method: 'POST', + {url: `/v1/school/task-templates`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: taskTemplateCreateRequest, responseType: 'blob' @@ -1853,7 +1853,7 @@ const getStudentPage = ( params?: GetStudentPageParams, ) => { return customMutator( - {url: `/api/v1/school/students`, method: 'GET', + {url: `/v1/school/students`, method: 'GET', params, responseType: 'blob' }, @@ -1867,7 +1867,7 @@ const createStudent = ( studentCreateRequest: StudentCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/students`, method: 'POST', + {url: `/v1/school/students`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: studentCreateRequest, responseType: 'blob' @@ -1882,7 +1882,7 @@ const getSchedules1 = ( params?: GetSchedules1Params, ) => { return customMutator( - {url: `/api/v1/school/schedules`, method: 'GET', + {url: `/v1/school/schedules`, method: 'GET', params, responseType: 'blob' }, @@ -1896,7 +1896,7 @@ const createSchedule1 = ( schedulePlanCreateRequest: SchedulePlanCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/schedules`, method: 'POST', + {url: `/v1/school/schedules`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: schedulePlanCreateRequest, responseType: 'blob' @@ -1911,7 +1911,7 @@ const checkConflict = ( params: CheckConflictParams, ) => { return customMutator( - {url: `/api/v1/school/schedules/check-conflict`, method: 'POST', + {url: `/v1/school/schedules/check-conflict`, method: 'POST', params, responseType: 'blob' }, @@ -1925,7 +1925,7 @@ const batchCreateSchedules = ( schedulePlanCreateRequest: SchedulePlanCreateRequest[], ) => { return customMutator( - {url: `/api/v1/school/schedules/batch`, method: 'POST', + {url: `/v1/school/schedules/batch`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: schedulePlanCreateRequest, responseType: 'blob' @@ -1940,7 +1940,7 @@ const createSchedulesByClasses = ( scheduleCreateByClassesRequest: ScheduleCreateByClassesRequest, ) => { return customMutator( - {url: `/api/v1/school/schedules/batch-by-classes`, method: 'POST', + {url: `/v1/school/schedules/batch-by-classes`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: scheduleCreateByClassesRequest, responseType: 'blob' @@ -1955,7 +1955,7 @@ const getParentPage = ( params?: GetParentPageParams, ) => { return customMutator( - {url: `/api/v1/school/parents`, method: 'GET', + {url: `/v1/school/parents`, method: 'GET', params, responseType: 'blob' }, @@ -1969,7 +1969,7 @@ const createParent = ( parentCreateRequest: ParentCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/parents`, method: 'POST', + {url: `/v1/school/parents`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: parentCreateRequest, responseType: 'blob' @@ -1986,7 +1986,7 @@ const bindStudent = ( params?: BindStudentParams, ) => { return customMutator( - {url: `/api/v1/school/parents/${parentId}/students/${studentId}`, method: 'POST', + {url: `/v1/school/parents/${parentId}/students/${studentId}`, method: 'POST', params, responseType: 'blob' }, @@ -2001,7 +2001,7 @@ const unbindStudent = ( studentId: number, ) => { return customMutator( - {url: `/api/v1/school/parents/${parentId}/students/${studentId}`, method: 'DELETE', + {url: `/v1/school/parents/${parentId}/students/${studentId}`, method: 'DELETE', responseType: 'blob' }, ); @@ -2015,7 +2015,7 @@ const resetPassword1 = ( params: ResetPassword1Params, ) => { return customMutator( - {url: `/api/v1/school/parents/${id}/reset-password`, method: 'POST', + {url: `/v1/school/parents/${id}/reset-password`, method: 'POST', params, responseType: 'blob' }, @@ -2031,7 +2031,7 @@ const renewPackage = ( renewRequest: RenewRequest, ) => { return customMutator( - {url: `/api/v1/school/packages/${id}/renew`, method: 'POST', + {url: `/v1/school/packages/${id}/renew`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: renewRequest, responseType: 'blob' @@ -2047,7 +2047,7 @@ const renewCollection = ( renewRequest: RenewRequest, ) => { return customMutator( - {url: `/api/v1/school/packages/${collectionId}/renew`, method: 'POST', + {url: `/v1/school/packages/${collectionId}/renew`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: renewRequest, responseType: 'blob' @@ -2062,7 +2062,7 @@ const getGrowthRecordPage1 = ( params?: GetGrowthRecordPage1Params, ) => { return customMutator( - {url: `/api/v1/school/growth-records`, method: 'GET', + {url: `/v1/school/growth-records`, method: 'GET', params, responseType: 'blob' }, @@ -2076,7 +2076,7 @@ const createGrowthRecord1 = ( growthRecordCreateRequest: GrowthRecordCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/growth-records`, method: 'POST', + {url: `/v1/school/growth-records`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: growthRecordCreateRequest, responseType: 'blob' @@ -2091,7 +2091,7 @@ const getClassPage = ( params?: GetClassPageParams, ) => { return customMutator( - {url: `/api/v1/school/classes`, method: 'GET', + {url: `/v1/school/classes`, method: 'GET', params, responseType: 'blob' }, @@ -2105,7 +2105,7 @@ const createClass = ( classCreateRequest: ClassCreateRequest, ) => { return customMutator( - {url: `/api/v1/school/classes`, method: 'POST', + {url: `/v1/school/classes`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: classCreateRequest, responseType: 'blob' @@ -2120,7 +2120,7 @@ const getClassTeachers1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/classes/${id}/teachers`, method: 'GET', + {url: `/v1/school/classes/${id}/teachers`, method: 'GET', responseType: 'blob' }, ); @@ -2134,7 +2134,7 @@ const assignTeachers = ( assignTeachersBody: number[], ) => { return customMutator( - {url: `/api/v1/school/classes/${id}/teachers`, method: 'POST', + {url: `/v1/school/classes/${id}/teachers`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: assignTeachersBody, responseType: 'blob' @@ -2150,7 +2150,7 @@ const getClassStudents1 = ( params?: GetClassStudents1Params, ) => { return customMutator( - {url: `/api/v1/school/classes/${id}/students`, method: 'GET', + {url: `/v1/school/classes/${id}/students`, method: 'GET', params, responseType: 'blob' }, @@ -2165,7 +2165,7 @@ const assignStudents = ( assignStudentsBody: number[], ) => { return customMutator( - {url: `/api/v1/school/classes/${id}/students`, method: 'POST', + {url: `/v1/school/classes/${id}/students`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: assignStudentsBody, responseType: 'blob' @@ -2181,7 +2181,7 @@ const completeTask = ( params: CompleteTaskParams, ) => { return customMutator( - {url: `/api/v1/parent/tasks/${id}/complete`, method: 'POST', + {url: `/v1/parent/tasks/${id}/complete`, method: 'POST', params, responseType: 'blob' }, @@ -2195,7 +2195,7 @@ const markAsRead1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/parent/notifications/${id}/read`, method: 'POST', + {url: `/v1/parent/notifications/${id}/read`, method: 'POST', responseType: 'blob' }, ); @@ -2208,7 +2208,7 @@ const markAllAsRead1 = ( ) => { return customMutator( - {url: `/api/v1/parent/notifications/read-all`, method: 'POST', + {url: `/v1/parent/notifications/read-all`, method: 'POST', responseType: 'blob' }, ); @@ -2221,7 +2221,7 @@ const createGrowthRecord2 = ( growthRecordCreateRequest: GrowthRecordCreateRequest, ) => { return customMutator( - {url: `/api/v1/parent/growth-records`, method: 'POST', + {url: `/v1/parent/growth-records`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: growthRecordCreateRequest, responseType: 'blob' @@ -2237,7 +2237,7 @@ const refreshToken = ( refreshTokenRequest: RefreshTokenRequest, ) => { return customMutator( - {url: `/api/v1/imm/token/refresh`, method: 'POST', + {url: `/v1/imm/token/refresh`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: refreshTokenRequest, responseType: 'blob' @@ -2253,7 +2253,7 @@ const uploadFile = ( params?: UploadFileParams, ) => { return customMutator( - {url: `/api/v1/files/upload`, method: 'POST', + {url: `/v1/files/upload`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: uploadFileBody, params, @@ -2269,7 +2269,7 @@ const refreshToken1 = ( ) => { return customMutator( - {url: `/api/v1/auth/refresh`, method: 'POST', + {url: `/v1/auth/refresh`, method: 'POST', responseType: 'blob' }, ); @@ -2282,7 +2282,7 @@ const logout = ( ) => { return customMutator( - {url: `/api/v1/auth/logout`, method: 'POST', + {url: `/v1/auth/logout`, method: 'POST', responseType: 'blob' }, ); @@ -2295,7 +2295,7 @@ const login = ( loginRequest: LoginRequest, ) => { return customMutator( - {url: `/api/v1/auth/login`, method: 'POST', + {url: `/v1/auth/login`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: loginRequest, responseType: 'blob' @@ -2310,23 +2310,13 @@ const changePassword = ( params: ChangePasswordParams, ) => { return customMutator( - {url: `/api/v1/auth/change-password`, method: 'POST', + {url: `/v1/auth/change-password`, method: 'POST', params, responseType: 'blob' }, ); } -const repairFlyway = ( - - ) => { - return customMutator( - {url: `/api/v1/admin/util/repair-flyway`, method: 'POST', - responseType: 'blob' - }, - ); - } - /** * @summary 查询所有主题 */ @@ -2334,7 +2324,7 @@ const findAll = ( ) => { return customMutator( - {url: `/api/v1/admin/themes`, method: 'GET', + {url: `/v1/admin/themes`, method: 'GET', responseType: 'blob' }, ); @@ -2347,7 +2337,7 @@ const create = ( themeCreateRequest: ThemeCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/themes`, method: 'POST', + {url: `/v1/admin/themes`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: themeCreateRequest, responseType: 'blob' @@ -2362,7 +2352,7 @@ const getTenantPage = ( params?: GetTenantPageParams, ) => { return customMutator( - {url: `/api/v1/admin/tenants`, method: 'GET', + {url: `/v1/admin/tenants`, method: 'GET', params, responseType: 'blob' }, @@ -2376,7 +2366,7 @@ const createTenant = ( tenantCreateRequest: TenantCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/tenants`, method: 'POST', + {url: `/v1/admin/tenants`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: tenantCreateRequest, responseType: 'blob' @@ -2391,7 +2381,7 @@ const resetTenantPassword = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/tenants/${id}/reset-password`, method: 'POST', + {url: `/v1/admin/tenants/${id}/reset-password`, method: 'POST', responseType: 'blob' }, ); @@ -2404,7 +2394,7 @@ const findAllLibraries = ( params?: FindAllLibrariesParams, ) => { return customMutator( - {url: `/api/v1/admin/resources/libraries`, method: 'GET', + {url: `/v1/admin/resources/libraries`, method: 'GET', params, responseType: 'blob' }, @@ -2418,7 +2408,7 @@ const createLibrary = ( resourceLibraryCreateRequest: ResourceLibraryCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/resources/libraries`, method: 'POST', + {url: `/v1/admin/resources/libraries`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: resourceLibraryCreateRequest, responseType: 'blob' @@ -2433,7 +2423,7 @@ const findAllItems = ( params?: FindAllItemsParams, ) => { return customMutator( - {url: `/api/v1/admin/resources/items`, method: 'GET', + {url: `/v1/admin/resources/items`, method: 'GET', params, responseType: 'blob' }, @@ -2447,7 +2437,7 @@ const createItem = ( resourceItemCreateRequest: ResourceItemCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/resources/items`, method: 'POST', + {url: `/v1/admin/resources/items`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: resourceItemCreateRequest, responseType: 'blob' @@ -2462,7 +2452,7 @@ const batchDeleteItems = ( batchDeleteItemsBody: string[], ) => { return customMutator( - {url: `/api/v1/admin/resources/items/batch-delete`, method: 'POST', + {url: `/v1/admin/resources/items/batch-delete`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: batchDeleteItemsBody, responseType: 'blob' @@ -2477,7 +2467,7 @@ const getCoursePage1 = ( params: GetCoursePage1Params, ) => { return customMutator( - {url: `/api/v1/admin/packages`, method: 'GET', + {url: `/v1/admin/packages`, method: 'GET', params, responseType: 'blob' }, @@ -2491,7 +2481,7 @@ const createCourse = ( courseCreateRequest: CourseCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/packages`, method: 'POST', + {url: `/v1/admin/packages`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: courseCreateRequest, responseType: 'blob' @@ -2499,6 +2489,35 @@ const createCourse = ( ); } +/** + * @summary 提交课程包审核 + */ +const submitCourse = ( + id: number, + ) => { + return customMutator( + {url: `/v1/admin/packages/${id}/submit`, method: 'POST', + responseType: 'blob' + }, + ); + } + +/** + * @summary 驳回课程包审核 + */ +const rejectCourse = ( + id: number, + courseRejectRequest: CourseRejectRequest, + ) => { + return customMutator( + {url: `/v1/admin/packages/${id}/reject`, method: 'POST', + headers: {'Content-Type': 'application/json', }, + data: courseRejectRequest, + responseType: 'blob' + }, + ); + } + /** * @summary 发布课程包 */ @@ -2506,7 +2525,7 @@ const publishCourse = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/packages/${id}/publish`, method: 'POST', + {url: `/v1/admin/packages/${id}/publish`, method: 'POST', responseType: 'blob' }, ); @@ -2519,36 +2538,7 @@ const archiveCourse = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/packages/${id}/archive`, method: 'POST', - responseType: 'blob' - }, - ); - } - -/** - * 修复 packageCount 与实际关联数据不一致的问题 - * @summary 修复套餐关联数据 - */ -const fixCollectionPackages = ( - - ) => { - return customMutator( - {url: `/api/v1/admin/data-fix/fix-collection-packages`, method: 'POST', - responseType: 'blob' - }, - ); - } - -/** - * 手动添加课程包关联 - * @summary 添加课程包到套餐 - */ -const addPackageToCollection = ( - params: AddPackageToCollectionParams, - ) => { - return customMutator( - {url: `/api/v1/admin/data-fix/add-package-to-collection`, method: 'POST', - params, + {url: `/v1/admin/packages/${id}/archive`, method: 'POST', responseType: 'blob' }, ); @@ -2561,7 +2551,7 @@ const findAll1 = ( courseId: number, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons`, method: 'GET', + {url: `/v1/admin/courses/${courseId}/lessons`, method: 'GET', responseType: 'blob' }, ); @@ -2575,7 +2565,7 @@ const create1 = ( courseLessonCreateRequest: CourseLessonCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons`, method: 'POST', + {url: `/v1/admin/courses/${courseId}/lessons`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: courseLessonCreateRequest, responseType: 'blob' @@ -2591,7 +2581,7 @@ const findSteps = ( lessonId: number, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/${lessonId}/steps`, method: 'GET', + {url: `/v1/admin/courses/${courseId}/lessons/${lessonId}/steps`, method: 'GET', responseType: 'blob' }, ); @@ -2606,7 +2596,7 @@ const createStep = ( lessonStepCreateRequest: LessonStepCreateRequest, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/${lessonId}/steps`, method: 'POST', + {url: `/v1/admin/courses/${courseId}/lessons/${lessonId}/steps`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: lessonStepCreateRequest, responseType: 'blob' @@ -2621,7 +2611,7 @@ const page = ( params: PageParams, ) => { return customMutator( - {url: `/api/v1/admin/collections`, method: 'GET', + {url: `/v1/admin/collections`, method: 'GET', params, responseType: 'blob' }, @@ -2635,7 +2625,7 @@ const create2 = ( createCollectionRequest: CreateCollectionRequest, ) => { return customMutator( - {url: `/api/v1/admin/collections`, method: 'POST', + {url: `/v1/admin/collections`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: createCollectionRequest, responseType: 'blob' @@ -2650,7 +2640,20 @@ const withdraw = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}/withdraw`, method: 'POST', + {url: `/v1/admin/collections/${id}/withdraw`, method: 'POST', + responseType: 'blob' + }, + ); + } + +/** + * @summary 提交审核 + */ +const submit = ( + id: number, + ) => { + return customMutator( + {url: `/v1/admin/collections/${id}/submit`, method: 'POST', responseType: 'blob' }, ); @@ -2663,7 +2666,23 @@ const republish = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}/republish`, method: 'POST', + {url: `/v1/admin/collections/${id}/republish`, method: 'POST', + responseType: 'blob' + }, + ); + } + +/** + * @summary 审核驳回 + */ +const reject = ( + id: number, + courseCollectionRejectRequest: CourseCollectionRejectRequest, + ) => { + return customMutator( + {url: `/v1/admin/collections/${id}/reject`, method: 'POST', + headers: {'Content-Type': 'application/json', }, + data: courseCollectionRejectRequest, responseType: 'blob' }, ); @@ -2676,23 +2695,7 @@ const publish = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}/publish`, method: 'POST', - responseType: 'blob' - }, - ); - } - -/** - * @summary 授权课程套餐给租户 - */ -const grantToTenant = ( - id: number, - grantCollectionRequest: GrantCollectionRequest, - ) => { - return customMutator( - {url: `/api/v1/admin/collections/${id}/grant`, method: 'POST', - headers: {'Content-Type': 'application/json', }, - data: grantCollectionRequest, + {url: `/v1/admin/collections/${id}/publish`, method: 'POST', responseType: 'blob' }, ); @@ -2705,7 +2708,7 @@ const archive = ( id: number, ) => { return customMutator( - {url: `/api/v1/admin/collections/${id}/archive`, method: 'POST', + {url: `/v1/admin/collections/${id}/archive`, method: 'POST', responseType: 'blob' }, ); @@ -2718,7 +2721,7 @@ const getWeeklyStats = ( ) => { return customMutator( - {url: `/api/v1/teacher/weekly-stats`, method: 'GET', + {url: `/v1/teacher/weekly-stats`, method: 'GET', responseType: 'blob' }, ); @@ -2731,7 +2734,7 @@ const getTodayLessons = ( ) => { return customMutator( - {url: `/api/v1/teacher/today-lessons`, method: 'GET', + {url: `/v1/teacher/today-lessons`, method: 'GET', responseType: 'blob' }, ); @@ -2744,20 +2747,20 @@ const getDefaultTemplate = ( type: string, ) => { return customMutator( - {url: `/api/v1/teacher/task-templates/default/${type}`, method: 'GET', + {url: `/v1/teacher/task-templates/default/${type}`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get all students of teacher + * @summary 获取教师教授的所有学生 */ const getAllStudents = ( params?: GetAllStudentsParams, ) => { return customMutator( - {url: `/api/v1/teacher/students`, method: 'GET', + {url: `/v1/teacher/students`, method: 'GET', params, responseType: 'blob' }, @@ -2771,7 +2774,7 @@ const getTodaySchedules = ( ) => { return customMutator( - {url: `/api/v1/teacher/schedules/today`, method: 'GET', + {url: `/v1/teacher/schedules/today`, method: 'GET', responseType: 'blob' }, ); @@ -2784,7 +2787,7 @@ const getTimetable = ( params?: GetTimetableParams, ) => { return customMutator( - {url: `/api/v1/teacher/schedules/timetable`, method: 'GET', + {url: `/v1/teacher/schedules/timetable`, method: 'GET', params, responseType: 'blob' }, @@ -2798,20 +2801,20 @@ const getRecommendedCourses = ( ) => { return customMutator( - {url: `/api/v1/teacher/recommended-courses`, method: 'GET', + {url: `/v1/teacher/recommended-courses`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get my notifications + * @summary 获取我的通知列表 */ const getMyNotifications = ( params?: GetMyNotificationsParams, ) => { return customMutator( - {url: `/api/v1/teacher/notifications`, method: 'GET', + {url: `/v1/teacher/notifications`, method: 'GET', params, responseType: 'blob' }, @@ -2819,52 +2822,52 @@ const getMyNotifications = ( } /** - * @summary Get notification by ID + * @summary 根据 ID 获取通知 */ const getNotification = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/notifications/${id}`, method: 'GET', + {url: `/v1/teacher/notifications/${id}`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get unread count + * @summary 获取未读数量 */ const getUnreadCount = ( ) => { return customMutator( - {url: `/api/v1/teacher/notifications/unread-count`, method: 'GET', + {url: `/v1/teacher/notifications/unread-count`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get student records + * @summary 获取学生记录 */ const getStudentRecords = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/lessons/${id}/students/records`, method: 'GET', + {url: `/v1/teacher/lessons/${id}/students/records`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get today's lessons + * @summary 获取今日课程 */ const getTodayLessons1 = ( ) => { return customMutator( - {url: `/api/v1/teacher/lessons/today`, method: 'GET', + {url: `/v1/teacher/lessons/today`, method: 'GET', responseType: 'blob' }, ); @@ -2877,7 +2880,7 @@ const getLessonTrend = ( params?: GetLessonTrendParams, ) => { return customMutator( - {url: `/api/v1/teacher/lesson-trend`, method: 'GET', + {url: `/v1/teacher/lesson-trend`, method: 'GET', params, responseType: 'blob' }, @@ -2891,7 +2894,7 @@ const getFeedbacks = ( params?: GetFeedbacksParams, ) => { return customMutator( - {url: `/api/v1/teacher/feedbacks`, method: 'GET', + {url: `/v1/teacher/feedbacks`, method: 'GET', params, responseType: 'blob' }, @@ -2905,7 +2908,7 @@ const getFeedbackStats = ( ) => { return customMutator( - {url: `/api/v1/teacher/feedbacks/stats`, method: 'GET', + {url: `/v1/teacher/feedbacks/stats`, method: 'GET', responseType: 'blob' }, ); @@ -2918,20 +2921,20 @@ const getDashboard = ( ) => { return customMutator( - {url: `/api/v1/teacher/dashboard`, method: 'GET', + {url: `/v1/teacher/dashboard`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get course page + * @summary 获取课程分页列表 */ const getCoursePage = ( params?: GetCoursePageParams, ) => { return customMutator( - {url: `/api/v1/teacher/courses`, method: 'GET', + {url: `/v1/teacher/courses`, method: 'GET', params, responseType: 'blob' }, @@ -2939,26 +2942,26 @@ const getCoursePage = ( } /** - * @summary Get course by ID + * @summary 根据 ID 获取课程 */ const getCourse = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/courses/${id}`, method: 'GET', + {url: `/v1/teacher/courses/${id}`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get all courses + * @summary 获取所有课程 */ const getAllCourses = ( ) => { return customMutator( - {url: `/api/v1/teacher/courses/all`, method: 'GET', + {url: `/v1/teacher/courses/all`, method: 'GET', responseType: 'blob' }, ); @@ -2971,47 +2974,47 @@ const getCourseUsage = ( ) => { return customMutator( - {url: `/api/v1/teacher/course-usage`, method: 'GET', + {url: `/v1/teacher/course-usage`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get teacher's classes + * @summary 获取教师的班级列表 */ const getClasses = ( ) => { return customMutator( - {url: `/api/v1/teacher/classes`, method: 'GET', + {url: `/v1/teacher/classes`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get teachers of class + * @summary 获取班级教师列表 */ const getClassTeachers = ( id: number, ) => { return customMutator( - {url: `/api/v1/teacher/classes/${id}/teachers`, method: 'GET', + {url: `/v1/teacher/classes/${id}/teachers`, method: 'GET', responseType: 'blob' }, ); } /** - * @summary Get students of class + * @summary 获取班级学生列表 */ const getClassStudents = ( id: number, params?: GetClassStudentsParams, ) => { return customMutator( - {url: `/api/v1/teacher/classes/${id}/students`, method: 'GET', + {url: `/v1/teacher/classes/${id}/students`, method: 'GET', params, responseType: 'blob' }, @@ -3025,7 +3028,7 @@ const getDefaultTemplate1 = ( type: string, ) => { return customMutator( - {url: `/api/v1/school/task-templates/default/${type}`, method: 'GET', + {url: `/v1/school/task-templates/default/${type}`, method: 'GET', responseType: 'blob' }, ); @@ -3038,7 +3041,7 @@ const getSchoolStats = ( ) => { return customMutator( - {url: `/api/v1/school/stats`, method: 'GET', + {url: `/v1/school/stats`, method: 'GET', responseType: 'blob' }, ); @@ -3051,7 +3054,7 @@ const getActiveTeachers = ( params?: GetActiveTeachersParams, ) => { return customMutator( - {url: `/api/v1/school/stats/teachers`, method: 'GET', + {url: `/v1/school/stats/teachers`, method: 'GET', params, responseType: 'blob' }, @@ -3065,7 +3068,7 @@ const getLessonTrend1 = ( params?: GetLessonTrend1Params, ) => { return customMutator( - {url: `/api/v1/school/stats/lesson-trend`, method: 'GET', + {url: `/v1/school/stats/lesson-trend`, method: 'GET', params, responseType: 'blob' }, @@ -3079,7 +3082,7 @@ const getCourseUsageStats = ( ) => { return customMutator( - {url: `/api/v1/school/stats/courses`, method: 'GET', + {url: `/v1/school/stats/courses`, method: 'GET', responseType: 'blob' }, ); @@ -3092,7 +3095,7 @@ const getCourseDistribution = ( ) => { return customMutator( - {url: `/api/v1/school/stats/course-distribution`, method: 'GET', + {url: `/v1/school/stats/course-distribution`, method: 'GET', responseType: 'blob' }, ); @@ -3105,7 +3108,7 @@ const getRecentActivities = ( params?: GetRecentActivitiesParams, ) => { return customMutator( - {url: `/api/v1/school/stats/activities`, method: 'GET', + {url: `/v1/school/stats/activities`, method: 'GET', params, responseType: 'blob' }, @@ -3119,7 +3122,7 @@ const getTimetable1 = ( params?: GetTimetable1Params, ) => { return customMutator( - {url: `/api/v1/school/schedules/timetable`, method: 'GET', + {url: `/v1/school/schedules/timetable`, method: 'GET', params, responseType: 'blob' }, @@ -3133,7 +3136,7 @@ const getCoursePackageLessonTypes = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/schedules/course-packages/${id}/lesson-types`, method: 'GET', + {url: `/v1/school/schedules/course-packages/${id}/lesson-types`, method: 'GET', responseType: 'blob' }, ); @@ -3146,7 +3149,7 @@ const getCalendarViewData = ( params?: GetCalendarViewDataParams, ) => { return customMutator( - {url: `/api/v1/school/schedules/calendar`, method: 'GET', + {url: `/v1/school/schedules/calendar`, method: 'GET', params, responseType: 'blob' }, @@ -3160,7 +3163,7 @@ const getTeacherReports = ( ) => { return customMutator( - {url: `/api/v1/school/reports/teachers`, method: 'GET', + {url: `/v1/school/reports/teachers`, method: 'GET', responseType: 'blob' }, ); @@ -3173,7 +3176,7 @@ const getStudentReports = ( ) => { return customMutator( - {url: `/api/v1/school/reports/students`, method: 'GET', + {url: `/v1/school/reports/students`, method: 'GET', responseType: 'blob' }, ); @@ -3186,7 +3189,7 @@ const getOverview = ( ) => { return customMutator( - {url: `/api/v1/school/reports/overview`, method: 'GET', + {url: `/v1/school/reports/overview`, method: 'GET', responseType: 'blob' }, ); @@ -3199,7 +3202,7 @@ const getCourseReports = ( ) => { return customMutator( - {url: `/api/v1/school/reports/courses`, method: 'GET', + {url: `/v1/school/reports/courses`, method: 'GET', responseType: 'blob' }, ); @@ -3212,7 +3215,7 @@ const getParentChildren = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/parents/${id}/children`, method: 'GET', + {url: `/v1/school/parents/${id}/children`, method: 'GET', responseType: 'blob' }, ); @@ -3225,7 +3228,7 @@ const findTenantCollections = ( ) => { return customMutator( - {url: `/api/v1/school/packages`, method: 'GET', + {url: `/v1/school/packages`, method: 'GET', responseType: 'blob' }, ); @@ -3238,7 +3241,7 @@ const getPackagesByCollection = ( collectionId: number, ) => { return customMutator( - {url: `/api/v1/school/packages/${collectionId}/packages`, method: 'GET', + {url: `/v1/school/packages/${collectionId}/packages`, method: 'GET', responseType: 'blob' }, ); @@ -3251,7 +3254,7 @@ const getPackageCourses = ( packageId: number, ) => { return customMutator( - {url: `/api/v1/school/packages/packages/${packageId}/courses`, method: 'GET', + {url: `/v1/school/packages/packages/${packageId}/courses`, method: 'GET', responseType: 'blob' }, ); @@ -3264,7 +3267,7 @@ const getPackageInfo = ( ) => { return customMutator( - {url: `/api/v1/school/packages/package`, method: 'GET', + {url: `/v1/school/packages/package`, method: 'GET', responseType: 'blob' }, ); @@ -3277,7 +3280,7 @@ const getPackageUsage = ( ) => { return customMutator( - {url: `/api/v1/school/packages/package/usage`, method: 'GET', + {url: `/v1/school/packages/package/usage`, method: 'GET', responseType: 'blob' }, ); @@ -3291,7 +3294,7 @@ const findTenantPackages = ( ) => { return customMutator( - {url: `/api/v1/school/packages/legacy`, method: 'GET', + {url: `/v1/school/packages/legacy`, method: 'GET', responseType: 'blob' }, ); @@ -3304,7 +3307,7 @@ const getLogList = ( params?: GetLogListParams, ) => { return customMutator( - {url: `/api/v1/school/operation-logs`, method: 'GET', + {url: `/v1/school/operation-logs`, method: 'GET', params, responseType: 'blob' }, @@ -3318,7 +3321,7 @@ const getLogDetail = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/operation-logs/${id}`, method: 'GET', + {url: `/v1/school/operation-logs/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -3331,7 +3334,7 @@ const getLogStats = ( ) => { return customMutator( - {url: `/api/v1/school/operation-logs/stats`, method: 'GET', + {url: `/v1/school/operation-logs/stats`, method: 'GET', responseType: 'blob' }, ); @@ -3344,7 +3347,7 @@ const getFeedbacks1 = ( params?: GetFeedbacks1Params, ) => { return customMutator( - {url: `/api/v1/school/feedbacks`, method: 'GET', + {url: `/v1/school/feedbacks`, method: 'GET', params, responseType: 'blob' }, @@ -3358,7 +3361,7 @@ const getFeedbackStats1 = ( ) => { return customMutator( - {url: `/api/v1/school/feedbacks/stats`, method: 'GET', + {url: `/v1/school/feedbacks/stats`, method: 'GET', responseType: 'blob' }, ); @@ -3371,7 +3374,7 @@ const exportTeacherStats = ( ) => { return customMutator( - {url: `/api/v1/school/export/teacher-stats`, method: 'GET', + {url: `/v1/school/export/teacher-stats`, method: 'GET', responseType: 'blob' }, ); @@ -3384,7 +3387,7 @@ const exportStudentStats = ( ) => { return customMutator( - {url: `/api/v1/school/export/student-stats`, method: 'GET', + {url: `/v1/school/export/student-stats`, method: 'GET', responseType: 'blob' }, ); @@ -3397,7 +3400,7 @@ const exportLessons = ( params?: ExportLessonsParams, ) => { return customMutator( - {url: `/api/v1/school/export/lessons`, method: 'GET', + {url: `/v1/school/export/lessons`, method: 'GET', params, responseType: 'blob' }, @@ -3411,7 +3414,7 @@ const exportGrowthRecords = ( params?: ExportGrowthRecordsParams, ) => { return customMutator( - {url: `/api/v1/school/export/growth-records`, method: 'GET', + {url: `/v1/school/export/growth-records`, method: 'GET', params, responseType: 'blob' }, @@ -3425,7 +3428,7 @@ const getSchoolCourses = ( params?: GetSchoolCoursesParams, ) => { return customMutator( - {url: `/api/v1/school/courses`, method: 'GET', + {url: `/v1/school/courses`, method: 'GET', params, responseType: 'blob' }, @@ -3439,7 +3442,7 @@ const getSchoolCourse = ( id: number, ) => { return customMutator( - {url: `/api/v1/school/courses/${id}`, method: 'GET', + {url: `/v1/school/courses/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -3452,7 +3455,7 @@ const getMyTasks = ( params?: GetMyTasksParams, ) => { return customMutator( - {url: `/api/v1/parent/tasks`, method: 'GET', + {url: `/v1/parent/tasks`, method: 'GET', params, responseType: 'blob' }, @@ -3466,7 +3469,7 @@ const getTask2 = ( id: number, ) => { return customMutator( - {url: `/api/v1/parent/tasks/${id}`, method: 'GET', + {url: `/v1/parent/tasks/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -3480,7 +3483,7 @@ const getTasksByStudent = ( params?: GetTasksByStudentParams, ) => { return customMutator( - {url: `/api/v1/parent/tasks/student/${studentId}`, method: 'GET', + {url: `/v1/parent/tasks/student/${studentId}`, method: 'GET', params, responseType: 'blob' }, @@ -3494,7 +3497,7 @@ const getMyNotifications1 = ( params?: GetMyNotifications1Params, ) => { return customMutator( - {url: `/api/v1/parent/notifications`, method: 'GET', + {url: `/v1/parent/notifications`, method: 'GET', params, responseType: 'blob' }, @@ -3508,7 +3511,7 @@ const getNotification1 = ( id: number, ) => { return customMutator( - {url: `/api/v1/parent/notifications/${id}`, method: 'GET', + {url: `/v1/parent/notifications/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -3521,7 +3524,7 @@ const getUnreadCount1 = ( ) => { return customMutator( - {url: `/api/v1/parent/notifications/unread-count`, method: 'GET', + {url: `/v1/parent/notifications/unread-count`, method: 'GET', responseType: 'blob' }, ); @@ -3535,7 +3538,7 @@ const getGrowthRecordsByStudent = ( params?: GetGrowthRecordsByStudentParams, ) => { return customMutator( - {url: `/api/v1/parent/growth-records/student/${studentId}`, method: 'GET', + {url: `/v1/parent/growth-records/student/${studentId}`, method: 'GET', params, responseType: 'blob' }, @@ -3550,7 +3553,7 @@ const getRecentGrowthRecords = ( params?: GetRecentGrowthRecordsParams, ) => { return customMutator( - {url: `/api/v1/parent/growth-records/student/${studentId}/recent`, method: 'GET', + {url: `/v1/parent/growth-records/student/${studentId}/recent`, method: 'GET', params, responseType: 'blob' }, @@ -3564,7 +3567,7 @@ const getMyChildren = ( ) => { return customMutator( - {url: `/api/v1/parent/children`, method: 'GET', + {url: `/v1/parent/children`, method: 'GET', responseType: 'blob' }, ); @@ -3577,7 +3580,7 @@ const getChild = ( id: number, ) => { return customMutator( - {url: `/api/v1/parent/children/${id}`, method: 'GET', + {url: `/v1/parent/children/${id}`, method: 'GET', responseType: 'blob' }, ); @@ -3590,7 +3593,7 @@ const getChildGrowth = ( id: number, ) => { return customMutator( - {url: `/api/v1/parent/children/${id}/growth`, method: 'GET', + {url: `/v1/parent/children/${id}/growth`, method: 'GET', responseType: 'blob' }, ); @@ -3604,7 +3607,7 @@ const generateEditToken = ( params: GenerateEditTokenParams, ) => { return customMutator( - {url: `/api/v1/imm/token`, method: 'GET', + {url: `/v1/imm/token`, method: 'GET', params, responseType: 'blob' }, @@ -3619,7 +3622,7 @@ const generateReadOnlyToken = ( params: GenerateReadOnlyTokenParams, ) => { return customMutator( - {url: `/api/v1/imm/token/readonly`, method: 'GET', + {url: `/v1/imm/token/readonly`, method: 'GET', params, responseType: 'blob' }, @@ -3633,7 +3636,7 @@ const getOssToken = ( params: GetOssTokenParams, ) => { return customMutator( - {url: `/api/v1/files/oss/token`, method: 'GET', + {url: `/v1/files/oss/token`, method: 'GET', params, responseType: 'blob' }, @@ -3647,7 +3650,7 @@ const getCurrentUser = ( ) => { return customMutator( - {url: `/api/v1/auth/profile`, method: 'GET', + {url: `/v1/auth/profile`, method: 'GET', responseType: 'blob' }, ); @@ -3660,7 +3663,7 @@ const getTenantStats = ( ) => { return customMutator( - {url: `/api/v1/admin/tenants/stats`, method: 'GET', + {url: `/v1/admin/tenants/stats`, method: 'GET', responseType: 'blob' }, ); @@ -3673,7 +3676,7 @@ const getAllActiveTenants = ( ) => { return customMutator( - {url: `/api/v1/admin/tenants/active`, method: 'GET', + {url: `/v1/admin/tenants/active`, method: 'GET', responseType: 'blob' }, ); @@ -3686,7 +3689,7 @@ const getStats = ( ) => { return customMutator( - {url: `/api/v1/admin/stats`, method: 'GET', + {url: `/v1/admin/stats`, method: 'GET', responseType: 'blob' }, ); @@ -3699,7 +3702,7 @@ const getTrendData = ( ) => { return customMutator( - {url: `/api/v1/admin/stats/trend`, method: 'GET', + {url: `/v1/admin/stats/trend`, method: 'GET', responseType: 'blob' }, ); @@ -3712,7 +3715,7 @@ const getActiveTenants = ( params: GetActiveTenantsParams, ) => { return customMutator( - {url: `/api/v1/admin/stats/tenants/active`, method: 'GET', + {url: `/v1/admin/stats/tenants/active`, method: 'GET', params, responseType: 'blob' }, @@ -3726,7 +3729,7 @@ const getPopularCourses = ( params: GetPopularCoursesParams, ) => { return customMutator( - {url: `/api/v1/admin/stats/courses/popular`, method: 'GET', + {url: `/v1/admin/stats/courses/popular`, method: 'GET', params, responseType: 'blob' }, @@ -3740,7 +3743,7 @@ const getRecentActivities1 = ( params: GetRecentActivities1Params, ) => { return customMutator( - {url: `/api/v1/admin/stats/activities`, method: 'GET', + {url: `/v1/admin/stats/activities`, method: 'GET', params, responseType: 'blob' }, @@ -3754,7 +3757,7 @@ const getTenantDefaults = ( ) => { return customMutator( - {url: `/api/v1/admin/settings/tenant-defaults`, method: 'GET', + {url: `/v1/admin/settings/tenant-defaults`, method: 'GET', responseType: 'blob' }, ); @@ -3767,21 +3770,7 @@ const getStats1 = ( ) => { return customMutator( - {url: `/api/v1/admin/resources/stats`, method: 'GET', - responseType: 'blob' - }, - ); - } - -/** - * 检查所有套餐的 packageCount 与实际关联记录是否一致 - * @summary 检查数据一致性 - */ -const checkConsistency = ( - - ) => { - return customMutator( - {url: `/api/v1/admin/data-fix/check-consistency`, method: 'GET', + {url: `/v1/admin/resources/stats`, method: 'GET', responseType: 'blob' }, ); @@ -3795,7 +3784,7 @@ const findByType = ( lessonType: string, ) => { return customMutator( - {url: `/api/v1/admin/courses/${courseId}/lessons/type/${lessonType}`, method: 'GET', + {url: `/v1/admin/courses/${courseId}/lessons/type/${lessonType}`, method: 'GET', responseType: 'blob' }, ); @@ -3808,7 +3797,7 @@ const deleteFile = ( deleteFileBody: DeleteFileBody, ) => { return customMutator( - {url: `/api/v1/files/delete`, method: 'DELETE', + {url: `/v1/files/delete`, method: 'DELETE', headers: {'Content-Type': 'application/json', }, data: deleteFileBody, responseType: 'blob' @@ -3816,7 +3805,7 @@ const deleteFile = ( ); } -return {getTask,updateTask,deleteTask,getTemplate,updateTemplate,deleteTemplate,getSchedule,updateSchedule,cancelSchedule,getLesson,updateLesson,getLessonProgress,saveLessonProgress,getGrowthRecord,updateGrowthRecord,deleteGrowthRecord,getTeacher,updateTeacher,deleteTeacher,getTask1,updateTask1,deleteTask1,getTemplate1,updateTemplate1,deleteTemplate1,getStudent,updateStudent,deleteStudent,getSettings,updateSettings,getSecuritySettings,updateSecuritySettings,getNotificationSettings,updateNotificationSettings,getBasicSettings,updateBasicSettings,getSchedule1,updateSchedule1,cancelSchedule1,getParent,updateParent,deleteParent,getGrowthRecord1,updateGrowthRecord1,deleteGrowthRecord1,getClass,updateClass,deleteClass,updateClassTeacher,removeClassTeacher,getGrowthRecord2,updateGrowthRecord2,deleteGrowthRecord2,findOne,update,_delete,reorder,getTenant,updateTenant,deleteTenant,updateTenantStatus,updateTenantQuota,getAllSettings,updateSettings1,getStorageSettings,updateStorageSettings,getSecuritySettings1,updateSecuritySettings1,getNotificationSettings1,updateNotificationSettings1,getBasicSettings1,updateBasicSettings1,findLibrary,updateLibrary,deleteLibrary,findItem,updateItem,deleteItem,getCourse1,updateCourse,deleteCourse,reorderSteps,findOne1,update1,delete1,updateStep,removeStep,reorder1,findOne2,update2,delete2,setPackages,getTaskPage,createTask,getTemplates,createTemplate,createFromTemplate,getSchedules,createSchedule,markAsRead,markAllAsRead,getMyLessons,createLesson,saveStudentRecord,batchSaveStudentRecords,startLesson,getLessonFeedback,submitFeedback,completeLesson,cancelLesson,createLessonFromSchedule,startLessonFromSchedule,getGrowthRecordPage,createGrowthRecord,getTeacherPage,createTeacher,resetPassword,getTaskPage1,createTask1,getTemplates1,createTemplate1,getStudentPage,createStudent,getSchedules1,createSchedule1,checkConflict,batchCreateSchedules,createSchedulesByClasses,getParentPage,createParent,bindStudent,unbindStudent,resetPassword1,renewPackage,renewCollection,getGrowthRecordPage1,createGrowthRecord1,getClassPage,createClass,getClassTeachers1,assignTeachers,getClassStudents1,assignStudents,completeTask,markAsRead1,markAllAsRead1,createGrowthRecord2,refreshToken,uploadFile,refreshToken1,logout,login,changePassword,repairFlyway,findAll,create,getTenantPage,createTenant,resetTenantPassword,findAllLibraries,createLibrary,findAllItems,createItem,batchDeleteItems,getCoursePage1,createCourse,publishCourse,archiveCourse,fixCollectionPackages,addPackageToCollection,findAll1,create1,findSteps,createStep,page,create2,withdraw,republish,publish,grantToTenant,archive,getWeeklyStats,getTodayLessons,getDefaultTemplate,getAllStudents,getTodaySchedules,getTimetable,getRecommendedCourses,getMyNotifications,getNotification,getUnreadCount,getStudentRecords,getTodayLessons1,getLessonTrend,getFeedbacks,getFeedbackStats,getDashboard,getCoursePage,getCourse,getAllCourses,getCourseUsage,getClasses,getClassTeachers,getClassStudents,getDefaultTemplate1,getSchoolStats,getActiveTeachers,getLessonTrend1,getCourseUsageStats,getCourseDistribution,getRecentActivities,getTimetable1,getCoursePackageLessonTypes,getCalendarViewData,getTeacherReports,getStudentReports,getOverview,getCourseReports,getParentChildren,findTenantCollections,getPackagesByCollection,getPackageCourses,getPackageInfo,getPackageUsage,findTenantPackages,getLogList,getLogDetail,getLogStats,getFeedbacks1,getFeedbackStats1,exportTeacherStats,exportStudentStats,exportLessons,exportGrowthRecords,getSchoolCourses,getSchoolCourse,getMyTasks,getTask2,getTasksByStudent,getMyNotifications1,getNotification1,getUnreadCount1,getGrowthRecordsByStudent,getRecentGrowthRecords,getMyChildren,getChild,getChildGrowth,generateEditToken,generateReadOnlyToken,getOssToken,getCurrentUser,getTenantStats,getAllActiveTenants,getStats,getTrendData,getActiveTenants,getPopularCourses,getRecentActivities1,getTenantDefaults,getStats1,checkConsistency,findByType,deleteFile}}; +return {getTask,updateTask,deleteTask,getTemplate,updateTemplate,deleteTemplate,getSchedule,updateSchedule,cancelSchedule,getLesson,updateLesson,getLessonProgress,saveLessonProgress,getGrowthRecord,updateGrowthRecord,deleteGrowthRecord,getTeacher,updateTeacher,deleteTeacher,getTask1,updateTask1,deleteTask1,getTemplate1,updateTemplate1,deleteTemplate1,getStudent,updateStudent,deleteStudent,getSettings,updateSettings,getSecuritySettings,updateSecuritySettings,getNotificationSettings,updateNotificationSettings,getBasicSettings,updateBasicSettings,getSchedule1,updateSchedule1,cancelSchedule1,getParent,updateParent,deleteParent,getGrowthRecord1,updateGrowthRecord1,deleteGrowthRecord1,getClass,updateClass,deleteClass,updateClassTeacher,removeClassTeacher,getGrowthRecord2,updateGrowthRecord2,deleteGrowthRecord2,findOne,update,_delete,reorder,getTenant,updateTenant,deleteTenant,updateTenantStatus,updateTenantQuota,getAllSettings,updateSettings1,getStorageSettings,updateStorageSettings,getSecuritySettings1,updateSecuritySettings1,getNotificationSettings1,updateNotificationSettings1,getBasicSettings1,updateBasicSettings1,findLibrary,updateLibrary,deleteLibrary,findItem,updateItem,deleteItem,getCourse1,updateCourse,deleteCourse,reorderSteps,findOne1,update1,delete1,updateStep,removeStep,reorder1,findOne2,update2,delete2,setPackages,getTaskPage,createTask,getTemplates,createTemplate,createFromTemplate,getSchedules,createSchedule,markAsRead,markAllAsRead,getMyLessons,createLesson,saveStudentRecord,batchSaveStudentRecords,startLesson,getLessonFeedback,submitFeedback,completeLesson,cancelLesson,createLessonFromSchedule,startLessonFromSchedule,getGrowthRecordPage,createGrowthRecord,getTeacherPage,createTeacher,resetPassword,getTaskPage1,createTask1,getTemplates1,createTemplate1,getStudentPage,createStudent,getSchedules1,createSchedule1,checkConflict,batchCreateSchedules,createSchedulesByClasses,getParentPage,createParent,bindStudent,unbindStudent,resetPassword1,renewPackage,renewCollection,getGrowthRecordPage1,createGrowthRecord1,getClassPage,createClass,getClassTeachers1,assignTeachers,getClassStudents1,assignStudents,completeTask,markAsRead1,markAllAsRead1,createGrowthRecord2,refreshToken,uploadFile,refreshToken1,logout,login,changePassword,findAll,create,getTenantPage,createTenant,resetTenantPassword,findAllLibraries,createLibrary,findAllItems,createItem,batchDeleteItems,getCoursePage1,createCourse,submitCourse,rejectCourse,publishCourse,archiveCourse,findAll1,create1,findSteps,createStep,page,create2,withdraw,submit,republish,reject,publish,archive,getWeeklyStats,getTodayLessons,getDefaultTemplate,getAllStudents,getTodaySchedules,getTimetable,getRecommendedCourses,getMyNotifications,getNotification,getUnreadCount,getStudentRecords,getTodayLessons1,getLessonTrend,getFeedbacks,getFeedbackStats,getDashboard,getCoursePage,getCourse,getAllCourses,getCourseUsage,getClasses,getClassTeachers,getClassStudents,getDefaultTemplate1,getSchoolStats,getActiveTeachers,getLessonTrend1,getCourseUsageStats,getCourseDistribution,getRecentActivities,getTimetable1,getCoursePackageLessonTypes,getCalendarViewData,getTeacherReports,getStudentReports,getOverview,getCourseReports,getParentChildren,findTenantCollections,getPackagesByCollection,getPackageCourses,getPackageInfo,getPackageUsage,findTenantPackages,getLogList,getLogDetail,getLogStats,getFeedbacks1,getFeedbackStats1,exportTeacherStats,exportStudentStats,exportLessons,exportGrowthRecords,getSchoolCourses,getSchoolCourse,getMyTasks,getTask2,getTasksByStudent,getMyNotifications1,getNotification1,getUnreadCount1,getGrowthRecordsByStudent,getRecentGrowthRecords,getMyChildren,getChild,getChildGrowth,generateEditToken,generateReadOnlyToken,getOssToken,getCurrentUser,getTenantStats,getAllActiveTenants,getStats,getTrendData,getActiveTenants,getPopularCourses,getRecentActivities1,getTenantDefaults,getStats1,findByType,deleteFile}}; export type GetTaskResult = NonNullable['getTask']>>> export type UpdateTaskResult = NonNullable['updateTask']>>> export type DeleteTaskResult = NonNullable['deleteTask']>>> @@ -3970,7 +3959,6 @@ export type RefreshToken1Result = NonNullable['logout']>>> export type LoginResult = NonNullable['login']>>> export type ChangePasswordResult = NonNullable['changePassword']>>> -export type RepairFlywayResult = NonNullable['repairFlyway']>>> export type FindAllResult = NonNullable['findAll']>>> export type CreateResult = NonNullable['create']>>> export type GetTenantPageResult = NonNullable['getTenantPage']>>> @@ -3983,10 +3971,10 @@ export type CreateItemResult = NonNullable['batchDeleteItems']>>> export type GetCoursePage1Result = NonNullable['getCoursePage1']>>> export type CreateCourseResult = NonNullable['createCourse']>>> +export type SubmitCourseResult = NonNullable['submitCourse']>>> +export type RejectCourseResult = NonNullable['rejectCourse']>>> export type PublishCourseResult = NonNullable['publishCourse']>>> export type ArchiveCourseResult = NonNullable['archiveCourse']>>> -export type FixCollectionPackagesResult = NonNullable['fixCollectionPackages']>>> -export type AddPackageToCollectionResult = NonNullable['addPackageToCollection']>>> export type FindAll1Result = NonNullable['findAll1']>>> export type Create1Result = NonNullable['create1']>>> export type FindStepsResult = NonNullable['findSteps']>>> @@ -3994,9 +3982,10 @@ export type CreateStepResult = NonNullable['page']>>> export type Create2Result = NonNullable['create2']>>> export type WithdrawResult = NonNullable['withdraw']>>> +export type SubmitResult = NonNullable['submit']>>> export type RepublishResult = NonNullable['republish']>>> +export type RejectResult = NonNullable['reject']>>> export type PublishResult = NonNullable['publish']>>> -export type GrantToTenantResult = NonNullable['grantToTenant']>>> export type ArchiveResult = NonNullable['archive']>>> export type GetWeeklyStatsResult = NonNullable['getWeeklyStats']>>> export type GetTodayLessonsResult = NonNullable['getTodayLessons']>>> @@ -4077,6 +4066,5 @@ export type GetPopularCoursesResult = NonNullable['getRecentActivities1']>>> export type GetTenantDefaultsResult = NonNullable['getTenantDefaults']>>> export type GetStats1Result = NonNullable['getStats1']>>> -export type CheckConsistencyResult = NonNullable['checkConsistency']>>> export type FindByTypeResult = NonNullable['findByType']>>> export type DeleteFileResult = NonNullable['deleteFile']>>> diff --git a/reading-platform-frontend/src/api/generated/model/courseCollectionRejectRequest.ts b/reading-platform-frontend/src/api/generated/model/courseCollectionRejectRequest.ts new file mode 100644 index 0000000..4ff8fdc --- /dev/null +++ b/reading-platform-frontend/src/api/generated/model/courseCollectionRejectRequest.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v8.5.3 🍺 + * Do not edit manually. + * Reading Platform API + * Reading Platform Backend Service API Documentation + * OpenAPI spec version: 1.0.0 + */ + +/** + * 课程套餐审核驳回请求 + */ +export interface CourseCollectionRejectRequest { + /** 驳回意见 */ + comment?: string; +} diff --git a/reading-platform-frontend/src/api/generated/model/courseRejectRequest.ts b/reading-platform-frontend/src/api/generated/model/courseRejectRequest.ts new file mode 100644 index 0000000..6a8cc23 --- /dev/null +++ b/reading-platform-frontend/src/api/generated/model/courseRejectRequest.ts @@ -0,0 +1,15 @@ +/** + * Generated by orval v8.5.3 🍺 + * Do not edit manually. + * Reading Platform API + * Reading Platform Backend Service API Documentation + * OpenAPI spec version: 1.0.0 + */ + +/** + * 课程包审核驳回请求 + */ +export interface CourseRejectRequest { + /** 驳回意见 */ + comment: string; +} diff --git a/reading-platform-frontend/src/api/generated/model/index.ts b/reading-platform-frontend/src/api/generated/model/index.ts index e251bc5..1d46e5a 100644 --- a/reading-platform-frontend/src/api/generated/model/index.ts +++ b/reading-platform-frontend/src/api/generated/model/index.ts @@ -35,6 +35,7 @@ export * from './conflictCheckResult'; export * from './conflictInfo'; export * from './course'; export * from './courseCollectionPageQueryRequest'; +export * from './courseCollectionRejectRequest'; export * from './courseCollectionResponse'; export * from './courseControllerFindAllParams'; export * from './courseControllerGetReviewListParams'; @@ -48,6 +49,7 @@ export * from './coursePackageCourseItem'; export * from './coursePackageItem'; export * from './coursePackageResponse'; export * from './coursePageQueryRequest'; +export * from './courseRejectRequest'; export * from './courseReportResponse'; export * from './courseResponse'; export * from './courseUpdateRequest'; diff --git a/reading-platform-frontend/src/api/generated/model/tenantCreateRequest.ts b/reading-platform-frontend/src/api/generated/model/tenantCreateRequest.ts index 5f34774..3f29cc3 100644 --- a/reading-platform-frontend/src/api/generated/model/tenantCreateRequest.ts +++ b/reading-platform-frontend/src/api/generated/model/tenantCreateRequest.ts @@ -14,6 +14,8 @@ export interface TenantCreateRequest { name: string; /** 租户编码/登录账号 */ code: string; + /** 初始密码(留空默认 123456) */ + password?: string; /** 联系人 */ contactName?: string; /** 联系电话 */ diff --git a/reading-platform-frontend/src/api/generated/mutator.ts b/reading-platform-frontend/src/api/generated/mutator.ts index 77e45b6..614d1c2 100644 --- a/reading-platform-frontend/src/api/generated/mutator.ts +++ b/reading-platform-frontend/src/api/generated/mutator.ts @@ -5,7 +5,7 @@ import axios, { type AxiosRequestConfig, type AxiosResponse } from "axios"; */ const axiosInstance = axios.create({ //#vite.config.ts中的proxy配置;不需要修改 - baseURL: "", + baseURL: "/api", timeout: 30000, }); diff --git a/reading-platform-frontend/src/api/package.ts b/reading-platform-frontend/src/api/package.ts index de56069..aff353a 100644 --- a/reading-platform-frontend/src/api/package.ts +++ b/reading-platform-frontend/src/api/package.ts @@ -1,135 +1,271 @@ import { http } from './index'; -// ==================== 套餐管理 ==================== +// ==================== 课程套餐(CourseCollection)管理 ==================== -export interface CoursePackage { +/** + * 课程套餐响应(对应后端 CourseCollectionResponse) + * 课程套餐包含多个课程包 + */ +export interface CourseCollection { id: number | string; // 后端 Long 序列化为 string,避免 JS 精度丢失 name: string; description?: string; - price: number; - discountPrice?: number; - discountType?: string; - gradeLevels: string[]; - status: string; - courseCount: number; - tenantCount: number; + price: number; // 价格(分) + discountPrice?: number; // 折后价格(分) + discountType?: string; // 折扣类型:PERCENTAGE、FIXED + gradeLevels: string[]; // 适用年级 + packageCount: number; // 课程包数量 + tenantCount?: number; // 使用学校数 + status: string; // DRAFT, PENDING, APPROVED, REJECTED, PUBLISHED, OFFLINE createdAt: string; publishedAt?: string; submittedAt?: string; reviewedAt?: string; reviewComment?: string; updatedAt?: string; - courses?: PackageCourse[]; + startDate?: string; // 开始日期(租户套餐) + endDate?: string; // 结束日期(租户套餐) + packages?: CoursePackageItem[]; // 包含的课程包列表 } -export interface PackageCourse { - id: number | string; // 课程 ID,后端 Long 序列化为 string - name: string; // 课程名称 - gradeLevel: string; // 适用年级 +/** + * 课程包项(对应后端 CourseCollectionResponse.CoursePackageItem) + * 套餐中的课程包项 + */ +export interface CoursePackageItem { + id: number | string; // 课程包 ID + name: string; // 课程包名称 + description?: string; // 课程包描述 + gradeLevels: string[]; // 适用年级 + courseCount: number; // 课程数量 sortOrder: number; // 排序号 } +/** + * 课程包(CoursePackage)响应 + * 课程包是通过 7 步流程创建的教学资源 + */ +export interface CoursePackage { + id: number | string; + name: string; + description?: string; + pictureBookName?: string; // 绘本名称 + gradeTags?: string[]; // 年级标签 + status: string; + version?: string; + usageCount?: number; + teacherCount?: number; + avgRating?: number; + createdAt?: string; + submittedAt?: string; + reviewedAt?: string; + reviewComment?: string; + duration?: number; // 时长(分钟) + courseLessons?: CourseLesson[]; // 课程环节 +} + +/** + * 课程环节 + */ +export interface CourseLesson { + id: number | string; + courseId: number | string; + lessonType: string; // COLLECTIVE, DOMAIN, INTRO + name: string; + description?: string; + duration: number; + sortOrder: number; + videoPath?: string; + videoName?: string; + pptPath?: string; + pptName?: string; + pdfPath?: string; + pdfName?: string; + objectives?: string; + preparation?: string; + extension?: string; + assessmentData?: string; +} + export interface PackageListParams { status?: string; pageNum?: number; pageSize?: number; } -export interface CreatePackageData { +export interface CreateCollectionData { name: string; description?: string; - price: number; - discountPrice?: number; - discountType?: string; - gradeLevels: string[]; + price: number; // 价格(分) + discountPrice?: number; // 折后价格(分) + discountType?: string; // 折扣类型 + gradeLevels: string[]; // 适用年级 } -// 获取套餐列表 -export function getPackageList(params?: PackageListParams) { - return http.get<{ list: CoursePackage[]; total: number; pageNum: number; pageSize: number; pages: number }>('/v1/admin/packages', { params }); +// ==================== 课程套餐 API(超管端) ==================== + +// 获取课程套餐列表 +export function getCollectionList(params?: PackageListParams) { + return http.get<{ list: CourseCollection[]; total: number; pageNum: number; pageSize: number; pages: number }>( + '/v1/admin/collections', + { params } + ); } -// 获取套餐详情(id 支持 number | string,避免大整数精度丢失) -export function getPackageDetail(id: number | string) { - return http.get(`/v1/admin/packages/${id}`); +// 获取课程套餐详情(id 支持 number | string,避免大整数精度丢失) +export function getCollectionDetail(id: number | string) { + return http.get(`/v1/admin/collections/${id}`); } -// 创建套餐 -export function createPackage(data: CreatePackageData) { +// 创建课程套餐 +export function createCollection(data: CreateCollectionData) { + return http.post('/v1/admin/collections', data); +} + +// 更新课程套餐 +export function updateCollection(id: number | string, data: Partial) { + return http.put(`/v1/admin/collections/${id}`, data); +} + +// 删除课程套餐 +export function deleteCollection(id: number | string) { + return http.delete(`/v1/admin/collections/${id}`); +} + +// 设置课程套餐的课程包(后端期望 JSON 数组 [packageId1, packageId2, ...]) +export function setCollectionPackages( + collectionId: number | string, + packageIds: (number | string)[], +) { + return http.put(`/v1/admin/collections/${collectionId}/packages`, packageIds); +} + +// 提交审核(课程套餐) +export function submitCollection(id: number | string) { + return http.post(`/v1/admin/collections/${id}/submit`); +} + +// 发布课程套餐 +export function publishCollection(id: number | string) { + return http.post(`/v1/admin/collections/${id}/publish`); +} + +// 下架课程套餐 +export function archiveCollection(id: number | string) { + return http.post(`/v1/admin/collections/${id}/archive`); +} + +// 驳回课程套餐审核 +export function rejectCollection(id: number | string, data: { comment: string }) { + return http.post(`/v1/admin/collections/${id}/reject`, data); +} + +// 重新发布课程套餐 +export function republishCollection(id: number | string) { + return http.post(`/v1/admin/collections/${id}/republish`); +} + +// 撤销审核 +export function withdrawCollection(id: number | string) { + return http.post(`/v1/admin/collections/${id}/withdraw`); +} + +// ==================== 课程包 API(超管端) ==================== + +// 获取课程包列表(7 步创建的教学资源) +export function getCoursePackageList(params?: { status?: string; pageNum?: number; pageSize?: number }) { + return http.get<{ list: CoursePackage[]; total: number; pageNum: number; pageSize: number; pages: number }>( + '/v1/admin/packages', + { params } + ); +} + +// 获取课程包详情 +export function getCoursePackage(id: number | string) { + return http.get(`/v1/admin/packages/${id}`); +} + +// 创建课程包 +export function createCoursePackage(data: any) { return http.post('/v1/admin/packages', data); } -// 更新套餐 -export function updatePackage(id: number | string, data: Partial) { +// 更新课程包 +export function updateCoursePackage(id: number | string, data: any) { return http.put(`/v1/admin/packages/${id}`, data); } -// 删除套餐 -export function deletePackage(id: number | string) { +// 删除课程包 +export function deleteCoursePackage(id: number | string) { return http.delete(`/v1/admin/packages/${id}`); } -// 设置套餐课程(后端期望 JSON 数组 [courseId1, courseId2, ...]) -export function setPackageCourses( - packageId: number | string, - courses: { courseId: number; gradeLevel?: string; sortOrder?: number }[], -) { - const courseIds = courses.map((c) => c.courseId); - return http.put(`/v1/admin/packages/${packageId}/courses`, courseIds); -} - -// 添加课程到套餐 -export function addCourseToPackage( - packageId: number | string, - data: { courseId: number; gradeLevel: string; sortOrder?: number }, -) { - return http.post(`/v1/admin/packages/${packageId}/courses`, data); -} - -// 从套餐移除课程 -export function removeCourseFromPackage(packageId: number | string, courseId: number | string) { - return http.delete(`/v1/admin/packages/${packageId}/courses/${courseId}`); -} - -// 提交审核 -export function submitPackage(id: number | string) { - return http.post(`/v1/admin/packages/${id}/submit`); -} - -// 审核套餐 -export function reviewPackage(id: number | string, data: { approved: boolean; comment?: string; publish?: boolean }) { - return http.post(`/v1/admin/packages/${id}/review`, data); -} - -// 发布套餐 -export function publishPackage(id: number | string) { +// 发布课程包 +export function publishCoursePackage(id: number | string) { return http.post(`/v1/admin/packages/${id}/publish`); } -// 下架套餐 -export function offlinePackage(id: number | string) { - return http.post(`/v1/admin/packages/${id}/offline`); -} - -// ==================== 学校端套餐 ==================== +// ==================== 学校端套餐 API ==================== export interface TenantPackage { id: number; tenantId: number; - packageId: number; + collectionId: number; // 课程套餐 ID(使用 collectionId 而非 packageId) startDate: string; endDate: string; status: string; pricePaid: number; - package: CoursePackage; } -// 获取学校已授权套餐 -export function getTenantPackages() { +// 获取学校已授权课程套餐列表 +export function getTenantCollections() { return http.get('/v1/school/packages'); } -// 续订套餐 -export function renewPackage(packageId: number, data: { endDate: string; pricePaid?: number }) { - return http.post(`/v1/school/packages/${packageId}/renew`, data); +// 获取课程套餐下的课程包列表 +export function getCollectionPackages(collectionId: number | string) { + return http.get(`/v1/school/packages/${collectionId}/packages`); } + +// 获取课程包下的课程环节 +export function getPackageCourses(packageId: number | string) { + return http.get(`/v1/school/packages/${packageId}/courses`); +} + +// 续订课程套餐 +export function renewCollection(collectionId: number | string, data: { endDate: string; pricePaid?: number }) { + return http.post(`/v1/school/packages/${collectionId}/renew`, data); +} + +// ==================== 别名(保持向后兼容) ==================== +// 注意:以下是旧版 API 的别名,新代码请使用上面的新命名 + +/** @deprecated 使用 getCollectionList */ +export const getPackageList = getCollectionList; + +/** @deprecated 使用 getCollectionDetail */ +export const getPackageDetail = getCollectionDetail; + +/** @deprecated 使用 createCollection */ +export const createPackage = createCollection; + +/** @deprecated 使用 updateCollection */ +export const updatePackage = updateCollection; + +/** @deprecated 使用 deleteCollection */ +export const deletePackage = deleteCollection; + +/** @deprecated 使用 setCollectionPackages */ +export const setPackageCourses = setCollectionPackages; + +/** @deprecated 使用 submitCollection */ +export const submitPackage = submitCollection; + +/** @deprecated 使用 publishCollection */ +export const publishPackage = publishCollection; + +/** @deprecated 使用 archiveCollection */ +export const offlinePackage = archiveCollection; + +/** @deprecated 使用 rejectCollection */ +export const rejectPackage = rejectCollection; diff --git a/reading-platform-frontend/src/api/school.ts b/reading-platform-frontend/src/api/school.ts index 174d07e..6aad5ea 100644 --- a/reading-platform-frontend/src/api/school.ts +++ b/reading-platform-frontend/src/api/school.ts @@ -265,9 +265,19 @@ export const getPackageUsage = () => // ==================== 套餐管理(两层结构) ==================== -// 课程套餐(最上层) +// 课程包项(对应后端 CourseCollectionResponse.CoursePackageItem) +export interface CoursePackageItem { + id: number | string; + name: string; + description?: string; + gradeLevels: string[]; + courseCount: number; + sortOrder?: number; +} + +// 课程套餐(最上层,对应后端 CourseCollectionResponse) export interface CourseCollection { - id: number; + id: number | string; name: string; description?: string; price: number; @@ -281,20 +291,22 @@ export interface CourseCollection { submittedAt?: string; reviewedAt?: string; updatedAt?: string; - packages?: CoursePackage[]; + startDate?: string; // 开始日期(租户套餐) + endDate?: string; // 结束日期(租户套餐) + packages?: CoursePackageItem[]; // 包含的课程包列表 } -// 课程包(中间层) +// 课程包(中间层,7 步流程创建的教学资源) export interface CoursePackage { - id: number; + id: number | string; name: string; description?: string; - price: number; - discountPrice?: number; - discountType?: string; - gradeLevels: string[]; + pictureBookName?: string; + gradeTags?: string[]; + gradeLevels?: string[]; status: string; courseCount: number; + duration?: number; sortOrder?: number; courses?: Array<{ id: number; @@ -314,9 +326,9 @@ export interface RenewPackageDto { export const getCourseCollections = () => http.get('/v1/school/packages'); -// 获取课程套餐下的课程包列表 -export const getCourseCollectionPackages = (collectionId: number) => - http.get(`/v1/school/packages/${collectionId}/packages`); +// 获取课程套餐下的课程包列表(返回 CoursePackageItem 列表) +export const getCourseCollectionPackages = (collectionId: number | string) => + http.get(`/v1/school/packages/${collectionId}/packages`); // 续费课程套餐(三层架构) export const renewCollection = (collectionId: number, data: RenewPackageDto) => diff --git a/reading-platform-frontend/src/views/admin/collections/CollectionEditView.vue b/reading-platform-frontend/src/views/admin/collections/CollectionEditView.vue index 7dbcee4..1bf00f9 100644 --- a/reading-platform-frontend/src/views/admin/collections/CollectionEditView.vue +++ b/reading-platform-frontend/src/views/admin/collections/CollectionEditView.vue @@ -1,13 +1,14 @@ diff --git a/reading-platform-frontend/src/views/admin/packages/PackageDetailView.vue b/reading-platform-frontend/src/views/admin/packages/PackageDetailView.vue index e738f97..de66ec4 100644 --- a/reading-platform-frontend/src/views/admin/packages/PackageDetailView.vue +++ b/reading-platform-frontend/src/views/admin/packages/PackageDetailView.vue @@ -7,14 +7,36 @@ @@ -30,7 +52,7 @@ {{ grade }} - {{ pkg?.courseCount }} + {{ pkg?.packageCount }} {{ pkg?.tenantCount }} {{ formatDate(pkg?.createdAt) }} {{ formatDate(pkg?.publishedAt) }} @@ -40,19 +62,19 @@ 包含课程包 - + 添加课程包 @@ -81,27 +82,27 @@ - 保存 + 保存 取消 - +