first commit
This commit is contained in:
20
app/api/v1/example.py
Normal file
20
app/api/v1/example.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
from app.services.example_service import ExampleService
|
||||
|
||||
router = APIRouter()
|
||||
service = ExampleService()
|
||||
|
||||
|
||||
@router.get("/examples")
|
||||
async def list_examples():
|
||||
return await service.list_all()
|
||||
|
||||
|
||||
@router.get("/examples/{example_id}")
|
||||
async def get_example(example_id: str):
|
||||
return await service.get_by_id(example_id)
|
||||
|
||||
|
||||
@router.post("/examples")
|
||||
async def create_example(data: dict):
|
||||
return await service.create(data)
|
||||
Reference in New Issue
Block a user