Decouple blog models and BlogService from shared layer
Move Post/Author/Tag/PostAuthor/PostTag/PostUser models from
shared/models/ghost_content.py to blog/models/content.py so blog-domain
models no longer live in the shared layer. Replace the shared
SqlBlogService + BlogService protocol with a blog-local singleton
(blog_service), and switch entry_associations.py from direct DB access
to HTTP fetch_data("blog", "post-by-id") to respect the inter-service
boundary.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,7 +134,7 @@ def create_app() -> "Quart":
|
||||
async def oembed():
|
||||
from urllib.parse import urlparse
|
||||
from quart import jsonify
|
||||
from shared.services.registry import services
|
||||
from services import blog_service
|
||||
from shared.infrastructure.urls import blog_url
|
||||
from shared.infrastructure.oembed import build_oembed_response
|
||||
|
||||
@@ -147,7 +147,7 @@ def create_app() -> "Quart":
|
||||
if not slug:
|
||||
return jsonify({"error": "could not extract slug"}), 404
|
||||
|
||||
post = await services.blog.get_post_by_slug(g.s, slug)
|
||||
post = await blog_service.get_post_by_slug(g.s, slug)
|
||||
if not post:
|
||||
return jsonify({"error": "not found"}), 404
|
||||
|
||||
|
||||
Reference in New Issue
Block a user