diff --git a/backend/common/enums.py b/backend/common/enums.py index 7759acf..6aa8ae5 100644 --- a/backend/common/enums.py +++ b/backend/common/enums.py @@ -147,6 +147,9 @@ class PostType(CodeEnum): UV = 15 # 오늘 낮 자외선 (아침·낮, '보통' 이상인 날만) HERO = 16 # 히어로(오늘 날씨)의 좋아요·댓글 자리. 피드 목록엔 안 나온다 TODAY_GAK = 17 # 오늘의 각 카드의 좋아요·댓글 자리. 피드 목록엔 안 나온다 + FOLIAGE = 18 # 단풍 지도 카드의 좋아요·댓글 자리. 피드 목록엔 안 나온다 + EVENTS_BAND = 19 # 이번 주 가까운 행사 띠의 좋아요·댓글 자리 + SEASON_BAND = 20 # 이번 주 계절 이야기 띠의 좋아요·댓글 자리 class EventKind(CodeEnum): diff --git a/backend/router/v1/feed/feed.py b/backend/router/v1/feed/feed.py index 5296168..05059bd 100644 --- a/backend/router/v1/feed/feed.py +++ b/backend/router/v1/feed/feed.py @@ -22,7 +22,7 @@ async def get_feed( err, feed = await service.feed(region) if err is not ErrorType.SUCCESS: return Res_Feed(result=error_info(err)) - pinned = [x for x in (feed.hero_post, feed.gak_post) if x is not None] + pinned = [x for x in (feed.hero_post, feed.gak_post, feed.foliage_post, feed.events_post, feed.season_post) if x is not None] ids = [p.post_id for p in feed.posts] + [x.post_id for x in pinned] counts = await reactions.counts(ids) liked, saved = await reactions.marks(user, ids) diff --git a/backend/router/v1/feed/protocol.py b/backend/router/v1/feed/protocol.py index 00665a9..fd2c7a9 100644 --- a/backend/router/v1/feed/protocol.py +++ b/backend/router/v1/feed/protocol.py @@ -137,7 +137,7 @@ class PostData(WebPacketProtocol): class PostReaction(WebPacketProtocol): - """포스트 틀이 아닌 카드(히어로·오늘의 각)에 붙는 좋아요·댓글.""" + """포스트 틀이 아닌 카드(히어로·오늘의 각·단풍 지도·띠)에 붙는 좋아요·댓글.""" post_id: int like_count: int comment_count: int @@ -235,6 +235,9 @@ class Res_Feed(Res_WebPacketProtocol): posts: list[PostData] = [] hero_post: Optional[PostReaction] = None gak_post: Optional[PostReaction] = None + foliage_post: Optional[PostReaction] = None + events_post: Optional[PostReaction] = None + season_post: Optional[PostReaction] = None bands: Optional[Bands] = None diff --git a/backend/services/feed_service.py b/backend/services/feed_service.py index 1334070..22309e5 100644 --- a/backend/services/feed_service.py +++ b/backend/services/feed_service.py @@ -65,12 +65,18 @@ LINEUP = [ (20, PostType.UV, RefType.NONE, None), (21, PostType.HERO, RefType.NONE, None), (22, PostType.TODAY_GAK, RefType.NONE, None), + (23, PostType.FOLIAGE, RefType.NONE, None), + (24, PostType.EVENTS_BAND, RefType.NONE, None), + (25, PostType.SEASON_BAND, RefType.NONE, None), ] -# 피드 목록 대신 히어로·오늘의 각 카드에 좋아요·댓글만 붙는 자리 -_PINNED = {PostType.HERO: "hero_post", PostType.TODAY_GAK: "gak_post"} +# 피드 목록 대신 히어로·오늘의 각·단풍 지도·띠에 좋아요·댓글만 붙는 자리 +_PINNED = { + PostType.HERO: "hero_post", PostType.TODAY_GAK: "gak_post", PostType.FOLIAGE: "foliage_post", + PostType.EVENTS_BAND: "events_post", PostType.SEASON_BAND: "season_post", +} # 좋아요·댓글 단위. 이 종류들은 전국이 같은 카드 하나, 나머지는 그 구 데이터로 채우는 카드라 시도마다 따로 만든다. NATIONAL_SCOPE = "00" -NATIONAL_TYPES = frozenset({PostType.SEASON, PostType.TIP, PostType.QUOTE, PostType.MOON}) +NATIONAL_TYPES = frozenset({PostType.SEASON, PostType.TIP, PostType.QUOTE, PostType.MOON, PostType.FOLIAGE, PostType.SEASON_BAND}) def sido_of(region_code: str) -> str: diff --git a/frontend/src/api/client/types.gen.ts b/frontend/src/api/client/types.gen.ts index 8699d3b..7272acf 100644 --- a/frontend/src/api/client/types.gen.ts +++ b/frontend/src/api/client/types.gen.ts @@ -1192,7 +1192,7 @@ export type PostData = { /** * PostReaction * - * 포스트 틀이 아닌 카드(히어로·오늘의 각)에 붙는 좋아요·댓글. + * 포스트 틀이 아닌 카드(히어로·오늘의 각·단풍 지도·띠)에 붙는 좋아요·댓글. */ export type PostReaction = { /** @@ -1284,7 +1284,19 @@ export const PostType = { /** * TODAY_GAK */ - TODAY_GAK: 17 + TODAY_GAK: 17, + /** + * FOLIAGE + */ + FOLIAGE: 18, + /** + * EVENTS_BAND + */ + EVENTS_BAND: 19, + /** + * SEASON_BAND + */ + SEASON_BAND: 20 } as const; /** @@ -1726,6 +1738,9 @@ export type ResFeed = { posts?: Array; hero_post?: PostReaction | null; gak_post?: PostReaction | null; + foliage_post?: PostReaction | null; + events_post?: PostReaction | null; + season_post?: PostReaction | null; bands?: Bands | null; }; diff --git a/frontend/src/b/Post.tsx b/frontend/src/b/Post.tsx index 873d8bc..9e9be8b 100644 --- a/frontend/src/b/Post.tsx +++ b/frontend/src/b/Post.tsx @@ -31,6 +31,9 @@ const ACCOUNTS: Record = { [PostType.UV]: ['자외선', 'glasses'], [PostType.HERO]: ['오늘 날씨', 'sun'], [PostType.TODAY_GAK]: ['오늘의 각', 'rabbit'], + [PostType.FOLIAGE]: ['단풍 지도', 'maple'], + [PostType.EVENTS_BAND]: ['이번 주 가까운 행사', 'fireworks'], + [PostType.SEASON_BAND]: ['이번 주 계절 이야기', 'fallen_leaf'], } type Slide = HoursSlide | RowsSlide | GakSlide | SunsetSlide | WeekSlide | PlanSlide diff --git a/frontend/src/b/TodayPage.tsx b/frontend/src/b/TodayPage.tsx index d339daf..d64ba3e 100644 --- a/frontend/src/b/TodayPage.tsx +++ b/frontend/src/b/TodayPage.tsx @@ -21,7 +21,7 @@ import { InstallBanner } from './installBanner' import { MyGakRow } from './myGak' import { fromShare } from './myGakState' import { PostCard, PostCardSkel, PostFrame } from './Post' -import { usePinnedLike } from './pinnedLike' +import { usePinnedLike, type PinnedKey } from './pinnedLike' import { FeedComposer, TalkCard } from './talk' import { useFeedTalks } from './talkState' import { useRegion } from './regionContext' @@ -399,7 +399,8 @@ function Hero({ hero, post, today, ranked, all, feedLoad, todayLoad }: HeroProps -
+ {/* 다 불러온 높이(한 줄 말·날씨 한 줄·상태 두 줄)를 미리 잡아 둔다: 늦게 채워지며 아래 피드가 밀려 내려가지 않게 */} +
{top1 ? (