23 lines
707 B
Python
23 lines
707 B
Python
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="成功") |