7b62c2f8b4
## H5 底部导航修复 (Bug #10) - 精简 App.vue,移除重复 tabbar,仅保留全局样式 - uni-page 设置 height: calc(100% - 50px) + overflow-y: auto - 内容区域精确停在底部导航上方,独立滚动不再叠加 - 恢复 custom-tab-bar 组件 ## 项目进度文档 - PROGRESS.md 更新至 10 个 Bug 修复 - 新增 H5 底部导航修复记录 - 新增历史变更条目
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
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.services.onboarding import OnboardingService
|
|
from app.api.v1.deps import get_current_user_id
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
class OnboardingRequest(BaseModel):
|
|
name: str
|
|
description: str
|
|
category: str = ""
|
|
target: str = "US importers"
|
|
|
|
|
|
@router.get("/status")
|
|
async def get_status(
|
|
user_id: str = Depends(get_current_user_id),
|
|
db: Annotated[AsyncSession, Depends(get_db)] = None,
|
|
):
|
|
service = OnboardingService(db)
|
|
return await service.check_status(user_id)
|
|
|
|
|
|
@router.post("/product")
|
|
async def create_first_product(
|
|
data: OnboardingRequest,
|
|
user_id: str = Depends(get_current_user_id),
|
|
db: Annotated[AsyncSession, Depends(get_db)] = None,
|
|
):
|
|
if not data.name.strip():
|
|
raise HTTPException(status_code=400, detail="Product name is required")
|
|
service = OnboardingService(db)
|
|
return await service.generate_first_product(
|
|
user_id=user_id,
|
|
name=data.name.strip(),
|
|
description=data.description.strip(),
|
|
category=data.category,
|
|
target=data.target,
|
|
) |