feat: 포스트를 만들 때 날씨각 캐릭터(해님·구름·달님) 댓글 1~2개 — '날씨각' 표시, 신고·차단 메뉴 없음, 이미 만든 날은 scripts/fill_bot_comments.py

This commit is contained in:
minaChoi committed 2026-10-27 13:14:30 +09:00
1 parent d32e24a5ab
commit 98b5c0cbe3
19 files changed
+864 -4

No files matched your search

+3
View File
@@ -13,7 +13,9 @@ from common.logger import LOG
from common.models.errors import error_info
from common.utils.kma_time import KST, kst_midnight, now_kst
from crud.card_crud import CardCRUD
from crud.feed_crud import FeedCRUD
from router.v1.card.protocol import CardItem, Req_CardCreate, Res_Card, Res_CardList
from services.bot_comment import fill_bot_comments
from services.external import instagram
from services.feed_service import _FEED_DAY_START, clear_feed_cache, feed_day
@@ -59,6 +61,7 @@ async def _publish(card_id: int) -> tuple[ErrorType, Res_Card]:
return err, Res_Card(result=error_info(err))
if card is None:
return ErrorType.NOT_FOUND, Res_Card(result=error_info(ErrorType.NOT_FOUND))
await fill_bot_comments(day, FeedCRUD())
await clear_feed_cache()
LOG.info(f"[card] publish {card_id} → post {card.post_id}")
return ErrorType.SUCCESS, Res_Card(card_id=card.card_id, status=CardStatus(card.status), post_id=card.post_id)
+1
View File
@@ -39,6 +39,7 @@ class CommentData(WebPacketProtocol):
like_count: int
liked: bool
mine: bool
official: bool = Field(default=False, description="날씨각 캐릭터(해님·구름·달님)가 단 댓글. 이름 옆에 '날씨각' 표시")
created_at: datetime
+1 -1
View File
@@ -21,7 +21,7 @@ router = APIRouter(prefix="/v1/reaction", tags=["reaction"])
def _comment(v: CommentView) -> CommentData:
c = v.comment
return CommentData(comment_id=c.comment_id, nickname=v.nickname, character=v.character, color=v.color, mood=v.mood, body=c.body, like_count=c.like_count, liked=v.liked, mine=v.mine, created_at=c.created_at.astimezone(KST))
return CommentData(comment_id=c.comment_id, nickname=v.nickname, character=v.character, color=v.color, mood=v.mood, body=c.body, like_count=c.like_count, liked=v.liked, mine=v.mine, official=v.official, created_at=c.created_at.astimezone(KST))
async def _like(post_id: int, who: Liker, on: bool, service: ReactionService) -> Res_PostLike: