feat: 오늘 탭 아이콘 줄에 날씨 게임(/game) 연결, 오늘 코디 빼기, 오늘 타로는 잠시 숨김
- feat/weather-game(구름 합치기) 브랜치를 합쳐 아이콘에서 바로 열림 - 오늘 코디 아이콘·창과 그걸 위해 넣은 GET /v1/card/latest 를 걷어냄 - 오늘 타로는 features.ts HIDDEN 으로 숨김 (아이콘 줄·각 모으는 법에서 빠짐, 안내 문구에서도 타로를 뺌)
This commit is contained in:
1 parent
4cfcbcf7ea
commit
e4834fd24e
15 files changed
+18
-183
No files matched your search
@@ -14,7 +14,7 @@ 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, Res_LatestCard
|
||||
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
|
||||
@@ -82,16 +82,6 @@ async def list_cards(limit: int = Query(50, ge=1, le=200)) -> Res_CardList:
|
||||
])
|
||||
|
||||
|
||||
@router.get("/latest", response_model=Res_LatestCard, response_model_exclude_none=True, summary="그 틀로 가장 최근에 피드에 올린 카드뉴스의 포스트 (오늘 탭 '오늘 코디' 아이콘)")
|
||||
async def latest_card(template: str = Query(..., pattern=r"^[a-z_]{1,20}$")) -> Res_LatestCard:
|
||||
err, card = await DB_SESSION_MNG.execute_lambda(lambda s: _crud.latest_published(s, template))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return Res_LatestCard(result=error_info(err))
|
||||
if card is None:
|
||||
return Res_LatestCard()
|
||||
return Res_LatestCard(post_id=card.post_id, published_at=card.published_at.astimezone(KST) if card.published_at else None)
|
||||
|
||||
|
||||
@router.post("", response_model=Res_Card, response_model_exclude_none=True, summary="카드뉴스 저장 (관리자). publish 면 바로 그날 피드에 올린다", dependencies=[Depends(require_admin)])
|
||||
async def create_card(req: Req_CardCreate) -> Res_Card:
|
||||
images = _jpegs(req.images)
|
||||
|
||||
@@ -18,11 +18,6 @@ class Req_CardCreate(WebPacketProtocol):
|
||||
publish: bool = Field(default=False, description="true 면 만들자마자 그날 피드에 올린다. false 면 승인 대기")
|
||||
|
||||
|
||||
class Res_LatestCard(Res_WebPacketProtocol):
|
||||
post_id: Optional[int] = None
|
||||
published_at: Optional[datetime] = None
|
||||
|
||||
|
||||
class Res_Card(Res_WebPacketProtocol):
|
||||
card_id: Optional[int] = None
|
||||
status: Optional[CardStatus] = None
|
||||
|
||||
Reference in new issue
Block a user