2026-01-27 14:30:24 +08:00
|
|
|
|
"""
|
2026-03-18 17:18:23 +08:00
|
|
|
|
静态内容路由:FAQ、法律文档、官网主页。
|
2026-01-27 14:30:24 +08:00
|
|
|
|
"""
|
2026-03-19 14:36:14 +08:00
|
|
|
|
|
2026-03-18 17:18:23 +08:00
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
from typing import List
|
|
|
|
|
|
|
2026-01-27 14:30:24 +08:00
|
|
|
|
from fastapi import APIRouter
|
2026-05-22 13:44:50 +08:00
|
|
|
|
from fastapi.responses import FileResponse
|
2026-04-08 15:37:09 +08:00
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
from app.core.openapi import error_responses
|
2026-04-08 15:37:09 +08:00
|
|
|
|
from app.features.content.schemas import FAQResponse
|
2026-03-18 17:18:23 +08:00
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
router = APIRouter(tags=["content"], responses=error_responses(404))
|
2026-03-18 17:18:23 +08:00
|
|
|
|
|
|
|
|
|
|
_STATIC_DIR = Path(__file__).resolve().parent.parent.parent.parent / "static"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ── FAQ data ─────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
|
|
FAQS = [
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="1",
|
|
|
|
|
|
question="如何使用回忆录功能?",
|
|
|
|
|
|
answer="创建对话后,与AI助手交流,分享您的人生故事。AI会自动整理并生成回忆录章节。您可以在'我的回忆录'页面查看所有章节,并选择对话进行整理。",
|
|
|
|
|
|
category="使用指南",
|
|
|
|
|
|
order=1,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="2",
|
|
|
|
|
|
question="免费版和高级版有什么区别?",
|
|
|
|
|
|
answer="免费版限制3次对话和10个章节,高级版提供无限对话和章节,以及优先处理服务。高级版用户还可以享受更快的处理速度和专属客服支持。",
|
|
|
|
|
|
category="订阅计划",
|
|
|
|
|
|
order=2,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="3",
|
|
|
|
|
|
question="如何导出回忆录?",
|
|
|
|
|
|
answer="在'我的回忆录'页面,您可以查看所有章节。导出功能正在开发中,敬请期待!",
|
|
|
|
|
|
category="使用指南",
|
|
|
|
|
|
order=3,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="4",
|
|
|
|
|
|
question="数据安全吗?",
|
|
|
|
|
|
answer="我们采用加密存储,严格保护用户隐私,您的数据仅用于生成回忆录,不会用于其他用途。所有数据都经过加密处理,确保您的隐私安全。",
|
|
|
|
|
|
category="隐私安全",
|
|
|
|
|
|
order=4,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="5",
|
|
|
|
|
|
question="如何升级到高级版?",
|
|
|
|
|
|
answer="在'我的'页面点击'订阅计划',选择高级版并完成支付即可升级。升级后立即生效,享受所有高级功能。",
|
|
|
|
|
|
category="订阅计划",
|
|
|
|
|
|
order=5,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="6",
|
|
|
|
|
|
question="可以修改已生成的章节吗?",
|
|
|
|
|
|
answer="可以,在章节详情页面可以编辑内容,修改后会自动保存。您也可以重新整理对话来更新章节内容。",
|
|
|
|
|
|
category="使用指南",
|
|
|
|
|
|
order=6,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="7",
|
|
|
|
|
|
question="如何整理对话内容成章节?",
|
|
|
|
|
|
answer="在'我的回忆录'页面,点击'整理对话'按钮,选择要整理的对话,AI会自动将对话内容整理成一个个小章节。每个章节展开后可以看到详细内容。",
|
|
|
|
|
|
category="使用指南",
|
|
|
|
|
|
order=7,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="8",
|
|
|
|
|
|
question="章节是如何生成的?",
|
|
|
|
|
|
answer="AI会根据对话内容自动识别主题,将相关内容整理成章节。每个章节都有标题和详细内容,您可以随时查看和编辑。",
|
|
|
|
|
|
category="使用指南",
|
|
|
|
|
|
order=8,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="9",
|
|
|
|
|
|
question="可以删除对话或章节吗?",
|
|
|
|
|
|
answer="可以,在对话列表或章节列表中,您可以长按或点击删除按钮来删除不需要的内容。删除后无法恢复,请谨慎操作。",
|
|
|
|
|
|
category="使用指南",
|
|
|
|
|
|
order=9,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="10",
|
|
|
|
|
|
question="如何联系客服?",
|
|
|
|
|
|
answer="您可以在'我的'页面点击'反馈与客服',填写反馈表单或联系客服。我们会尽快回复您的问题。",
|
|
|
|
|
|
category="帮助支持",
|
|
|
|
|
|
order=10,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="11",
|
|
|
|
|
|
question="回忆录支持哪些格式?",
|
|
|
|
|
|
answer="目前支持文本格式的回忆录。PDF导出功能正在开发中,敬请期待!",
|
|
|
|
|
|
category="使用指南",
|
|
|
|
|
|
order=11,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="12",
|
|
|
|
|
|
question="如何备份我的数据?",
|
|
|
|
|
|
answer="您的数据会自动保存在云端,无需手动备份。导出功能正在开发中,完成后您可以导出数据到本地。",
|
|
|
|
|
|
category="数据管理",
|
|
|
|
|
|
order=12,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="13",
|
|
|
|
|
|
question="语音功能什么时候上线?",
|
|
|
|
|
|
answer="语音模块正在开发中,包括语音输入和语音播放功能。敬请期待!",
|
|
|
|
|
|
category="功能预告",
|
|
|
|
|
|
order=13,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="14",
|
|
|
|
|
|
question="可以多人协作编辑回忆录吗?",
|
|
|
|
|
|
answer="目前不支持多人协作,每个账号只能编辑自己的回忆录。多人协作功能正在规划中。",
|
|
|
|
|
|
category="功能预告",
|
|
|
|
|
|
order=14,
|
|
|
|
|
|
),
|
|
|
|
|
|
FAQResponse(
|
|
|
|
|
|
id="15",
|
|
|
|
|
|
question="如何提高回忆录的质量?",
|
|
|
|
|
|
answer="建议您详细描述每个话题,提供更多细节和感受。AI会根据您提供的信息生成更丰富、更生动的回忆录内容。",
|
|
|
|
|
|
category="使用技巧",
|
|
|
|
|
|
order=15,
|
|
|
|
|
|
),
|
|
|
|
|
|
]
|
2026-01-27 14:30:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
2026-03-18 17:18:23 +08:00
|
|
|
|
# ── Routes ───────────────────────────────────────────────────
|
2026-01-27 14:30:24 +08:00
|
|
|
|
|
2026-03-18 17:18:23 +08:00
|
|
|
|
|
|
|
|
|
|
@router.get("/api/faqs", response_model=List[FAQResponse])
|
|
|
|
|
|
async def get_faqs():
|
|
|
|
|
|
"""获取常见问题列表"""
|
|
|
|
|
|
return FAQS
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
@router.get("/api/legal/terms")
|
2026-01-27 14:30:24 +08:00
|
|
|
|
async def get_terms():
|
2026-03-18 17:18:23 +08:00
|
|
|
|
"""用户协议页面"""
|
2026-05-22 13:44:50 +08:00
|
|
|
|
return FileResponse(_STATIC_DIR / "legal" / "terms.html", media_type="text/html")
|
2026-01-27 14:30:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
@router.get("/api/legal/privacy")
|
2026-01-27 14:30:24 +08:00
|
|
|
|
async def get_privacy():
|
2026-03-18 17:18:23 +08:00
|
|
|
|
"""隐私政策页面"""
|
2026-05-22 13:44:50 +08:00
|
|
|
|
return FileResponse(_STATIC_DIR / "legal" / "privacy.html", media_type="text/html")
|
2026-03-18 17:18:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
2026-05-22 13:44:50 +08:00
|
|
|
|
@router.get("/")
|
2026-03-18 17:18:23 +08:00
|
|
|
|
async def get_home():
|
|
|
|
|
|
"""应用官网主页"""
|
2026-05-22 13:44:50 +08:00
|
|
|
|
return FileResponse(_STATIC_DIR / "home" / "index.html", media_type="text/html")
|