feat(api): 新增自动化 API 更新工具和协作文档

- 添加 api-generator.bat/api-generator.sh 脚本,简化后端接口修改后的前端 API 同步流程
- 新增 reading-platform-frontend/README.md,说明 API 开发协作规范
- 更新 docs/开发协作指南.md,补充协作模式说明和新功能开发检查清单
- 同步最新 API 规范和生成的 TypeScript 类型代码

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
En 2026-03-09 18:04:29 +08:00
parent 32d2364c77
commit 745f4e4b06
35 changed files with 2799 additions and 1618 deletions

49
api-generator.bat Normal file
View File

@ -0,0 +1,49 @@
@echo off
REM 后端接口变更后自动更新前端 API 规范
REM 使用方式:修改接口后运行 api-generator.bat
echo === 自动更新前端 API 规格 ===
REM 检查前端目录是否存在
if not exist "reading-platform-frontend" (
echo ❌ 错误:前端目录不存在
exit /b 1
)
REM 进入前端目录
cd reading-platform-frontend
REM 检查 npm 是否安装
node --version > NUL 2>&1
if %errorlevel% neq 0 (
echo ❌ 错误:未找到 Node.js请安装 Node.js 18+
exit /b 1
)
REM 检查 package.json 中是否有 api:update 脚本
findstr "api:update" package.json > NUL
if %errorlevel% neq 0 (
echo ❌ 错误package.json 中未找到 api:update 脚本
exit /b 1
)
echo 📦 正在安装依赖...
call npm install
echo 🔄 正在拉取最新 API 规范并生成代码...
call npm run api:update
echo ✅ 完成!
REM 显示修改的文件
echo.
echo 📝 修改的文件:
git status --short
REM 提示用户检查并提交
echo.
echo 💡 请检查生成的文件,然后提交:
echo git add api-spec.yml src/api/generated/
echo git commit -m "chore(api): 同步最新接口规范"
echo git push

47
api-generator.sh Normal file
View File

@ -0,0 +1,47 @@
#!/bin/bash
# 后端接口变更后自动更新前端 API 规范
# 使用方式:修改接口后运行 ./api-generator.sh
echo "=== 自动更新前端 API 规范 ==="
# 检查前端目录是否存在
if [ ! -d "reading-platform-frontend" ]; then
echo "❌ 错误:前端目录不存在"
exit 1
fi
# 进入前端目录
cd reading-platform-frontend
# 检查 npm 是否安装
if ! npm --version > /dev/null 2>&1; then
echo "❌ 错误:未找到 npm请安装 Node.js 18+"
exit 1
fi
# 检查 package.json 中是否有 api:update 脚本
if ! grep -q "api:update" package.json; then
echo "❌ 错误package.json 中未找到 api:update 脚本"
exit 1
fi
echo "📦 正在安装依赖..."
npm install
echo "🔄 正在拉取最新 API 规范并生成代码..."
npm run api:update
echo "✅ 完成!"
# 显示修改的文件
echo ""
echo "📝 修改的文件:"
git status --short
# 提示用户检查并提交
echo ""
echo "💡 请检查生成的文件,然后提交:"
echo " git add api-spec.yml src/api/generated/"
echo " git commit -m 'chore(api): 同步最新接口规范'"
echo " git push"

View File

