wip
This commit is contained in:
parent
6b1c60a550
commit
839cbd0dc0
17 changed files with 213 additions and 35 deletions
|
|
@ -11,8 +11,8 @@ hero_router = APIRouter()
|
|||
|
||||
|
||||
@hero_router.on_event("startup")
|
||||
def on_startup(config: Config = Depends(get_config)) -> None:
|
||||
SQLModel.metadata.create_all(config.database.engine)
|
||||
def on_startup() -> None:
|
||||
SQLModel.metadata.create_all(get_config().database.engine)
|
||||
|
||||
|
||||
@hero_router.get("/items/")
|
||||
|
|
@ -26,6 +26,12 @@ def get_hero(id: int, config: Config = Depends(get_config)) -> Hero:
|
|||
return Hero().get(id=id, config=config)
|
||||
|
||||
|
||||
@hero_router.get("/h/{id}")
|
||||
def get_h(id: int, config: Config = Depends(get_config)) -> Hero:
|
||||
"get one hero"
|
||||
return Hero().get(id=id, config=config)
|
||||
|
||||
|
||||
@hero_router.post("/hero/")
|
||||
def post_hero(hero: Hero, config: Config = Depends(get_config)) -> Hero:
|
||||
"read all the heros"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue