initial vibecoded... thing

This commit is contained in:
cyberbread-ru
2026-05-15 16:06:28 +04:00
commit 3b8451fa1c
9 changed files with 270 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
from typing import Optional
from app.models import Note
from app.store import NoteStore
class NoteService:
def __init__(self):
self._store = NoteStore()
def list(self) -> list[Note]:
return self._store.find_all()
def get(self, note_id: str) -> Optional[Note]:
return self._store.find_by_id(note_id)
def create(self, title: str, content: str) -> Note:
return self._store.insert(title, content)
def update(self, note_id: str, title: str, content: str) -> Optional[Note]:
return self._store.update(note_id, title, content)
def remove(self, note_id: str) -> bool:
return self._store.delete(note_id)