7b62c2f8b4
## H5 底部导航修复 (Bug #10) - 精简 App.vue,移除重复 tabbar,仅保留全局样式 - uni-page 设置 height: calc(100% - 50px) + overflow-y: auto - 内容区域精确停在底部导航上方,独立滚动不再叠加 - 恢复 custom-tab-bar 组件 ## 项目进度文档 - PROGRESS.md 更新至 10 个 Bug 修复 - 新增 H5 底部导航修复记录 - 新增历史变更条目
35 lines
940 B
Python
35 lines
940 B
Python
from fastapi import APIRouter, Depends, HTTPException
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
from typing import Annotated
|
|
from pydantic import BaseModel
|
|
from app.database import get_db
|
|
from app.models.feedback import Feedback
|
|
from app.api.v1.deps import get_current_user_id
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
class FeedbackRequest(BaseModel):
|
|
category: str = "general"
|
|
content: str
|
|
contact: str = ""
|
|
|
|
|
|
@router.post("")
|
|
async def submit_feedback(
|
|
data: FeedbackRequest,
|
|
user_id: str = Depends(get_current_user_id),
|
|
db: Annotated[AsyncSession, Depends(get_db)] = None,
|
|
):
|
|
if not data.content.strip():
|
|
raise HTTPException(status_code=400, detail="Content is required")
|
|
|
|
fb = Feedback(
|
|
user_id=user_id,
|
|
category=data.category,
|
|
content=data.content.strip(),
|
|
contact=data.contact.strip(),
|
|
)
|
|
db.add(fb)
|
|
await db.flush()
|
|
return {"status": "ok", "id": str(fb.id)} |