feat: 知识库笔记工坊立项 + contributor 功能 + Fable5 视角文档
- 知识库笔记工坊子项目立项:PRD v1.0 + 寄存条 + CLAUDE.md 登记 - 后端:知识库上传记录 contributor、新增 /contributors 接口 - 前端:知识库列表支持按贡献人筛选 - 新增 Fable5 视角模式库/案例集/建议文档 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ async def upload_md_files(
|
||||
continue
|
||||
try:
|
||||
content = await f.read()
|
||||
item = svc.store_md_file(content, f.filename)
|
||||
item = svc.store_md_file(content, f.filename, contributor=current_user.display_name or current_user.username)
|
||||
results.append({
|
||||
"id": item.id,
|
||||
"title": item.title,
|
||||
@@ -93,6 +93,16 @@ def list_distinct_sources(
|
||||
return [{"source": s} for s in sources]
|
||||
|
||||
|
||||
@router.get("/contributors")
|
||||
def list_distinct_contributors(
|
||||
session: Session = Depends(get_session),
|
||||
current_user: User = Depends(require_role(UserRole.zhipianren, UserRole.zebian, UserRole.biandao)),
|
||||
):
|
||||
svc = KnowledgeService()
|
||||
contributors = svc.get_distinct_contributors()
|
||||
return [{"contributor": c} for c in contributors]
|
||||
|
||||
|
||||
@router.get("/grouped")
|
||||
def get_grouped_knowledge_items(
|
||||
session: Session = Depends(get_session),
|
||||
|
||||
Reference in New Issue
Block a user