初始化
This commit is contained in:
23
api/lottery_api.py
Normal file
23
api/lottery_api.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from fastapi import APIRouter
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from core.db import SessionDep
|
||||
from core.dto.api_response import ApiResponse
|
||||
|
||||
# 彩票相关的路由
|
||||
lottery_router = APIRouter(prefix="/lottery", tags=["lottery"])
|
||||
|
||||
class DltQuery(BaseModel):
|
||||
""" 接口入参 """
|
||||
page: int
|
||||
page_size: int
|
||||
|
||||
model_config = ConfigDict(
|
||||
extra="forbid", # forbid:禁止多余字段; ignore:忽略; allow:允许
|
||||
frozen=False, # frozen=True 对象不可修改(冻结)
|
||||
)
|
||||
|
||||
# 大乐透相关的
|
||||
@lottery_router.get("/dlt")
|
||||
async def get_list(db: SessionDep,page: int, page_size: int) -> ApiResponse:
|
||||
# db.get()
|
||||
return ApiResponse(code=200, message="成功")
|
||||
Reference in New Issue
Block a user