Files
superDreamFront/app/api/v1/example.py
2026-04-15 21:35:26 +08:00

20 lines
455 B
Python

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)