feat: 계정 레벨 — 날씨각에서 한 일로 각을 모아 레벨업, 레벨로 새 콘텐츠가 열림

- 각: 출석 10, 오늘 타로 10, 날씨 사주 10, 좋아요·댓글 5씩(하루 10), 동네 이야기 글 20, 저녁 체크인 10, 공유 10, 7일 연속 50. 같은 날 같은 대상은 한 번 (point_log)
- 레벨: 모은 총량으로 이슬 0 → 햇살 30 → 산들바람 100 → 무지개 200 → 노을 400 → 은하수 700 → 별똥별 1000. 지금 있는 기능은 잠그지 않음
- API: GET /v1/level/me, POST /v1/level/attend, POST /v1/level/share
- 화면: 헤더 아바타 레벨 배지, 내 정보 레벨 카드, 내 레벨 창(오늘 받을 각·레벨별로 열리는 것), 레벨이 오르면 축하 창
- 로그인한 사람만 쌓임 (기기 기록은 조작할 수 있어 받지 않음)
This commit is contained in:
minaChoi committed 2026-10-28 14:45:44 +09:00
1 parent 045d8d6cf0
commit 71974dcf42
27 files changed
+898 -12

No files matched your search

+6 -1
View File
@@ -14,6 +14,7 @@ from crud.feed_crud import FeedCRUD
from crud.reaction_crud import ReactionCRUD
from crud.region_crud import RegionCRUD
from services.bot_comment import BOT_COLORS, BOT_NAMES
from services.level_service import award
from services.talk_service import _LINK, _PHONE
COMMENT_MAX = 60
@@ -55,7 +56,10 @@ class ReactionService:
err = await self._post_exists(post_id)
if err is not ErrorType.SUCCESS:
return err, None
return await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.toggle_post_like(s, post_id, who, on))
err, count = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.toggle_post_like(s, post_id, who, on))
if err is ErrorType.SUCCESS and on and who.user_id is not None:
await award(who.user_id, "react", f"post:{post_id}")
return err, count
async def save_post(self, post_id: int, user: User, on: bool) -> ErrorType:
err = await self._post_exists(post_id)
@@ -139,6 +143,7 @@ class ReactionService:
return err, None
if user is None:
return err, self._view(c, None, None, None, None, False, who)
await award(user.user_id, "react", f"comment:{c.comment_id}")
return err, self._view(c, user.nickname, user.character, user.color, user.mood, False, who)
async def delete_comment(self, comment_id: int, who: Liker) -> ErrorType: