first commit

This commit is contained in:
xuyong
2026-04-15 21:35:26 +08:00
commit 7097fa6b44
69 changed files with 5642 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import uuid
from datetime import datetime
from typing import Dict, List, Optional
class ExampleService:
def __init__(self):
self._store: Dict[str, dict] = {}
async def list_all(self) -> List[dict]:
return list(self._store.values())
async def get_by_id(self, example_id: str) -> Optional[dict]:
return self._store.get(example_id)
async def create(self, data: dict) -> dict:
example_id = str(uuid.uuid4())
item = {
"id": example_id,
"created_at": datetime.utcnow().isoformat(),
**data,
}
self._store[example_id] = item
return item