forked from wangziqi/gongxue-base
feat: add public question bank adoption
This commit is contained in:
@@ -181,6 +181,7 @@ tenant:<tenantId>:theme
|
||||
| 租户教师 | `GET /api/tenant-admin/teachers` |
|
||||
| 租户考试日期 | `GET/PUT /api/tenant-admin/exam-dates` |
|
||||
| 租户反馈处理 | `GET /api/tenant-admin/feedbacks`、`POST /api/tenant-admin/feedbacks/status`、`GET /api/tenant-admin/feedbacks/events` |
|
||||
| 公共题库采纳 | `GET /api/tenant-content/public-question-banks`、`POST /api/tenant-content/public-question-banks/adopt` |
|
||||
|
||||
## 练习访问控制契约
|
||||
|
||||
@@ -521,6 +522,59 @@ content_entries
|
||||
- 教师可以为范围内学生创建备注和跟进任务,但是否能禁用学生、批量导入、查看手机号由后端权限和字段权限决定;前端只按返回值渲染。
|
||||
- H5 自定义域名下要注意缓存隔离,不能把 A 租户主题缓存用到 B 租户。
|
||||
|
||||
## 公共题库采纳对接
|
||||
|
||||
平台超级管理员后台使用:
|
||||
|
||||
```text
|
||||
GET /api/platform-admin/question-banks
|
||||
GET /api/platform-admin/question-bank-grants
|
||||
PUT /api/platform-admin/question-bank-grants
|
||||
```
|
||||
|
||||
授权参数建议:
|
||||
|
||||
```json
|
||||
{
|
||||
"sourceQuestionBankId": "<平台公共题库ID>",
|
||||
"grantScope": "plans",
|
||||
"allowedPlanCodes": ["starter_yearly", "pro_yearly"],
|
||||
"status": "active"
|
||||
}
|
||||
```
|
||||
|
||||
`grantScope` 可选:
|
||||
|
||||
- `plans`:按 SaaS 套餐授权。
|
||||
- `tenants`:指定租户授权。
|
||||
- `mixed`:套餐和指定租户同时生效。
|
||||
- `all_active_tenants`:所有有效订阅租户可见。
|
||||
|
||||
租户内容后台使用:
|
||||
|
||||
```text
|
||||
GET /api/tenant-content/public-question-banks
|
||||
POST /api/tenant-content/public-question-banks/adopt
|
||||
```
|
||||
|
||||
采纳请求:
|
||||
|
||||
```json
|
||||
{
|
||||
"grantId": "<授权ID>",
|
||||
"entryName": "天津专升本公共题库",
|
||||
"collectionName": "天津专升本公共题目",
|
||||
"copyLimit": 500
|
||||
}
|
||||
```
|
||||
|
||||
前端处理规则:
|
||||
|
||||
- 租户只能看到后端判定为已授权的公共题库,不要在前端用套餐码自行过滤。
|
||||
- 采纳成功后后端会生成本租户自己的 `questionBankId`、`entryId`、`collectionId` 和题目快照,学生端直接按普通 `/api/catalog/content-entries`、`question-collections`、`practice-sessions` 接入。
|
||||
- 重复采纳返回 `QUESTION_BANK_ALREADY_ADOPTED`,前端展示“已采纳”即可。
|
||||
- 当前版本是快照复制;平台公共题库后续更新不会自动进入租户题库,后续会由 worker 做版本同步、冲突处理和租户确认。
|
||||
|
||||
## 登录对接
|
||||
|
||||
### 短信登录
|
||||
|
||||
Reference in New Issue
Block a user