create base models(users,tasks)

This commit is contained in:
IluaAir
2025-05-31 13:29:23 +03:00
parent b33a04f8fc
commit 1951260788
21 changed files with 1589 additions and 2 deletions

8
src/api/__init__.py Normal file
View File

@@ -0,0 +1,8 @@
from fastapi import APIRouter
from src.api.users import router as users_router
from src.api.tasks import router as tasks_router
router = APIRouter()
router.include_router(router=users_router)
router.include_router(router=tasks_router)

0
src/api/auth.py Normal file
View File

14
src/api/dependancies.py Normal file
View File

@@ -0,0 +1,14 @@
from typing import Annotated
from fastapi import Depends
from sqlalchemy.ext.asyncio import AsyncSession
from src.db.database import async_session_maker
async def get_db():
async with async_session_maker as db:
yield db
DBDep = Annotated[AsyncSession, Depends(get_db)]

27
src/api/tasks.py Normal file
View File

@@ -0,0 +1,27 @@
from fastapi import APIRouter
router = APIRouter(prefix="/tasks", tags=["Tasks"])
@router.get("/")
async def get_tasks(): ...
@router.get("/{task_id}")
async def get_task_id(task_id: int): ...
@router.post("/")
async def post_task(): ...
@router.put("/{task_id}")
async def put_task(task_id: int): ...
@router.patch("/{task_id}")
async def patch_task(task_id: int): ...
@router.delete("/{task_id}")
async def delete_task(task_id: int): ...

3
src/api/users.py Normal file
View File

@@ -0,0 +1,3 @@
from fastapi import APIRouter
router = APIRouter(prefix="/users", tags=["Users"])