[feat] solution: 미니블로그 빌더 기능 확장 — 알림 이메일 분리·삭제·즉시발송·공급자 무관 생성
빌더 앱에서 미니블로그를 운영하는 데 필요했던 몇 가지를 묶었다. - notify_email: 업장별 승인 메일 수신자를 계정 로그인 이메일과 분리(places.notify_email, migrations/0021, PlaceCRUD·protocol.py·place_service.py 검증, BlogPostsPage.tsx 설정 UI) - 글 삭제(soft delete): 상태 제한 없이 지우고, 이미 게재된 글이면 재발행 잡까지 큐에 넣는다 (post_crud.py, router/v1/site/post.py DELETE, BlogPostsPage.tsx 삭제 버튼) - 지금 발송하기: 아침 9시 스윕을 안 기다리고 바로 발송(post_crud.next_due_for_mail, BlogPostsPage.tsx 버튼) - blog_service.generate_one: 하드코딩된 Gemini 대신 services/llm/provider.py(LLM_PROVIDER, 기본 openai)를 타도록 전환, 업종별 분기 구조(현재 숙소만 구현) 추가 - site_payload.publish_url(place, site): 발행 주소 조합을 한 곳에 모은 헬퍼 - 프론트: orval 로 재생성한 API 클라이언트(notify_email·삭제·즉시발송·social 엔드포인트 반영) 관련 스위트는 별도 커밋(쓰레드 연동 작업)에서 이미 PASS 확인함
This commit is contained in:
1 parent
adb3460c37
commit
81ea676546
24 files changed
+1813
-44
No files matched your search
@@ -9,6 +9,10 @@
|
||||
실어 보내고(services/blog_jobs.py _mail_body), 빌더 앱이 그 토큰으로 로그인한 뒤 이번
|
||||
글 편집 모달을 바로 연다(BlogPostsPage.tsx). 별도 공개 편집 화면을 두지 않는다.
|
||||
★ owner_router 는 로그인 세션이 신원이다 — 빌더 앱의 "이번 달 생성된 글" 화면.
|
||||
★★ 2026-09-21, 사장님 지시: 게재는 두 경로 다 열려 있다 — 이 파일 위쪽의 /approve
|
||||
(이메일 토큰, 로그인 없음)와, 아래 owner_router 의 POST .../approve(로그인 세션,
|
||||
"바로 발행" — 수정 없이 그대로 승인). PUT(수정)은 저장만 하고 자동으로 승인하지 않는다 —
|
||||
승인은 이 두 경로 중 하나를 명시적으로 눌러야 한다.
|
||||
"""
|
||||
from datetime import date
|
||||
from uuid import UUID
|
||||
@@ -94,7 +98,7 @@ async def get_my_post(
|
||||
return RemoveNoneResponse(await service.get_post(user_info, str(place_id), str(post_id)))
|
||||
|
||||
|
||||
@owner_router.put(path="/{post_id}", response_model=Res_WebPacketProtocol, summary="로그인 세션으로 직접 수정·승인")
|
||||
@owner_router.put(path="/{post_id}", response_model=Res_WebPacketProtocol, summary="로그인 세션으로 직접 수정 — 저장만, 승인은 이메일로")
|
||||
async def edit_my_post(
|
||||
place_id: UUID,
|
||||
post_id: UUID,
|
||||
@@ -105,7 +109,10 @@ async def edit_my_post(
|
||||
return RemoveNoneResponse(await service.edit_by_owner(user_info, str(place_id), str(post_id), req.body))
|
||||
|
||||
|
||||
@owner_router.post(path="/{post_id}/approve", response_model=Res_WebPacketProtocol, summary="바로 발행 — 고치지 않고 그대로")
|
||||
@owner_router.post(
|
||||
path="/{post_id}/approve", response_model=Res_WebPacketProtocol,
|
||||
summary="바로 발행 — 로그인 세션으로 고치지 않고 그대로(또는 방금 고친 그대로) 승인",
|
||||
)
|
||||
async def approve_my_post(
|
||||
place_id: UUID,
|
||||
post_id: UUID,
|
||||
@@ -115,6 +122,28 @@ async def approve_my_post(
|
||||
return RemoveNoneResponse(await service.approve_by_owner(user_info, str(place_id), str(post_id)))
|
||||
|
||||
|
||||
@owner_router.delete(path="/{post_id}", response_model=Res_WebPacketProtocol, summary="글 삭제 — 게재된 글이면 재발행까지 큐에 넣는다")
|
||||
async def delete_my_post(
|
||||
place_id: UUID,
|
||||
post_id: UUID,
|
||||
service: PostService = Depends(),
|
||||
user_info: UserInfo = Depends(IsValidAccessToken),
|
||||
):
|
||||
return RemoveNoneResponse(await service.delete_by_owner(user_info, str(place_id), str(post_id)))
|
||||
|
||||
|
||||
@owner_router.post(
|
||||
path="/send-now", response_model=Res_WebPacketProtocol,
|
||||
summary="지금 발송하기 — 아침 9시 스윕을 기다리지 않고 이 업장의 오늘 몫을 바로 보낸다",
|
||||
)
|
||||
async def send_my_posts_now(
|
||||
place_id: UUID,
|
||||
service: PostService = Depends(),
|
||||
user_info: UserInfo = Depends(IsValidAccessToken),
|
||||
):
|
||||
return RemoveNoneResponse(await service.send_now(user_info, str(place_id)))
|
||||
|
||||
|
||||
@owner_router.post(
|
||||
path="/generate", response_model=Res_GenerateNow,
|
||||
summary="지금 생성하기 — 새벽 크론(04:10)을 기다리지 않고, 고른 구간을 채운다",
|
||||
|
||||
Reference in new issue
Block a user