@ -108,10 +108,36 @@ kindergarten_java/
**前后端唯一的同步方式**:后端改了接口 → 更新 `api-spec.yml` → 前端 `git pull` → TypeScript 报错的地方 = 需要适配的地方。
### 协作模式说明
#### 为什么选择 OpenAPI 规范驱动开发?
| 协作方式 | 优点 | 缺点 | 适用场景 |
|---------|------|------|---------|
| **OpenAPI 规范驱动**(当前) | 类型安全、零沟通成本、可并行开发 | 需要遵守规范 | **推荐:常规功能开发** |
| 一人全流程开发 | 速度快(单人) | 资源浪费、难以深度优化 | 仅适用于原型验证 |
| 按模块一人包干 | 责任清晰 | 接口对齐成本高、错误发现晚 | 不推荐 |
**关键优势**
1. **类型安全** - TypeScript 自动校验接口参数和返回值
2. **零沟通成本** - 接口定义就是 contract不需要问"这个字段要不要"
3. **并行开发** - 后端写接口时,前端可以基于规范提前写页面框架
4. **自动同步** - `npm run api:update` 一键同步,不会有人用旧接口
---
## 四、后端工程师
### 新功能开发检查清单
| 步骤 | 后端工程师 | 前端工程师 | 说明 |
|-----|-----------|-----------|------|
| 1. 需求确认 | 评估接口可行性 | 评估页面结构 | 确保需求可实现 |
| 2. 接口设计 | 写 Swagger 注解 | 确认接口需求 | api-spec.yml 作为 contract |
| 3. 代码开发 | 实现 Controller | 开发 Vue 页面 | 可并行开发 |
| 4. 本地联调 | `docker compose up` | `npm run dev` | 对齐测试账号登录 |
| 5. 提交代码 | 提交后端代码 | Git Pull 后提交 | 一次性提交所有改动 |
### 开发环境要求
- Docker Desktop必须用于本地启动服务
@ -244,6 +270,27 @@ git pull # 拉取最新代码
> 如果遇到 TypeScript 编译报错,说明接口有变化,根据错误提示修改调用代码即可。**不需要问后端接口格式**,类型定义就是答案。
### 新功能开发检查清单
| 步骤 | 前端工程师 | 后端工程师 | 说明 |
|-----|-----------|-----------|------|
| 1. 需求确认 | 评估页面结构 | 评估接口可行性 | 确保需求可实现 |
| 2. 接口设计 | 确认接口需求 | 写 Swagger 注解 | api-spec.yml 作为 contract |
| 3. 代码开发 | 开发 Vue 页面 | 实现 Controller | 可并行开发 |
| 4. 本地联调 | `npm run dev` | `docker compose up` | 对齐测试账号登录 |
| 5. 提交代码 | Git Pull 后提交 | 提交后端代码 | 一次性提交所有改动 |
### 前端 Mock 数据(可选)
在后端接口未完成时,前端可基于 api-spec.yml 使用 Mock 数据:
```typescript
// 使用 mockjs 或 orval 的 mock 功能
import { mockGetStudentPage } from '@/api/generated/mock'
const { data } = await mockGetStudentPage({ page: 1, size: 10 })
```
### 新增页面
```

View File

@ -0,0 +1,121 @@
# 少儿智慧阅读平台 - 前端
Vue 3 + TypeScript + Vite + Ant Design Vue
## 重要提醒(必读)
### 🚨 接口变更后必须执行的步骤
当后端修改了 API 接口后,**必须**执行以下步骤:
```bash
# 1. 拉取最新代码
git pull
# 2. 更新 API 规范并重新生成类型代码
npm run api:update
# 3. 检查生成的文件
git status
# 应该看到 api-spec.yml 和 src/api/generated/ 下的文件有变化
# 4. 提交所有改动
git add api-spec.yml src/api/generated/
git commit -m "chore(api): 同步最新接口规范"
git push
```
### ⚠️ 如果跳过这一步会发生什么?
- TypeScript 编译报错(类型不匹配)
- 代码中会出现红色波浪线
- CI 检查无法通过
### 🔍 如何确认接口是否有变更?
```bash
# 查看最近提交
git log --oneline -10
# 查看 api-spec.yml 是否有未提交的改动
git diff api-spec.yml
# 查看生成的文件是否与远程一致
git status src/api/generated/
```
## 本地开发
### 环境要求
- Node.js 18+
- npm 9+
### 安装依赖
```bash
npm install
```
### 启动开发服务器
```bash
npm run dev
```
访问http://localhost:5173
## 构建生产版本
```bash
npm run build
```
## API 相关命令
| 命令 | 说明 |
|------|------|
| `npm run dev` | 启动开发服务器 |
| `npm run build` | 构建生产版本 |
| `npm run api:fetch` | 从后端拉取最新 API 规范 (api-spec.json) |
| `npm run api:gen` | 根据规范生成 TypeScript 代码 |
| `npm run api:update` | **拉取 + 生成**(后端改接口后必须执行) |
## 项目结构
```
reading-platform-frontend/
├── src/
│ ├── views/ # 页面组件
│ │ ├── admin/ # 超管功能
│ │ ├── school/ # 学校管理
│ │ ├── teacher/ # 教师功能
│ │ └── parent/ # 家长功能
│ ├── api/
│ │ ├── generated/ # ⚠️ 自动生成,不要手动修改
│ │ └── index.ts # axios 实例
│ └── stores/ # Pinia 状态管理
├── api-spec.yml # ⚠️ OpenAPI 规范(后端更新后提交)
└── orval.config.ts # API 代码生成配置
```
## 注意事项
1. **不要手动修改** `src/api/generated/` 下的文件
2. **不要提交** 修改后的 `api-spec.yml` 但不提交 `generated/`
3. 每次开始工作前先执行 `git pull && npm run api:update`
4. 提交代码前使用 `git status` 检查是否有多余/遗漏的文件
## 常见问题
**Q运行 `npm run api:update` 报错?**
- 确认后端正在运行http://8.148.151.56:3002
- 或者直接 `git pull` 使用已提交的规范,运行 `npm run api:gen`
**QTypeScript 报错类型不匹配?**
- 说明后端接口有变化
- 执行 `npm run api:update` 重新生成类型
**Q想查看某个接口的详细参数**
- 打开 `src/api/generated/api.ts` 查看
- 或访问 http://8.148.151.56:3002/doc.html

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v7.13.2 🍺
* Do not edit manually.
* Reading Platform API
* Reading Platform Backend Service API Documentation
* OpenAPI spec version: 1.0.0
*/
export type ApproveCourseParams = {
comment?: string;
};

View File

@ -7,15 +7,15 @@
*/
/**
* Class Create Request
*
*/
export interface ClassCreateRequest {
/** Class name */
/** 班级名称 */
name: string;
/** Grade */
/** 年级 */
grade?: string;
/** Description */
/** 描述 */
description?: string;
/** Capacity */
/** 容量 */
capacity?: number;
}

View File

@ -7,17 +7,17 @@
*/
/**
* Class Update Request
*
*/
export interface ClassUpdateRequest {
/** Class name */
/** 班级名称 */
name?: string;
/** Grade */
/** 年级 */
grade?: string;
/** Description */
/** 描述 */
description?: string;
/** Capacity */
/** 容量 */
capacity?: number;
/** Status */
/** 状态 */
status?: string;
}

View File

@ -7,83 +7,83 @@
*/
/**
* Course Create Request
*
*/
export interface CourseCreateRequest {
/** Course name */
/** 课程名称 */
name: string;
/** Course code */
/** 课程编码 */
code?: string;
/** Description */
/** 描述 */
description?: string;
/** Cover URL */
/** 封面URL */
coverUrl?: string;
/** Cover image path */
/** 封面图片路径 */
coverImagePath?: string;
/** Category */
/** 分类 */
category?: string;
/** Age range */
/** 年龄段 */
ageRange?: string;
/** Difficulty level */
/** 难度等级 */
difficultyLevel?: string;
/** Duration in minutes */
/** 时长(分钟) */
durationMinutes?: number;
/** Objectives */
/** 教学目标 */
objectives?: string;
/** Core content */
/** 核心内容 */
coreContent?: string;
/** Course summary */
/** 课程摘要 */
introSummary?: string;
/** Course highlights */
/** 课程亮点 */
introHighlights?: string;
/** Course goals */
/** 课程目标 */
introGoals?: string;
/** Content schedule */
/** 内容安排 */
introSchedule?: string;
/** Key points and difficulties */
/** 重点难点 */
introKeyPoints?: string;
/** Teaching methods */
/** 教学方法 */
introMethods?: string;
/** Evaluation methods */
/** 评估方法 */
introEvaluation?: string;
/** Notes and precautions */
/** 注意事项 */
introNotes?: string;
/** Schedule reference data (JSON) */
/** 课表参考数据JSON */
scheduleRefData?: string;
/** Environment construction content */
/** 环境创设内容 */
environmentConstruction?: string;
/** Theme ID */
/** 主题ID */
themeId?: number;
/** Picture book name */
/** 绘本名称 */
pictureBookName?: string;
/** Ebook paths (JSON array) */
/** 电子书路径JSON数组 */
ebookPaths?: string;
/** Audio paths (JSON array) */
/** 音频路径JSON数组 */
audioPaths?: string;
/** Video paths (JSON array) */
/** 视频路径JSON数组 */
videoPaths?: string;
/** Other resources (JSON array) */
/** 其他资源JSON数组 */
otherResources?: string;
/** PPT file path */
/** PPT文件路径 */
pptPath?: string;
/** PPT file name */
/** PPT文件名 */
pptName?: string;
/** Poster paths (JSON array) */
/** 海报路径JSON数组 */
posterPaths?: string;
/** Teaching tools (JSON array) */
/** 教具JSON数组 */
tools?: string;
/** Student materials */
/** 学生材料 */
studentMaterials?: string;
/** Lesson plan data (JSON) */
/** 教案数据JSON */
lessonPlanData?: string;
/** Activities data (JSON) */
/** 活动数据JSON */
activitiesData?: string;
/** Assessment data (JSON) */
/** 评估数据JSON */
assessmentData?: string;
/** Grade tags (JSON array) */
/** 年级标签JSON数组 */
gradeTags?: string;
/** Domain tags (JSON array) */
/** 领域标签JSON数组 */
domainTags?: string;
/** Has collective lesson */
/** 是否有集体课 */
hasCollectiveLesson?: boolean;
}

View File

@ -7,85 +7,85 @@
*/
/**
* Course Update Request
*
*/
export interface CourseUpdateRequest {
/** Course name */
/** 课程名称 */
name?: string;
/** Course code */
/** 课程编码 */
code?: string;
/** Description */
/** 描述 */
description?: string;
/** Cover URL */
/** 封面URL */
coverUrl?: string;
/** Cover image path */
/** 封面图片路径 */
coverImagePath?: string;
/** Category */
/** 分类 */
category?: string;
/** Age range */
/** 年龄段 */
ageRange?: string;
/** Difficulty level */
/** 难度等级 */
difficultyLevel?: string;
/** Duration in minutes */
/** 时长(分钟) */
durationMinutes?: number;
/** Objectives */
/** 教学目标 */
objectives?: string;
/** Status */
/** 状态 */
status?: string;
/** Core content */
/** 核心内容 */
coreContent?: string;
/** Course summary */
/** 课程摘要 */
introSummary?: string;
/** Course highlights */
/** 课程亮点 */
introHighlights?: string;
/** Course goals */
/** 课程目标 */
introGoals?: string;
/** Content schedule */
/** 内容安排 */
introSchedule?: string;
/** Key points and difficulties */
/** 重点难点 */
introKeyPoints?: string;
/** Teaching methods */
/** 教学方法 */
introMethods?: string;
/** Evaluation methods */
/** 评估方法 */
introEvaluation?: string;
/** Notes and precautions */
/** 注意事项 */
introNotes?: string;
/** Schedule reference data (JSON) */
/** 课表参考数据JSON */
scheduleRefData?: string;
/** Environment construction content */
/** 环境创设内容 */
environmentConstruction?: string;
/** Theme ID */
/** 主题ID */
themeId?: number;
/** Picture book name */
/** 绘本名称 */
pictureBookName?: string;
/** Ebook paths (JSON array) */
/** 电子书路径JSON数组 */
ebookPaths?: string;
/** Audio paths (JSON array) */
/** 音频路径JSON数组 */
audioPaths?: string;
/** Video paths (JSON array) */
/** 视频路径JSON数组 */
videoPaths?: string;
/** Other resources (JSON array) */
/** 其他资源JSON数组 */
otherResources?: string;
/** PPT file path */
/** PPT文件路径 */
pptPath?: string;
/** PPT file name */
/** PPT文件名 */
pptName?: string;
/** Poster paths (JSON array) */
/** 海报路径JSON数组 */
posterPaths?: string;
/** Teaching tools (JSON array) */
/** 教具JSON数组 */
tools?: string;
/** Student materials */
/** 学生材料 */
studentMaterials?: string;
/** Lesson plan data (JSON) */
/** 教案数据JSON */
lessonPlanData?: string;
/** Activities data (JSON) */
/** 活动数据JSON */
activitiesData?: string;
/** Assessment data (JSON) */
/** 评估数据JSON */
assessmentData?: string;
/** Grade tags (JSON array) */
/** 年级标签JSON数组 */
gradeTags?: string;
/** Domain tags (JSON array) */
/** 领域标签JSON数组 */
domainTags?: string;
/** Has collective lesson */
/** 是否有集体课 */
hasCollectiveLesson?: boolean;
}

View File

@ -11,4 +11,5 @@ page?: number;
pageSize?: number;
keyword?: string;
category?: string;
status?: string;
};

View File

@ -7,7 +7,7 @@
*/
export type GetPackages1Params = {
pageNum?: number;
page?: number;
pageSize?: number;
keyword?: string;
status?: string;

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v7.13.2 🍺
* Do not edit manually.
* Reading Platform API
* Reading Platform Backend Service API Documentation
* OpenAPI spec version: 1.0.0
*/
export type GetReviewCoursePageParams = {
page?: number;
pageSize?: number;
};

View File

@ -7,7 +7,7 @@
*/
/**
* Growth Record Create Request
*
*/
export interface GrowthRecordCreateRequest {
/** Student ID */

View File

@ -7,19 +7,19 @@
*/
/**
* Growth Record Update Request
*
*/
export interface GrowthRecordUpdateRequest {
/** Type */
/** 类型 */
type?: string;
/** Title */
/** 标题 */
title?: string;
/** Content */
/** 内容 */
content?: string;
/** Images (JSON array) */
/** 图片JSON数组 */
images?: string;
/** Record date */
/** 记录日期 */
recordDate?: string;
/** Tags */
/** 标签 */
tags?: string[];
}

View File

@ -6,6 +6,7 @@
* OpenAPI spec version: 1.0.0
*/
export * from './approveCourseParams';
export * from './bindStudentParams';
export * from './changePasswordParams';
export * from './classCreateRequest';
@ -40,6 +41,7 @@ export * from './getPackagesParams';
export * from './getParentPageParams';
export * from './getPopularCoursesParams';
export * from './getRecentGrowthRecordsParams';
export * from './getReviewCoursePageParams';
export * from './getSchedulePlans1Params';
export * from './getSchedulePlansParams';
export * from './getScheduleTemplatesParams';
@ -80,6 +82,7 @@ export * from './pageResultTenant';
export * from './parent';
export * from './parentCreateRequest';
export * from './parentUpdateRequest';
export * from './rejectCourseParams';
export * from './resetPassword1Params';
export * from './resetPasswordParams';
export * from './resourceItem';
@ -137,6 +140,7 @@ export * from './resultTheme';
export * from './resultUserInfoResponse';
export * from './resultVoid';
export * from './resultVoidData';
export * from './reviewPackageBody';
export * from './schedulePlan';
export * from './scheduleTemplate';
export * from './schoolCourse';

View File

@ -8,23 +8,23 @@
import type { LocalTime } from './localTime';
/**
* Lesson Create Request
*
*/
export interface LessonCreateRequest {
/** Course ID */
/** 课程ID */
courseId: number;
/** Class ID */
/** 班级ID */
classId?: number;
/** Teacher ID */
/** 教师ID */
teacherId: number;
/** Lesson title */
/** 课时标题 */
title: string;
/** Lesson date */
/** 课时日期 */
lessonDate: string;
startTime?: LocalTime;
endTime?: LocalTime;
/** Location */
/** 地点 */
location?: string;
/** Notes */
/** 备注 */
notes?: string;
}

View File

@ -8,7 +8,7 @@
import type { LocalTime } from './localTime';
/**
* Lesson Update Request
*
*/
export interface LessonUpdateRequest {
/** Lesson title */

View File

@ -7,13 +7,13 @@
*/
/**
* Login Request
*
*/
export interface LoginRequest {
/** Username */
/** 用户名 */
username: string;
/** Password */
/** 密码 */
password: string;
/** Login role */
/** 登录角色 */
role?: string;
}

View File

@ -7,19 +7,19 @@
*/
/**
* Login Response
*
*/
export interface LoginResponse {
/** JWT Token */
/** JWT令牌 */
token?: string;
/** User ID */
/** 用户ID */
userId?: number;
/** Username */
/** 用户名 */
username?: string;
/** User name */
/** 用户姓名 */
name?: string;
/** User role */
/** 用户角色 */
role?: string;
/** Tenant ID */
/** 租户ID */
tenantId?: number;
}

View File

@ -10,16 +10,16 @@
* Parent Create Request
*/
export interface ParentCreateRequest {
/** Username */
/** 用户名 */
username: string;
/** Password */
/** 密码 */
password: string;
/** Name */
/** 姓名 */
name: string;
/** Phone */
/** 电话 */
phone?: string;
/** Email */
/** 邮箱 */
email?: string;
/** Gender */
/** 性别 */
gender?: string;
}

View File

@ -7,19 +7,19 @@
*/
/**
* Parent Update Request
*
*/
export interface ParentUpdateRequest {
/** Name */
/** 姓名 */
name?: string;
/** Phone */
/** 电话 */
phone?: string;
/** Email */
/** 邮箱 */
email?: string;
/** Avatar URL */
/** 头像URL */
avatarUrl?: string;
/** Gender */
/** 性别 */
gender?: string;
/** Status */
/** 状态 */
status?: string;
}

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v7.13.2 🍺
* Do not edit manually.
* Reading Platform API
* Reading Platform Backend Service API Documentation
* OpenAPI spec version: 1.0.0
*/
export type RejectCourseParams = {
comment?: string;
};

View File

@ -0,0 +1,9 @@
/**
* Generated by orval v7.13.2 🍺
* Do not edit manually.
* Reading Platform API
* Reading Platform Backend Service API Documentation
* OpenAPI spec version: 1.0.0
*/
export type ReviewPackageBody = {[key: string]: { [key: string]: unknown }};

View File

@ -7,7 +7,7 @@
*/
/**
* Student Create Request
*
*/
export interface StudentCreateRequest {
/** Name */

View File

@ -7,27 +7,27 @@
*/
/**
* Student Update Request
*
*/
export interface StudentUpdateRequest {
/** Name */
/** 姓名 */
name?: string;
/** Gender */
/** 性别 */
gender?: string;
/** Birth date */
/** 出生日期 */
birthDate?: string;
/** Avatar URL */
/** 头像URL */
avatarUrl?: string;
/** Grade */
/** 年级 */
grade?: string;
/** Student number */
/** 学号 */
studentNo?: string;
/** Reading level */
/** 阅读水平 */
readingLevel?: string;
/** Interests */
/** 兴趣爱好 */
interests?: string;
/** Notes */
/** 备注 */
notes?: string;
/** Status */
/** 状态 */
status?: string;
}

View File

@ -7,25 +7,25 @@
*/
/**
* Task Create Request
*
*/
export interface TaskCreateRequest {
/** Task title */
/** 任务标题 */
title: string;
/** Description */
/** 描述 */
description?: string;
/** Task type: reading, homework, activity */
/** 任务类型: 阅读、作业、活动 */
type?: string;
/** Course ID */
/** 课程ID */
courseId?: number;
/** Start date */
/** 开始日期 */
startDate?: string;
/** Due date */
/** 截止日期 */
dueDate?: string;
/** Attachments (JSON array) */
/** 附件JSON数组 */
attachments?: string;
/** Target type: class, student */
/** 目标类型: 班级、学生 */
targetType?: string;
/** Target IDs */
/** 目标ID列表 */
targetIds?: number[];
}

View File

@ -7,21 +7,21 @@
*/
/**
* Task Update Request
*
*/
export interface TaskUpdateRequest {
/** Task title */
/** 任务标题 */
title?: string;
/** Description */
/** 描述 */
description?: string;
/** Task type */
/** 任务类型 */
type?: string;
/** Start date */
/** 开始日期 */
startDate?: string;
/** Due date */
/** 截止日期 */
dueDate?: string;
/** Status */
/** 状态 */
status?: string;
/** Attachments (JSON array) */
/** 附件JSON数组 */
attachments?: string;
}

View File

@ -7,21 +7,21 @@
*/
/**
* Teacher Create Request
*
*/
export interface TeacherCreateRequest {
/** Username */
/** 用户名 */
username: string;
/** Password */
/** 密码 */
password: string;
/** Name */
/** 姓名 */
name: string;
/** Phone */
/** 电话 */
phone?: string;
/** Email */
/** 邮箱 */
email?: string;
/** Gender */
/** 性别 */
gender?: string;
/** Bio */
/** 个人简介 */
bio?: string;
}

View File

@ -7,21 +7,21 @@
*/
/**
* Teacher Update Request
*
*/
export interface TeacherUpdateRequest {
/** Name */
/** 姓名 */
name?: string;
/** Phone */
/** 电话 */
phone?: string;
/** Email */
/** 邮箱 */
email?: string;
/** Avatar URL */
/** 头像URL */
avatarUrl?: string;
/** Gender */
/** 性别 */
gender?: string;
/** Bio */
/** 个人简介 */
bio?: string;
/** Status */
/** 状态 */
status?: string;
}

View File

@ -7,33 +7,33 @@
*/
/**
* Tenant Create Request
*
*/
export interface TenantCreateRequest {
/** Tenant name */
/** 租户名称 */
name: string;
/** Tenant code / login account */
/** 租户编码 / 登录账号 */
code: string;
/** Contact person */
/** 联系人 */
contactName?: string;
/** Contact phone */
/** 联系电话 */
contactPhone?: string;
/** Contact email */
/** 联系邮箱 */
contactEmail?: string;
/** Address */
/** 地址 */
address?: string;
/** Logo URL */
logoUrl?: string;
/** Expiration date */
/** 过期日期 */
expireAt?: string;
/** Max students */
/** 最大学生数 */
maxStudents?: number;
/** Max teachers */
/** 最大教师数 */
maxTeachers?: number;
/** Initial password (default: 123456) */
/** 初始密码(默认: 123456 */
password?: string;
/** Package type (optional) */
/** 套餐类型(可选) */
packageType?: string;
/** Start date (optional) */
/** 开始日期(可选) */
startDate?: string;
}

View File

@ -7,33 +7,33 @@
*/
/**
* Tenant Response
*
*/
export interface TenantResponse {
/** Tenant ID */
/** 租户ID */
id?: number;
/** Tenant name */
/** 租户名称 */
name?: string;
/** Login account (tenant code) */
/** 登录账号(租户编码) */
loginAccount?: string;
/** Contact person */
/** 联系人 */
contactPerson?: string;
/** Contact phone */
/** 联系电话 */
contactPhone?: string;
/** Contact email */
/** 联系邮箱 */
contactEmail?: string;
/** Address */
/** 地址 */
address?: string;
/** Logo URL */
logoUrl?: string;
/** Status */
/** 状态 */
status?: string;
/** Expiration date */
/** 过期日期 */
expireDate?: string;
/** Max students / student quota */
/** 最大学生数 / 学生配额 */
studentQuota?: number;
/** Max teachers / teacher quota */
/** 最大教师数 / 教师配额 */
teacherQuota?: number;
/** Created at */
/** 创建时间 */
createdAt?: string;
}

View File

@ -7,31 +7,31 @@
*/
/**
* Tenant Update Request
*
*/
export interface TenantUpdateRequest {
/** Tenant name */
/** 租户名称 */
name?: string;
/** Contact person */
/** 联系人 */
contactName?: string;
/** Contact phone */
/** 联系电话 */
contactPhone?: string;
/** Contact email */
/** 联系邮箱 */
contactEmail?: string;
/** Address */
/** 地址 */
address?: string;
/** Logo URL */
logoUrl?: string;
/** Status */
/** 状态 */
status?: string;
/** Expiration date */
/** 过期日期 */
expireAt?: string;
/** Max students */
/** 最大学生数 */
maxStudents?: number;
/** Max teachers */
/** 最大教师数 */
maxTeachers?: number;
/** Package type (optional) */
/** 套餐类型(可选) */
packageType?: string;
/** Start date (optional) */
/** 开始日期(可选) */
startDate?: string;
}

View File

@ -7,23 +7,23 @@
*/
/**
* User Info Response
*
*/
export interface UserInfoResponse {
/** User ID */
/** 用户ID */
id?: number;
/** Username */
/** 用户名 */
username?: string;
/** User name */
/** 用户姓名 */
name?: string;
/** Email */
/** 邮箱 */
email?: string;
/** Phone */
/** 电话 */
phone?: string;
/** Avatar URL */
/** 头像URL */
avatarUrl?: string;
/** User role */
/** 用户角色 */
role?: string;
/** Tenant ID */
/** 租户ID */
tenantId?: number;
}