feat: 단풍 지도·이번 주 행사 띠·계절 이야기 띠에 좋아요·댓글(서버 포스트 자리 18·19·20), 히어로 아래 글자 칸 높이를 미리 잡아 오늘의 각부터 피드가 밀려 내려가던 문제 수정
This commit is contained in:
1 parent
eb84a72c2f
commit
03e54ad552
9 files changed
+60
-25
No files matched your search
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user