|
|
@@ -3,26 +3,32 @@ user - mobile user views
|
|
|
auther: tanlie
|
|
|
date: 2026/8/30
|
|
|
"""
|
|
|
-from fastapi import APIRouter
|
|
|
+from fastapi import APIRouter, Query, Body
|
|
|
+
|
|
|
+from app.mobile.req.user import UserLoginReq
|
|
|
|
|
|
user = APIRouter(prefix="/dgapi/mobile/user", tags=["mobile user"])
|
|
|
|
|
|
|
|
|
@user.get("/login/captcha", summary="获取验证码")
|
|
|
-def get_captcha():
|
|
|
+def get_captcha(type: int = Query(default=1, description="验证码类型,1:登录验证码,2:注册验证码")):
|
|
|
+ print(f"获取验证码,type={type}")
|
|
|
return {"message": "get captcha"}
|
|
|
|
|
|
|
|
|
@user.post("/login", summary="登录")
|
|
|
-def login():
|
|
|
+def login(req: UserLoginReq):
|
|
|
+ print(f"用户登录,请求参数:{req}")
|
|
|
return {"message": "login"}
|
|
|
|
|
|
|
|
|
@user.post("/logout", summary="登出")
|
|
|
-def logout():
|
|
|
+def logout(userId: int = Body(description="用户ID")):
|
|
|
+ print(f"用户登出,userId={userId}")
|
|
|
return {"message": "logout"}
|
|
|
|
|
|
|
|
|
@user.get("/wish-summary", summary="心愿单摘要")
|
|
|
def wish_summary():
|
|
|
+ print("获取心愿单摘要")
|
|
|
return "心愿单"
|