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:
1 parent
045d8d6cf0
commit
71974dcf42
27 files changed
+898
-12
No files matched your search
@@ -363,6 +363,7 @@ class User(Base):
|
||||
status: Mapped[int] = mapped_column(SmallInteger, default=1)
|
||||
terms_agreed_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), nullable=True)
|
||||
token_version: Mapped[int] = mapped_column(SmallInteger, default=1)
|
||||
points: Mapped[int] = mapped_column(Integer, default=0)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
deleted: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
@@ -453,6 +454,18 @@ class MyGak(Base):
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class PointLog(Base):
|
||||
__tablename__ = "point_log"
|
||||
|
||||
point_id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True))
|
||||
day: Mapped[date] = mapped_column(Date)
|
||||
action: Mapped[str] = mapped_column(String(20))
|
||||
ref: Mapped[str] = mapped_column(String(40), default="")
|
||||
points: Mapped[int] = mapped_column(SmallInteger)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class FortuneDraw(Base):
|
||||
__tablename__ = "fortune_draw"
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import uuid
|
||||
from datetime import date
|
||||
|
||||
from sqlalchemy import func, select, update
|
||||
from sqlalchemy.dialects.postgresql import insert
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from common.database.model.models import PointLog, User
|
||||
|
||||
|
||||
class LevelCRUD:
|
||||
async def earned(self, s: AsyncSession, user_id: uuid.UUID, day: date, action: str) -> int:
|
||||
return await s.scalar(select(func.coalesce(func.sum(PointLog.points), 0)).where(PointLog.user_id == user_id, PointLog.day == day, PointLog.action == action))
|
||||
|
||||
async def add(self, s: AsyncSession, user_id: uuid.UUID, day: date, action: str, ref: str, points: int) -> int:
|
||||
"""같은 날 같은 일·대상이면 넣지 않는다. 넣었으면 총량에 더하고 새 총량을 돌려준다 (안 넣었으면 0)"""
|
||||
row = await s.scalar(insert(PointLog).values(user_id=user_id, day=day, action=action, ref=ref, points=points).on_conflict_do_nothing().returning(PointLog.point_id))
|
||||
if row is None:
|
||||
return 0
|
||||
return await s.scalar(update(User).where(User.user_id == user_id).values(points=User.points + points).returning(User.points))
|
||||
|
||||
async def today(self, s: AsyncSession, user_id: uuid.UUID, day: date) -> dict[str, int]:
|
||||
rows = (await s.execute(select(PointLog.action, func.sum(PointLog.points)).where(PointLog.user_id == user_id, PointLog.day == day).group_by(PointLog.action))).all()
|
||||
return {a: int(p) for a, p in rows}
|
||||
|
||||
async def attend_days(self, s: AsyncSession, user_id: uuid.UUID, since: date) -> list[date]:
|
||||
return list((await s.scalars(select(PointLog.day).where(PointLog.user_id == user_id, PointLog.action == "attend", PointLog.day >= since))).all())
|
||||
|
||||
async def points(self, s: AsyncSession, user_id: uuid.UUID) -> int:
|
||||
return await s.scalar(select(User.points).where(User.user_id == user_id)) or 0
|
||||
@@ -318,6 +318,19 @@ CREATE TABLE IF NOT EXISTS public.my_gak (
|
||||
CREATE INDEX IF NOT EXISTS ix_my_gak_user ON public.my_gak (user_id);
|
||||
ALTER TABLE public.my_gak ADD COLUMN IF NOT EXISTS icon VARCHAR(32) NULL; -- 고른 아이콘 (각 아이콘 이름, 없으면 기본)
|
||||
|
||||
-- 계정 레벨: 날씨각에서 한 일로 모은 각 (로그인한 사람만). 레벨은 모은 총량으로 정하고, 같은 날 같은 일·대상은 한 번만 준다
|
||||
CREATE TABLE IF NOT EXISTS public.point_log (
|
||||
point_id BIGSERIAL PRIMARY KEY,
|
||||
user_id UUID NOT NULL,
|
||||
day DATE NOT NULL,
|
||||
action VARCHAR(20) NOT NULL, -- services/level_service.py ACTIONS
|
||||
ref VARCHAR(40) NOT NULL DEFAULT '', -- 같은 날 같은 대상 중복 막기 (post:12 등)
|
||||
points SMALLINT NOT NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS uq_point_log ON public.point_log (user_id, day, action, ref);
|
||||
ALTER TABLE public.users ADD COLUMN IF NOT EXISTS points INTEGER NOT NULL DEFAULT 0; -- 모은 각 총량 (point_log 합)
|
||||
|
||||
-- 오늘 한 장: 로그인한 사람이 그날 뽑은 카드 (하루 한 장, 로그인 안 하면 기기에만 남는다)
|
||||
CREATE TABLE IF NOT EXISTS public.fortune_draw (
|
||||
user_id UUID NOT NULL,
|
||||
|
||||
@@ -15,6 +15,7 @@ from router.v1.image.image import router as image_router
|
||||
from router.v1.index.index import router as index_router
|
||||
from router.v1.my_gak.my_gak import router as my_gak_router
|
||||
from router.v1.fortune.fortune import router as fortune_router
|
||||
from router.v1.level.level import router as level_router
|
||||
from router.v1.reaction.reaction import router as reaction_router
|
||||
from router.v1.region.region import router as region_router
|
||||
from router.v1.season.season import router as season_router
|
||||
@@ -50,6 +51,7 @@ app.include_router(auth_router)
|
||||
app.include_router(reaction_router)
|
||||
app.include_router(my_gak_router)
|
||||
app.include_router(fortune_router)
|
||||
app.include_router(level_router)
|
||||
app.include_router(talk_router)
|
||||
app.include_router(watch_router)
|
||||
app.include_router(image_router)
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,35 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from common.auth import current_user
|
||||
from common.database.model.models import User
|
||||
from common.enums import ErrorType
|
||||
from common.models.errors import error_info
|
||||
from router.v1.level.protocol import LevelAction, LevelStep, LevelUnlock, Res_Level
|
||||
from services.level_service import LEVELS, LevelService, Status
|
||||
|
||||
router = APIRouter(prefix="/v1/level", tags=["level"])
|
||||
|
||||
|
||||
def _res(err: ErrorType, st: Status | None) -> Res_Level:
|
||||
if err is not ErrorType.SUCCESS or st is None:
|
||||
return Res_Level(result=error_info(err))
|
||||
return Res_Level(
|
||||
points=st.points, level=st.level, name=st.name, floor=st.floor, next_points=st.next_points, next_name=st.next_name, streak=st.streak,
|
||||
today=[LevelAction(**a.__dict__) for a in st.today], unlocks=[LevelUnlock(level=lv, key=k, name=n) for lv, k, n in st.unlocks],
|
||||
levels=[LevelStep(level=i + 1, name=n, points=p) for i, (p, n) in enumerate(LEVELS)],
|
||||
)
|
||||
|
||||
|
||||
@router.get("/me", response_model=Res_Level, response_model_exclude_none=True, summary="내 레벨: 모은 각, 다음 레벨, 오늘 받은 각, 레벨로 열리는 것")
|
||||
async def my_level(user: User = Depends(current_user), service: LevelService = Depends()) -> Res_Level:
|
||||
return _res(*await service.status(user))
|
||||
|
||||
|
||||
@router.post("/attend", response_model=Res_Level, response_model_exclude_none=True, summary="출석 (하루 한 번 각). 7일 이어지면 보너스")
|
||||
async def attend(user: User = Depends(current_user), service: LevelService = Depends()) -> Res_Level:
|
||||
return _res(*await service.attend(user))
|
||||
|
||||
|
||||
@router.post("/share", response_model=Res_Level, response_model_exclude_none=True, summary="공유를 마쳤을 때 (하루 한 번 각)")
|
||||
async def shared(user: User = Depends(current_user), service: LevelService = Depends()) -> Res_Level:
|
||||
return _res(*await service.share(user))
|
||||
@@ -0,0 +1,38 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
||||
|
||||
|
||||
class LevelAction(WebPacketProtocol):
|
||||
action: str
|
||||
name: str
|
||||
points: int = Field(description="한 번에 주는 각")
|
||||
cap: int = Field(description="하루 한도")
|
||||
earned: int = Field(description="오늘 받은 각")
|
||||
|
||||
|
||||
class LevelUnlock(WebPacketProtocol):
|
||||
level: int
|
||||
key: str
|
||||
name: str
|
||||
|
||||
|
||||
class LevelStep(WebPacketProtocol):
|
||||
level: int
|
||||
name: str
|
||||
points: int = Field(description="이 레벨이 되는 각 총량")
|
||||
|
||||
|
||||
class Res_Level(Res_WebPacketProtocol):
|
||||
points: int = Field(0, description="모은 각 총량")
|
||||
level: int = 1
|
||||
name: Optional[str] = None
|
||||
floor: int = Field(0, description="지금 레벨이 시작하는 각")
|
||||
next_points: Optional[int] = Field(None, description="다음 레벨에 필요한 총량 (마지막 레벨이면 없음)")
|
||||
next_name: Optional[str] = None
|
||||
streak: int = Field(0, description="이어 출석한 날")
|
||||
today: list[LevelAction] = []
|
||||
unlocks: list[LevelUnlock] = []
|
||||
levels: list[LevelStep] = Field([], description="레벨 전체 (이름·필요한 각)")
|
||||
@@ -16,6 +16,7 @@ from crud.fortune_crud import FortuneCRUD
|
||||
from services.calc.day_slot import SLOTS, slot_hours
|
||||
from services.calc.sun import sun_times
|
||||
from services.index_service import IndexService, current_slot, shown_slot
|
||||
from services.level_service import award
|
||||
from services.week_service import WeekService
|
||||
|
||||
# 오늘 한 장 덱: 각 코드마다 리딩 한 문장과 행운 색. 이름·아이콘은 각 정의에서 가져온다
|
||||
@@ -152,6 +153,7 @@ class FortuneService:
|
||||
if err is not ErrorType.SUCCESS or row is None:
|
||||
return err, None
|
||||
code = row.card_code
|
||||
await award(user.user_id, "tarot")
|
||||
err, n = await self._streak(user, today)
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, None
|
||||
@@ -174,7 +176,10 @@ class FortuneService:
|
||||
if values is None:
|
||||
return ErrorType.INVALID_INPUT, None
|
||||
today = now_kst().date()
|
||||
return await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.save_log(s, user.user_id, today, values))
|
||||
err, log = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.save_log(s, user.user_id, today, values))
|
||||
if err is ErrorType.SUCCESS:
|
||||
await award(user.user_id, "checkin")
|
||||
return err, log
|
||||
|
||||
async def import_local(self, user: User, draws: list[tuple[date, str]], logs: list[tuple[date, dict]]) -> ErrorType:
|
||||
"""로그인할 때 기기에 있던 뽑은 카드·체크인을 계정으로. 최근 60일, 덱에 있는 카드, 형식이 맞는 체크인만"""
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
import uuid
|
||||
from dataclasses import dataclass
|
||||
from datetime import date, timedelta
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import Depends
|
||||
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.database.model.models import User
|
||||
from common.enums import ErrorType
|
||||
from common.logger import LOG
|
||||
from common.utils.kma_time import now_kst
|
||||
from crud.level_crud import LevelCRUD
|
||||
|
||||
# 계정 레벨: 모은 각 총량으로 정한다 (쓰는 기능이 생겨도 레벨은 안 내려간다). 사용자 결정 10/28
|
||||
LEVELS: list[tuple[int, str]] = [(0, "이슬"), (30, "햇살"), (100, "산들바람"), (200, "무지개"), (400, "노을"), (700, "은하수"), (1000, "별똥별")]
|
||||
|
||||
# 각을 주는 일: (한 번에 주는 각, 하루 한도, 이름). 로그인한 사람만 쌓인다
|
||||
ACTIONS: dict[str, tuple[int, int, str]] = {
|
||||
"attend": (10, 10, "출석"),
|
||||
"tarot": (10, 10, "오늘 타로 뽑기"),
|
||||
"saju": (10, 10, "날씨 사주 오늘 기운"),
|
||||
"react": (5, 10, "좋아요·댓글"),
|
||||
"talk": (20, 20, "동네 이야기 글쓰기"),
|
||||
"checkin": (10, 10, "저녁 체크인"),
|
||||
"share": (10, 10, "공유하기"),
|
||||
"streak": (50, 50, "7일 연속 출석"),
|
||||
}
|
||||
STREAK_DAYS = 7
|
||||
STREAK_LOOKBACK = 60
|
||||
|
||||
# 레벨로 열리는 것: 새로 생기는 것만 잠근다 (지금 있는 기능·캐릭터·색·기분은 그대로)
|
||||
UNLOCKS: dict[int, list[tuple[str, str]]] = {
|
||||
2: [("saju_week", "날씨 사주 이번 주 흐름")],
|
||||
3: [("saju_money", "금전운 · 일운")],
|
||||
4: [("saju_love", "연애운")],
|
||||
5: [("saju_match", "궁합")],
|
||||
6: [("saju_month", "이달 운")],
|
||||
7: [("saju_year", "올해 운")],
|
||||
}
|
||||
|
||||
|
||||
def level_of(points: int) -> int:
|
||||
return max(i + 1 for i, (need, _) in enumerate(LEVELS) if points >= need)
|
||||
|
||||
|
||||
def unlock_level(key: str) -> int:
|
||||
return next((lv for lv, items in UNLOCKS.items() if any(k == key for k, _ in items)), 1)
|
||||
|
||||
|
||||
def is_unlocked(points: int, key: str) -> bool:
|
||||
return level_of(points) >= unlock_level(key)
|
||||
|
||||
|
||||
def streak(days: set[date], today: date) -> int:
|
||||
"""오늘부터 거꾸로 이어 출석한 날 수"""
|
||||
n = 0
|
||||
while today - timedelta(days=n) in days:
|
||||
n += 1
|
||||
return n
|
||||
|
||||
|
||||
async def award(user_id: uuid.UUID, action: str, ref: str = "") -> int:
|
||||
"""각을 준다. 하루 한도·같은 대상 중복이면 주지 않는다. 본래 동작을 막지 않게 실패는 로그만 남긴다. 새 총량(안 줬으면 0)"""
|
||||
per, cap, _ = ACTIONS[action]
|
||||
day = now_kst().date()
|
||||
crud = LevelCRUD()
|
||||
err, earned = await DB_SESSION_MNG.execute_lambda(lambda s: crud.earned(s, user_id, day, action))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
LOG.error(f"[level] 각 조회 실패 {action}")
|
||||
return 0
|
||||
if earned >= cap:
|
||||
return 0
|
||||
points = min(per, cap - earned)
|
||||
err, total = await DB_SESSION_MNG.execute_lambda_write(lambda s: crud.add(s, user_id, day, action, ref, points))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
LOG.error(f"[level] 각 적립 실패 {action}")
|
||||
return 0
|
||||
if action == "attend" and total:
|
||||
err, days = await DB_SESSION_MNG.execute_lambda(lambda s: crud.attend_days(s, user_id, day - timedelta(days=STREAK_LOOKBACK)))
|
||||
n = streak(set(days or []), day) if err is ErrorType.SUCCESS else 0
|
||||
if n and n % STREAK_DAYS == 0:
|
||||
more = await award(user_id, "streak", str(n))
|
||||
total = more or total
|
||||
return total or 0
|
||||
|
||||
|
||||
@dataclass
|
||||
class TodayAction:
|
||||
action: str
|
||||
name: str
|
||||
points: int # 한 번에 주는 각
|
||||
cap: int
|
||||
earned: int
|
||||
|
||||
|
||||
@dataclass
|
||||
class Status:
|
||||
points: int
|
||||
level: int
|
||||
name: str
|
||||
floor: int # 지금 레벨이 시작하는 각
|
||||
next_points: Optional[int] # 다음 레벨까지 필요한 총량 (마지막 레벨이면 없음)
|
||||
next_name: Optional[str]
|
||||
streak: int
|
||||
today: list[TodayAction]
|
||||
unlocks: list[tuple[int, str, str]] # (레벨, 키, 이름)
|
||||
|
||||
|
||||
class LevelService:
|
||||
def __init__(self, crud: LevelCRUD = Depends(LevelCRUD)) -> None:
|
||||
self.crud = crud
|
||||
|
||||
async def status(self, user: User) -> tuple[ErrorType, Optional[Status]]:
|
||||
day = now_kst().date()
|
||||
err, points = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.points(s, user.user_id))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, None
|
||||
err, today = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.today(s, user.user_id, day))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, None
|
||||
err, days = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.attend_days(s, user.user_id, day - timedelta(days=STREAK_LOOKBACK)))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, None
|
||||
lv = level_of(points)
|
||||
floor, name = LEVELS[lv - 1]
|
||||
nxt = LEVELS[lv] if lv < len(LEVELS) else None
|
||||
return ErrorType.SUCCESS, Status(
|
||||
points=points, level=lv, name=name, floor=floor, next_points=nxt[0] if nxt else None, next_name=nxt[1] if nxt else None,
|
||||
streak=streak(set(days), day),
|
||||
today=[TodayAction(action=a, name=n, points=p, cap=c, earned=(today or {}).get(a, 0)) for a, (p, c, n) in ACTIONS.items() if a != "streak"],
|
||||
unlocks=[(lv_, k, n) for lv_, items in UNLOCKS.items() for k, n in items],
|
||||
)
|
||||
|
||||
async def attend(self, user: User) -> tuple[ErrorType, Optional[Status]]:
|
||||
await award(user.user_id, "attend")
|
||||
return await self.status(user)
|
||||
|
||||
async def share(self, user: User) -> tuple[ErrorType, Optional[Status]]:
|
||||
await award(user.user_id, "share")
|
||||
return await self.status(user)
|
||||
@@ -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:
|
||||
|
||||
@@ -14,6 +14,7 @@ from common.utils.kma_time import kst_midnight, now_kst
|
||||
from crud.region_crud import RegionCRUD
|
||||
from crud.talk_crud import TalkCRUD
|
||||
from crud.weather_crud import WeatherCRUD
|
||||
from services.level_service import award
|
||||
from services.talk_image import is_ours
|
||||
|
||||
BODY_MAX = 100
|
||||
@@ -204,6 +205,7 @@ class TalkService:
|
||||
err, t = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.add(s, user.user_id, region_code, body, weather, image, topic.value))
|
||||
if err is not ErrorType.SUCCESS or t is None:
|
||||
return err, None
|
||||
await award(user.user_id, "talk", str(t.talk_id))
|
||||
return ErrorType.SUCCESS, TalkView(talk=t, author=user, region_name=region.short_name, liked=False, mine=True)
|
||||
|
||||
async def delete(self, user: User, talk_id: int) -> ErrorType:
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
from datetime import timedelta
|
||||
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
from sqlalchemy import select
|
||||
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.database.model.models import PointLog, User
|
||||
from common.utils.kma_time import now_kst
|
||||
from router.router import app
|
||||
from services.level_service import LEVELS, is_unlocked, level_of
|
||||
|
||||
REGION = "1144000000"
|
||||
pytestmark = pytest.mark.usefixtures("no_bot_comments")
|
||||
|
||||
|
||||
def client():
|
||||
return AsyncClient(transport=ASGITransport(app=app), base_url="http://test")
|
||||
|
||||
|
||||
async def _login(c, login_id: str) -> dict:
|
||||
body = (await c.post("/v1/auth/signup", json={"login_id": login_id, "password": "password1", "nickname": login_id})).json()
|
||||
h = {"Authorization": f"Bearer {body['access_token']}"}
|
||||
await c.post("/v1/auth/terms", headers=h)
|
||||
return h
|
||||
|
||||
|
||||
def _earned(level: dict, action: str) -> int:
|
||||
return next(a["earned"] for a in level["today"] if a["action"] == action)
|
||||
|
||||
|
||||
def test_level_thresholds_and_unlocks():
|
||||
assert [need for need, _ in LEVELS] == [0, 30, 100, 200, 400, 700, 1000]
|
||||
assert level_of(0) == 1 and level_of(29) == 1 and level_of(30) == 2 and level_of(199) == 3 and level_of(200) == 4 and level_of(5000) == 7
|
||||
assert not is_unlocked(199, "saju_love") and is_unlocked(200, "saju_love")
|
||||
assert not is_unlocked(399, "saju_match") and is_unlocked(400, "saju_match")
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_actions_award_once_and_respect_daily_caps(offline):
|
||||
async with client() as c:
|
||||
assert (await c.get("/v1/level/me")).status_code == 401
|
||||
h = await _login(c, "level_01")
|
||||
me = (await c.get("/v1/level/me", headers=h)).json()
|
||||
assert me["points"] == 0 and me["level"] == 1 and me["name"] == "이슬" and me["next_points"] == 30
|
||||
|
||||
# 출석은 하루 한 번
|
||||
assert (await c.post("/v1/level/attend", headers=h)).json()["points"] == 10
|
||||
assert (await c.post("/v1/level/attend", headers=h)).json()["points"] == 10
|
||||
|
||||
# 좋아요·댓글은 5각씩 하루 10각, 같은 글을 다시 눌러도 더 안 줌
|
||||
posts = [p["post_id"] for p in (await c.get("/v1/feed", params={"region": REGION})).json()["posts"][:3]]
|
||||
await c.post(f"/v1/reaction/post/{posts[0]}/like", headers=h)
|
||||
await c.delete(f"/v1/reaction/post/{posts[0]}/like", headers=h)
|
||||
await c.post(f"/v1/reaction/post/{posts[0]}/like", headers=h)
|
||||
assert _earned((await c.get("/v1/level/me", headers=h)).json(), "react") == 5
|
||||
await c.post(f"/v1/reaction/post/{posts[1]}/comment", json={"body": "오늘 노을 기대돼요"}, headers=h)
|
||||
await c.post(f"/v1/reaction/post/{posts[2]}/like", headers=h)
|
||||
me = (await c.get("/v1/level/me", headers=h)).json()
|
||||
assert _earned(me, "react") == 10 and me["points"] == 20
|
||||
|
||||
# 오늘 타로는 하루 한 번, 동네 이야기 글 20각 → 50각이면 Lv.2
|
||||
await c.post("/v1/fortune/draw", json={"region_code": REGION}, headers=h)
|
||||
await c.post("/v1/fortune/draw", json={"region_code": REGION}, headers=h)
|
||||
await c.post("/v1/talk", json={"region_code": REGION, "body": "오늘 하늘 맑아요"}, headers=h)
|
||||
me = (await c.get("/v1/level/me", headers=h)).json()
|
||||
assert _earned(me, "tarot") == 10 and _earned(me, "talk") == 20
|
||||
assert me["points"] == 50 and me["level"] == 2 and me["name"] == "햇살" and me["floor"] == 30 and me["next_points"] == 100
|
||||
|
||||
# 저녁 체크인·공유도 하루 한 번
|
||||
await c.put("/v1/fortune/log", json={"region_code": REGION, "mood": 2, "went_out": False}, headers=h)
|
||||
await c.put("/v1/fortune/log", json={"region_code": REGION, "mood": 3, "went_out": False}, headers=h)
|
||||
await c.post("/v1/level/share", headers=h)
|
||||
assert (await c.post("/v1/level/share", headers=h)).json()["points"] == 70
|
||||
|
||||
# 로그인 안 한 좋아요는 각이 없다 (다른 사람 계정에도 안 쌓임)
|
||||
await c.post(f"/v1/reaction/post/{posts[0]}/like", headers={"X-Forwarded-For": "203.0.113.50"})
|
||||
assert (await c.get("/v1/level/me", headers=h)).json()["points"] == 70
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_seven_day_attendance_bonus(offline):
|
||||
async with client() as c:
|
||||
h = await _login(c, "level_02")
|
||||
await c.post("/v1/level/attend", headers=h)
|
||||
today = now_kst().date()
|
||||
|
||||
async def backfill(s):
|
||||
uid = await s.scalar(select(User.user_id).where(User.login_id == "level_02"))
|
||||
s.add_all([PointLog(user_id=uid, day=today - timedelta(days=d), action="attend", ref="", points=10) for d in range(1, 7)])
|
||||
|
||||
await DB_SESSION_MNG.execute_lambda_write(backfill)
|
||||
# 오늘 출석이 이미 있으니 다시 불러도 보너스가 생기지 않는다 → 다음 날처럼 오늘 기록을 지우고 다시 출석
|
||||
async def drop_today(s):
|
||||
uid = await s.scalar(select(User.user_id).where(User.login_id == "level_02"))
|
||||
row = await s.scalar(select(PointLog).where(PointLog.user_id == uid, PointLog.day == today))
|
||||
await s.delete(row)
|
||||
user = await s.get(User, uid)
|
||||
user.points -= 10
|
||||
|
||||
await DB_SESSION_MNG.execute_lambda_write(drop_today)
|
||||
me = (await c.post("/v1/level/attend", headers=h)).json()
|
||||
# 지난 6일은 장부만 넣어 총량엔 없다: 오늘 출석 10 + 7일 연속 50
|
||||
assert me["streak"] == 7 and me["points"] == 60
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -10,6 +10,7 @@ import { AuthProvider } from './auth'
|
||||
import { RegionProvider } from './region'
|
||||
import { useAuth } from './authContext'
|
||||
import { preloadGoogle } from './googleScript'
|
||||
import { LevelBadge, LevelWatcher } from './level'
|
||||
import { useRegion } from './regionContext'
|
||||
import { useSheet } from './sheetContext'
|
||||
import { SheetProvider } from './Sheets'
|
||||
@@ -75,8 +76,9 @@ function TopBar() {
|
||||
{IS_TOSS ? null : mePending ? (
|
||||
<Skel shape className="size-9 shrink-0 rounded-full" />
|
||||
) : me ? (
|
||||
<button type="button" onClick={() => open({ type: 'me' })} aria-label={`내 정보, ${me.nickname}`} className="shrink-0 cursor-pointer rounded-full shadow-[0_6px_12px_rgb(40_48_74/0.12)]">
|
||||
<button type="button" onClick={() => open({ type: 'me' })} aria-label={`내 정보, ${me.nickname}`} className="relative shrink-0 cursor-pointer rounded-full shadow-[0_6px_12px_rgb(40_48_74/0.12)]">
|
||||
<Avatar character={me.character} color={me.color} mood={me.mood} size={36} />
|
||||
<LevelBadge />
|
||||
</button>
|
||||
) : (
|
||||
<button type="button" onClick={() => open({ type: 'login' })} className="shrink-0 cursor-pointer rounded-full bg-(--ink) px-3 py-1.5 text-[13px] font-extrabold text-white">
|
||||
@@ -318,6 +320,7 @@ export function BLayout() {
|
||||
<SheetProvider>
|
||||
<Shell />
|
||||
<TossIntro />
|
||||
<LevelWatcher />
|
||||
</SheetProvider>
|
||||
</RegionProvider>
|
||||
</AuthProvider>
|
||||
|
||||
@@ -38,6 +38,7 @@ import { ARTICLE_CAT, SHEET_CLOSE_MS, SHEET_OPEN_MS } from './lib'
|
||||
import { MixSheet, MyGakSheet } from './myGak'
|
||||
import { TarotSheet } from './fortune'
|
||||
import { OotdSheet } from './todayIcons'
|
||||
import { LevelCard, LevelSheet, LevelUpSheet, useShareReward } from './level'
|
||||
import { ownPage, useRegion } from './regionContext'
|
||||
import { WeatherWhySheet } from './weatherWhy'
|
||||
import { useSky } from './skyContext'
|
||||
@@ -88,7 +89,7 @@ export function SheetProvider({ children }: { children: ReactNode }) {
|
||||
)
|
||||
}
|
||||
|
||||
const TITLES = { article: '읽을거리', seasonWeek: '이번 주 특집', share: '보내기', comments: '댓글', login: '로그인', me: '내 정보', region: '지역 바꾸기', install: '홈 화면에 추가', weatherWhy: '날씨 점수는 이렇게 나와요', talk: '이야기', tarot: '오늘 타로', ootd: '오늘 코디' } as const
|
||||
const TITLES = { article: '읽을거리', seasonWeek: '이번 주 특집', share: '보내기', comments: '댓글', login: '로그인', me: '내 정보', region: '지역 바꾸기', install: '홈 화면에 추가', weatherWhy: '날씨 점수는 이렇게 나와요', talk: '이야기', tarot: '오늘 타로', ootd: '오늘 코디', level: '내 레벨', levelUp: '레벨이 올랐어요' } as const
|
||||
|
||||
/** 아래에서 올라오는 창: 네이티브 <dialog>라 ESC·포커스 가두기·포커스 되돌리기가 기본으로 된다 */
|
||||
function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void }) {
|
||||
@@ -177,6 +178,8 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void
|
||||
{shown.type === 'weatherWhy' && <WeatherWhySheet d={shown.why} />}
|
||||
{shown.type === 'tarot' && <TarotSheet />}
|
||||
{shown.type === 'ootd' && <OotdSheet />}
|
||||
{shown.type === 'level' && <LevelSheet />}
|
||||
{shown.type === 'levelUp' && <LevelUpSheet level={shown.level} />}
|
||||
{shown.type === 'talk' && <TalkSheet talk={shown.talk} />}
|
||||
</div>
|
||||
)}
|
||||
@@ -558,6 +561,7 @@ const SIZE_KEYS = Object.keys(SHARE_SIZES) as ShareSize[]
|
||||
|
||||
function ShareSheet({ share }: { share: SharePayload }) {
|
||||
const { region } = useRegion()
|
||||
const reward = useShareReward()
|
||||
const { kind } = useSky()
|
||||
const [size, setSize] = useState<ShareSize>('story')
|
||||
const [images, setImages] = useState<Partial<Record<ShareSize, { blob: Blob; src: string }>>>({})
|
||||
@@ -604,6 +608,7 @@ function ShareSheet({ share }: { share: SharePayload }) {
|
||||
(r) => {
|
||||
setToast(r === 'saved' ? '이미지를 저장하고 링크를 보냈어요' : '링크를 보냈어요')
|
||||
track('share', { content_type: 'image', item_id: share.title, method: 'share_sheet', ratio: SHARE_SIZES[size].ratio })
|
||||
reward()
|
||||
},
|
||||
(e: unknown) => {
|
||||
console.error('[share] toss', e)
|
||||
@@ -624,6 +629,7 @@ function ShareSheet({ share }: { share: SharePayload }) {
|
||||
async () => {
|
||||
setToast((await copied) ? '보냈어요. 링크도 복사해 뒀어요' : '보냈어요')
|
||||
track('share', { content_type: 'image', item_id: share.title, method: 'share_sheet', ratio: SHARE_SIZES[size].ratio })
|
||||
reward()
|
||||
},
|
||||
(e: unknown) => {
|
||||
if (e instanceof DOMException && e.name === 'AbortError') return
|
||||
@@ -1163,6 +1169,7 @@ function MeSheet({ onDone }: { onDone: () => void }) {
|
||||
<Avatar character={me.character} color={me.color} mood={me.mood} size={64} />
|
||||
<p className="m-0 text-center text-sm font-semibold text-(--ink2)">{me.provider === AuthProvider.TOSS ? '토스로 로그인했어요' : me.provider === AuthProvider.GOOGLE ? '구글 계정으로 로그인했어요' : `${me.login_id}(으)로 로그인했어요`}</p>
|
||||
</div>
|
||||
<LevelCard />
|
||||
{installable && (
|
||||
<button type="button" onClick={() => install('menu')} className="cursor-pointer rounded-2xl bg-[#fff4ec] py-2.5 font-jua text-[15.5px] text-(--orange)">
|
||||
📲 홈 화면에 추가
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { attendMutation, myLevelOptions, myLevelQueryKey, sharedMutation } from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
|
||||
import type { ResLevel } from '@nalssigak/shared/api/client/types.gen'
|
||||
import { cx } from '../lib/utils'
|
||||
import { useAuth } from './authContext'
|
||||
import { useSheet } from './sheetContext'
|
||||
import { Ic } from './ui'
|
||||
|
||||
// 레벨마다 보여 줄 하늘 아이콘 (이름은 서버 LEVELS)
|
||||
const LEVEL_ICON = ['droplet', 'sun', 'leaf', 'rainbow', 'sunset', 'milky_way', 'shooting_star']
|
||||
export const levelIcon = (level: number) => LEVEL_ICON[Math.min(Math.max(level, 1), LEVEL_ICON.length) - 1]
|
||||
|
||||
const SEEN_KEY = 'nalssigak.b.levelSeen'
|
||||
|
||||
/** 서버 응답에서 기본값이 있는 칸은 생략될 수 있어 채워 둔다 */
|
||||
export type Level = ResLevel & { points: number; level: number; floor: number; streak: number }
|
||||
|
||||
const toLevel = (d: ResLevel): Level | undefined => (d.result?.success ? { ...d, points: d.points ?? 0, level: d.level ?? 1, floor: d.floor ?? 0, streak: d.streak ?? 0 } : undefined)
|
||||
|
||||
/** 내 레벨 (로그인했을 때만). 각을 주는 일은 모두 mutation 이라 끝날 때마다 다시 받는다(main.tsx) */
|
||||
export function useLevel() {
|
||||
const { loggedIn } = useAuth()
|
||||
return useQuery({ ...myLevelOptions(), enabled: loggedIn, staleTime: 60_000, select: toLevel })
|
||||
}
|
||||
|
||||
/** 다음 레벨까지 진행률 0~1 */
|
||||
export function progress(l: Level) {
|
||||
if (l.next_points == null) return 1
|
||||
return Math.min(1, (l.points - l.floor) / (l.next_points - l.floor))
|
||||
}
|
||||
|
||||
/** 다음 레벨에서 열리는 것 이름 */
|
||||
export const nextUnlock = (l: Level) => (l.unlocks ?? []).filter((u) => u.level === l.level + 1).map((u) => u.name)
|
||||
|
||||
/** 로그인한 사람이 앱을 열면 하루 한 번 출석 각. 레벨이 오르면 축하 창을 띄운다 (레이아웃에 한 번 둔다) */
|
||||
export function LevelWatcher() {
|
||||
const { loggedIn, me } = useAuth()
|
||||
const { open } = useSheet()
|
||||
const queryClient = useQueryClient()
|
||||
const level = useLevel().data
|
||||
const { mutate } = useMutation({ ...attendMutation() })
|
||||
const attended = useRef<string | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!loggedIn || !me || attended.current === me.login_id) return
|
||||
attended.current = me.login_id
|
||||
mutate({}, { onSuccess: (res) => res.result?.success && queryClient.setQueryData(myLevelQueryKey(), res) })
|
||||
}, [loggedIn, me, mutate, queryClient])
|
||||
|
||||
useEffect(() => {
|
||||
if (!level || !me) return
|
||||
const key = `${SEEN_KEY}.${me.login_id}`
|
||||
let seen: number | null = null
|
||||
try {
|
||||
seen = Number(localStorage.getItem(key)) || null
|
||||
localStorage.setItem(key, String(level.level))
|
||||
} catch (e) {
|
||||
console.warn('[level] 본 레벨을 저장하지 못함', e)
|
||||
}
|
||||
// 처음 보는 기기에선 축하하지 않는다 (예전 레벨을 모름)
|
||||
if (seen != null && level.level > seen) open({ type: 'levelUp', level: level.level })
|
||||
}, [level, me, open])
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/** 공유를 마치면 하루 한 번 각 (로그인했을 때만) */
|
||||
export function useShareReward() {
|
||||
const { loggedIn } = useAuth()
|
||||
const { mutate } = useMutation({ ...sharedMutation() })
|
||||
return () => {
|
||||
if (loggedIn) mutate({})
|
||||
}
|
||||
}
|
||||
|
||||
/** 헤더 아바타 옆 작은 레벨 표시 */
|
||||
export function LevelBadge() {
|
||||
const level = useLevel().data
|
||||
if (!level) return null
|
||||
return <span className="pointer-events-none absolute -right-1.5 -bottom-1.5 rounded-full bg-(--ink) px-1.5 text-[9.5px] leading-4 font-extrabold text-white ring-2 ring-white">Lv.{level.level}</span>
|
||||
}
|
||||
|
||||
function Bar({ value }: { value: number }) {
|
||||
return (
|
||||
<span className="block h-2 overflow-hidden rounded-full bg-[#eef1f6]">
|
||||
<span className="block h-full rounded-full bg-[linear-gradient(90deg,#ffb27a,var(--orange))]" style={{ width: `${Math.round(value * 100)}%` }} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
/** 내 정보 위쪽: 레벨·모은 각·다음 레벨에서 열리는 것. link 가 있으면 '각 모으는 법'으로 내 레벨 창을 연다 */
|
||||
export function LevelCard({ link = true }: { link?: boolean }) {
|
||||
const level = useLevel().data
|
||||
const { open } = useSheet()
|
||||
if (!level) return null
|
||||
const unlock = nextUnlock(level)
|
||||
return (
|
||||
<section aria-label="내 레벨" className="rounded-2xl bg-[#fff6ef] px-3.5 py-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Ic name={levelIcon(level.level)} className="size-7" />
|
||||
<b className="font-jua text-[16px] font-normal">
|
||||
Lv.{level.level} {level.name}
|
||||
</b>
|
||||
<b className="ml-auto font-bagel text-[15px] font-normal">{level.points}각</b>
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
<Bar value={progress(level)} />
|
||||
</div>
|
||||
<div className="mt-1.5 flex items-center justify-between gap-2 text-xs font-bold text-(--ink2)">
|
||||
<span>
|
||||
{level.next_points != null ? `${level.next_points - level.points}각 더 모으면 Lv.${level.level + 1} ${level.next_name}` : '가장 높은 레벨이에요'}
|
||||
{unlock.length > 0 && <b className="text-(--orange)"> · {unlock.join(', ')}</b>}
|
||||
</span>
|
||||
{link && (
|
||||
<button type="button" onClick={() => open({ type: 'level' })} className="shrink-0 cursor-pointer text-(--orange)">
|
||||
각 모으는 법 ›
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
/** 내 레벨 창: 오늘 받을 수 있는 각, 레벨마다 열리는 것 */
|
||||
export function LevelSheet() {
|
||||
const level = useLevel().data
|
||||
if (!level) return null
|
||||
const steps = (level.unlocks ?? []).reduce<Record<number, string[]>>((m, u) => ({ ...m, [u.level]: [...(m[u.level] ?? []), u.name] }), {})
|
||||
return (
|
||||
<div className="flex flex-col gap-4 px-4 pb-4">
|
||||
<LevelCard link={false} />
|
||||
<section>
|
||||
<h4 className="m-0 mb-2 text-sm font-extrabold">오늘 받을 수 있는 각</h4>
|
||||
<ul className="m-0 list-none rounded-2xl bg-white p-0 shadow-[inset_0_-4px_0_var(--shade)]">
|
||||
{(level.today ?? []).map((a) => {
|
||||
const done = a.earned >= a.cap
|
||||
return (
|
||||
<li key={a.action} className="flex items-center gap-2.5 border-b border-[#eef1f6] px-3.5 py-2.5 text-[13.5px] font-bold last:border-0">
|
||||
<span className={cx('grid size-5 place-items-center rounded-full text-[11px] text-white', done ? 'bg-[#1f9d62]' : 'bg-[#dfe5ef]')}>{done ? '✓' : ''}</span>
|
||||
<span className={cx(done && 'text-(--ink3) line-through')}>{a.name}</span>
|
||||
<span className="ml-auto font-bagel text-[13px] font-normal text-(--orange)">
|
||||
{a.earned > 0 && a.cap > a.points ? `${a.earned}/${a.cap}` : `+${a.points}`}각
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
<p className="m-0 mt-1.5 text-xs font-semibold text-(--ink3)">{level.streak > 0 ? `${level.streak}일 이어 출석 · 7일마다 +50각` : '7일 이어 출석하면 +50각'}</p>
|
||||
</section>
|
||||
<section>
|
||||
<h4 className="m-0 mb-2 text-sm font-extrabold">레벨이 오르면 열려요</h4>
|
||||
<ol className="m-0 flex list-none flex-col gap-1.5 p-0">
|
||||
{(level.levels ?? []).map(({ level: lv, name, points }) => {
|
||||
const reached = level.level >= lv
|
||||
return (
|
||||
<li key={lv} className={cx('flex items-center gap-2.5 rounded-xl px-2.5 py-2', lv === level.level ? 'bg-[#fff6ef]' : '')}>
|
||||
<Ic name={levelIcon(lv)} className={cx('size-7', !reached && 'opacity-40 grayscale')} />
|
||||
<span className="min-w-0 flex-1">
|
||||
<b className="block text-[13.5px] font-extrabold">
|
||||
Lv.{lv} {name} <span className="font-semibold text-(--ink3)">· {points}각</span>
|
||||
</b>
|
||||
<span className="block text-xs font-semibold text-(--ink2)">{lv === 1 ? '지금 있는 기능 전부' : (steps[lv] ?? []).join(', ')}</span>
|
||||
</span>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ol>
|
||||
</section>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** 레벨이 오른 순간 */
|
||||
export function LevelUpSheet({ level: lv }: { level: number }) {
|
||||
const level = useLevel().data
|
||||
const { open } = useSheet()
|
||||
const opened = (level?.unlocks ?? []).filter((u) => u.level === lv).map((u) => u.name)
|
||||
const name = level?.levels?.find((l) => l.level === lv)?.name
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-2 px-6 pt-2 pb-6 text-center">
|
||||
<Ic name={levelIcon(lv)} className="size-24" />
|
||||
<b className="font-jua text-[28px] font-normal">
|
||||
Lv.{lv} {name}
|
||||
</b>
|
||||
{opened.length > 0 && <p className="m-0 text-[15px] font-bold text-(--ink2)">새로 열렸어요: {opened.join(', ')}</p>}
|
||||
<button type="button" onClick={() => open({ type: 'level' })} className="mt-3 w-full cursor-pointer rounded-full bg-(--orange) py-3 text-[15px] font-extrabold text-white">
|
||||
내 레벨 보기
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import type { CSSProperties } from 'react'
|
||||
import { ARTICLE_LABEL } from '@nalssigak/shared/lib'
|
||||
|
||||
const SHARED = new Set(['bear', 'bike', 'bronze', 'camping', 'carwash', 'chimaek', 'cloud', 'coldwind', 'delivery', 'dog', 'garden', 'glasses', 'gold', 'hiking', 'iced_hot', 'jjamppong', 'laundry', 'letter', 'makeup', 'makgeolli', 'maple', 'moon', 'muggy', 'naengmyeon', 'photo', 'picnic', 'rabbit', 'rain', 'running', 'silver', 'snow', 'stars', 'sun_cloud', 'sun', 'sunset', 'taxi', 'umbrella', 'vent', 'walk', 'yajang', 'baseball', 'study', 'netflix', 'chestnut', 'peanut', 'tangerine', 'sweet_potato', 'fallen_leaf', 'kimchi', 'apple', 'mask', 'golf', 'jipkok', 'fishing', 'drive', 'kite', 'waterplay', 'riverwind', 'trot', 'pajeon', 'bingsu', 'blanket', 'indoordry', 'flower', 'bungeoppang', 'singing_rain', 'hangang', 'themepark', 'date', 'frizz', 'boiler', 'sunscreen', 'mosquito', 'tennis', 'hyodo', 'thanks', 'gift', 'party', 'game', 'selfie', 'sentimental', 'ginkgo'])
|
||||
const OWN = new Set(['fireworks', 'bulb', 'calendar', 'thermo', 'sheaf', 'popup', 'exhibition', 'concert', 'crystal_ball', 'tshirt', 'clapper', 'speech'])
|
||||
const OWN = new Set(['fireworks', 'bulb', 'calendar', 'thermo', 'sheaf', 'popup', 'exhibition', 'concert', 'crystal_ball', 'tshirt', 'clapper', 'speech', 'droplet', 'leaf', 'rainbow', 'milky_way', 'shooting_star'])
|
||||
|
||||
/** 아이콘 이름 → 파일 경로 (공용 public/icons, B 전용 public/b/icons). 'none'(데이터 없는 칸)은 그림 없음 */
|
||||
export function iconSrc(name: string) {
|
||||
|
||||
@@ -23,6 +23,8 @@ export type SheetState =
|
||||
| { type: 'talk'; talk: TalkData }
|
||||
| { type: 'tarot' }
|
||||
| { type: 'ootd' }
|
||||
| { type: 'level' }
|
||||
| { type: 'levelUp'; level: number }
|
||||
| null
|
||||
|
||||
export type SheetApi = { open: (s: Exclude<SheetState, null>) => void; close: () => void }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { keepPreviousData, QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { keepPreviousData, MutationCache, QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { myLevelQueryKey } from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
@@ -11,8 +12,10 @@ import { track } from './lib/analytics'
|
||||
for (const type of ['gesturestart', 'gesturechange']) document.addEventListener(type, (e) => e.preventDefault(), { passive: false })
|
||||
|
||||
// 칩·지역·검색어를 바꿔 다시 받는 동안 이전 결과를 그대로 두어 화면이 비거나 접히지 않게 한다
|
||||
const queryClient = new QueryClient({
|
||||
const queryClient: QueryClient = new QueryClient({
|
||||
defaultOptions: { queries: { staleTime: 5 * 60 * 1000, retry: 1, refetchOnWindowFocus: false, placeholderData: keepPreviousData } },
|
||||
// 각을 주는 일(타로·좋아요·댓글·글·체크인·공유)은 모두 mutation 이라, 끝나면 내 레벨을 다시 받는다
|
||||
mutationCache: new MutationCache({ onSuccess: () => queryClient.invalidateQueries({ queryKey: myLevelQueryKey() }) }),
|
||||
})
|
||||
|
||||
// 홈 화면 설치 조건(서비스 워커)과, 홈 화면 아이콘으로 연 횟수
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/react-query';
|
||||
|
||||
import { client } from '../client.gen';
|
||||
import { addComment, addMyGak, addTalk, agreeTerms, authConfig, blockAuthor, blockTalkAuthor, createCard, createReel, deleteComment, deleteMyGak, deleteTalk, drawFortune, getArticle, getCardImage, getFeed, getFortuneToday, getImage, getIndex, getPost, getReelCover, getReelVideo, getSeasonWeek, getSky, getSkyRanking, getTalkImage, getTodayGuPage, getTodayPage, getTomorrowGuPage, getTomorrowPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, importFortune, latestCard, likeComment, likePost, likeTalk, listArticles, listBlocked, listCards, listComments, listEvents, listIndices, listMyGak, listMyTalks, listPlaces, listPresets, listReels, listRegions, listSaved, listShorts, listTalks, login, logout, me, nearestRegion, type Options, publishCard, publishInstagram, publishInstagram2, refresh, rejectCard, reportComment, reportTalk, saveDayLog, savePost, scoreMyGak, searchFortunePlaces, signup, talkGroups, toss, tossUnlink, unblock, unlikeComment, unlikePost, unlikeTalk, unsavePost, updateMe, uploadTalkImage, withdraw } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, AddMyGakData, AddMyGakError, AddMyGakResponse, AddTalkData, AddTalkError, AddTalkResponse, AgreeTermsData, AgreeTermsError, AgreeTermsResponse, AuthConfigData, AuthConfigResponse, BlockAuthorData, BlockAuthorError, BlockAuthorResponse, BlockTalkAuthorData, BlockTalkAuthorError, BlockTalkAuthorResponse, CreateCardData, CreateCardError, CreateCardResponse, CreateReelData, CreateReelError, CreateReelResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, DeleteMyGakData, DeleteMyGakError, DeleteMyGakResponse, DeleteTalkData, DeleteTalkError, DeleteTalkResponse, DrawFortuneData, DrawFortuneError, DrawFortuneResponse, GetArticleData, GetArticleError, GetArticleResponse, GetCardImageData, GetCardImageError, GetFeedData, GetFeedError, GetFeedResponse, GetFortuneTodayData, GetFortuneTodayError, GetFortuneTodayResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetReelCoverData, GetReelCoverError, GetReelVideoData, GetReelVideoError, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetTalkImageData, GetTalkImageError, GetTodayGuPageData, GetTodayGuPageError, GetTodayGuPageResponse, GetTodayPageData, GetTodayPageError, GetTodayPageResponse, GetTomorrowGuPageData, GetTomorrowGuPageError, GetTomorrowGuPageResponse, GetTomorrowPageData, GetTomorrowPageError, GetTomorrowPageResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, GoogleLoginData, GoogleLoginError, GoogleLoginResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, ImportFortuneData, ImportFortuneError, ImportFortuneResponse, LatestCardData, LatestCardError, LatestCardResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, LikeTalkData, LikeTalkError, LikeTalkResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListBlockedData, ListBlockedError, ListBlockedResponse, ListCardsData, ListCardsError, ListCardsResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListMyGakData, ListMyGakError, ListMyGakResponse, ListMyTalksData, ListMyTalksError, ListMyTalksResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListPresetsData, ListPresetsResponse, ListReelsData, ListReelsError, ListReelsResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, ListShortsData, ListShortsResponse, ListTalksData, ListTalksError, ListTalksResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, PublishCardData, PublishCardError, PublishCardResponse, PublishInstagram2Data, PublishInstagram2Error, PublishInstagram2Response, PublishInstagramData, PublishInstagramError, PublishInstagramResponse, RefreshData, RefreshError, RefreshResponse, RejectCardData, RejectCardError, RejectCardResponse, ReportCommentData, ReportCommentError, ReportCommentResponse, ReportTalkData, ReportTalkError, ReportTalkResponse, SaveDayLogData, SaveDayLogError, SaveDayLogResponse, SavePostData, SavePostError, SavePostResponse, ScoreMyGakData, ScoreMyGakError, ScoreMyGakResponse, SearchFortunePlacesData, SearchFortunePlacesError, SearchFortunePlacesResponse, SignupData, SignupError, SignupResponse, TalkGroupsData, TalkGroupsError, TalkGroupsResponse, TossData, TossError, TossResponse, TossUnlinkData, TossUnlinkError, TossUnlinkResponse, UnblockData, UnblockError, UnblockResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnlikeTalkData, UnlikeTalkError, UnlikeTalkResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse, UploadTalkImageData, UploadTalkImageError, UploadTalkImageResponse, WithdrawData, WithdrawError, WithdrawResponse } from '../types.gen';
|
||||
import { addComment, addMyGak, addTalk, agreeTerms, attend, authConfig, blockAuthor, blockTalkAuthor, createCard, createReel, deleteComment, deleteMyGak, deleteTalk, drawFortune, getArticle, getCardImage, getFeed, getFortuneToday, getImage, getIndex, getPost, getReelCover, getReelVideo, getSeasonWeek, getSky, getSkyRanking, getTalkImage, getTodayGuPage, getTodayPage, getTomorrowGuPage, getTomorrowPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, importFortune, latestCard, likeComment, likePost, likeTalk, listArticles, listBlocked, listCards, listComments, listEvents, listIndices, listMyGak, listMyTalks, listPlaces, listPresets, listReels, listRegions, listSaved, listShorts, listTalks, login, logout, me, myLevel, nearestRegion, type Options, publishCard, publishInstagram, publishInstagram2, refresh, rejectCard, reportComment, reportTalk, saveDayLog, savePost, scoreMyGak, searchFortunePlaces, shared, signup, talkGroups, toss, tossUnlink, unblock, unlikeComment, unlikePost, unlikeTalk, unsavePost, updateMe, uploadTalkImage, withdraw } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, AddMyGakData, AddMyGakError, AddMyGakResponse, AddTalkData, AddTalkError, AddTalkResponse, AgreeTermsData, AgreeTermsError, AgreeTermsResponse, AttendData, AttendError, AttendResponse, AuthConfigData, AuthConfigResponse, BlockAuthorData, BlockAuthorError, BlockAuthorResponse, BlockTalkAuthorData, BlockTalkAuthorError, BlockTalkAuthorResponse, CreateCardData, CreateCardError, CreateCardResponse, CreateReelData, CreateReelError, CreateReelResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, DeleteMyGakData, DeleteMyGakError, DeleteMyGakResponse, DeleteTalkData, DeleteTalkError, DeleteTalkResponse, DrawFortuneData, DrawFortuneError, DrawFortuneResponse, GetArticleData, GetArticleError, GetArticleResponse, GetCardImageData, GetCardImageError, GetFeedData, GetFeedError, GetFeedResponse, GetFortuneTodayData, GetFortuneTodayError, GetFortuneTodayResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetReelCoverData, GetReelCoverError, GetReelVideoData, GetReelVideoError, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetTalkImageData, GetTalkImageError, GetTodayGuPageData, GetTodayGuPageError, GetTodayGuPageResponse, GetTodayPageData, GetTodayPageError, GetTodayPageResponse, GetTomorrowGuPageData, GetTomorrowGuPageError, GetTomorrowGuPageResponse, GetTomorrowPageData, GetTomorrowPageError, GetTomorrowPageResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, GoogleLoginData, GoogleLoginError, GoogleLoginResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, ImportFortuneData, ImportFortuneError, ImportFortuneResponse, LatestCardData, LatestCardError, LatestCardResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, LikeTalkData, LikeTalkError, LikeTalkResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListBlockedData, ListBlockedError, ListBlockedResponse, ListCardsData, ListCardsError, ListCardsResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListMyGakData, ListMyGakError, ListMyGakResponse, ListMyTalksData, ListMyTalksError, ListMyTalksResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListPresetsData, ListPresetsResponse, ListReelsData, ListReelsError, ListReelsResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, ListShortsData, ListShortsResponse, ListTalksData, ListTalksError, ListTalksResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, MyLevelData, MyLevelError, MyLevelResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, PublishCardData, PublishCardError, PublishCardResponse, PublishInstagram2Data, PublishInstagram2Error, PublishInstagram2Response, PublishInstagramData, PublishInstagramError, PublishInstagramResponse, RefreshData, RefreshError, RefreshResponse, RejectCardData, RejectCardError, RejectCardResponse, ReportCommentData, ReportCommentError, ReportCommentResponse, ReportTalkData, ReportTalkError, ReportTalkResponse, SaveDayLogData, SaveDayLogError, SaveDayLogResponse, SavePostData, SavePostError, SavePostResponse, ScoreMyGakData, ScoreMyGakError, ScoreMyGakResponse, SearchFortunePlacesData, SearchFortunePlacesError, SearchFortunePlacesResponse, SharedData, SharedError, SharedResponse, SignupData, SignupError, SignupResponse, TalkGroupsData, TalkGroupsError, TalkGroupsResponse, TossData, TossError, TossResponse, TossUnlinkData, TossUnlinkError, TossUnlinkResponse, UnblockData, UnblockError, UnblockResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnlikeTalkData, UnlikeTalkError, UnlikeTalkResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse, UploadTalkImageData, UploadTalkImageError, UploadTalkImageResponse, WithdrawData, WithdrawError, WithdrawResponse } from '../types.gen';
|
||||
|
||||
export type QueryKey<TOptions extends Options> = [
|
||||
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
||||
@@ -1055,6 +1055,58 @@ export const searchFortunePlacesOptions = (options: Options<SearchFortunePlacesD
|
||||
queryKey: searchFortunePlacesQueryKey(options)
|
||||
});
|
||||
|
||||
export const myLevelQueryKey = (options?: Options<MyLevelData>) => createQueryKey('myLevel', options);
|
||||
|
||||
/**
|
||||
* 내 레벨: 모은 각, 다음 레벨, 오늘 받은 각, 레벨로 열리는 것
|
||||
*/
|
||||
export const myLevelOptions = (options?: Options<MyLevelData>) => queryOptions<MyLevelResponse, MyLevelError, MyLevelResponse, ReturnType<typeof myLevelQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await myLevel({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: myLevelQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 출석 (하루 한 번 각). 7일 이어지면 보너스
|
||||
*/
|
||||
export const attendMutation = (options?: Partial<Options<AttendData>>): UseMutationOptions<AttendResponse, AttendError, Options<AttendData>> => {
|
||||
const mutationOptions: UseMutationOptions<AttendResponse, AttendError, Options<AttendData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await attend({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 공유를 마쳤을 때 (하루 한 번 각)
|
||||
*/
|
||||
export const sharedMutation = (options?: Partial<Options<SharedData>>): UseMutationOptions<SharedResponse, SharedError, Options<SharedData>> => {
|
||||
const mutationOptions: UseMutationOptions<SharedResponse, SharedError, Options<SharedData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await shared({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const talkGroupsQueryKey = (options?: Options<TalkGroupsData>) => createQueryKey('talkGroups', options);
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export { addComment, addMyGak, addTalk, agreeTerms, authConfig, blockAuthor, blockTalkAuthor, createCard, createReel, deleteComment, deleteMyGak, deleteTalk, drawFortune, getArticle, getCardImage, getFeed, getFortuneToday, getImage, getIndex, getPost, getReelCover, getReelVideo, getSeasonWeek, getSky, getSkyRanking, getTalkImage, getTodayGuPage, getTodayPage, getTomorrowGuPage, getTomorrowPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, importFortune, latestCard, likeComment, likePost, likeTalk, listArticles, listBlocked, listCards, listComments, listEvents, listIndices, listMyGak, listMyTalks, listPlaces, listPresets, listReels, listRegions, listSaved, listShorts, listTalks, login, logout, me, nearestRegion, type Options, publishCard, publishInstagram, publishInstagram2, refresh, rejectCard, reportComment, reportTalk, saveDayLog, savePost, scoreMyGak, searchFortunePlaces, signup, talkGroups, toss, tossUnlink, unblock, unlikeComment, unlikePost, unlikeTalk, unsavePost, updateMe, uploadTalkImage, withdraw } from './sdk.gen';
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AddMyGakData, type AddMyGakError, type AddMyGakErrors, type AddMyGakResponse, type AddMyGakResponses, type AddTalkData, type AddTalkError, type AddTalkErrors, type AddTalkResponse, type AddTalkResponses, type AgreeTermsData, type AgreeTermsError, type AgreeTermsErrors, type AgreeTermsResponse, type AgreeTermsResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, type AuthConfigData, type AuthConfigResponse, type AuthConfigResponses, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type BlockAuthorData, type BlockAuthorError, type BlockAuthorErrors, type BlockAuthorResponse, type BlockAuthorResponses, type BlockedUser, type BlockTalkAuthorData, type BlockTalkAuthorError, type BlockTalkAuthorErrors, type BlockTalkAuthorResponse, type BlockTalkAuthorResponses, type BodyUploadTalkImageV1TalkImagePost, type CardItem, CardStatus, type ClientOptions, type CommentData, type CommuteData, Confidence, type CreateCardData, type CreateCardError, type CreateCardErrors, type CreateCardResponse, type CreateCardResponses, type CreateReelData, type CreateReelError, type CreateReelErrors, type CreateReelResponse, type CreateReelResponses, type Cut, type DayData, type DayLogData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type DeleteMyGakData, type DeleteMyGakError, type DeleteMyGakErrors, type DeleteMyGakResponse, type DeleteMyGakResponses, type DeleteTalkData, type DeleteTalkError, type DeleteTalkErrors, type DeleteTalkResponse, type DeleteTalkResponses, type DrawFortuneData, type DrawFortuneError, type DrawFortuneErrors, type DrawFortuneResponse, type DrawFortuneResponses, type ErrorInfo, type EventData, type Factor, type FortuneCard, type FortuneLuck, type FortunePlace, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetCardImageData, type GetCardImageError, type GetCardImageErrors, type GetCardImageResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetFortuneTodayData, type GetFortuneTodayError, type GetFortuneTodayErrors, type GetFortuneTodayResponse, type GetFortuneTodayResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetReelCoverData, type GetReelCoverError, type GetReelCoverErrors, type GetReelCoverResponses, type GetReelVideoData, type GetReelVideoError, type GetReelVideoErrors, type GetReelVideoResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetTalkImageData, type GetTalkImageError, type GetTalkImageErrors, type GetTalkImageResponses, type GetTodayGuPageData, type GetTodayGuPageError, type GetTodayGuPageErrors, type GetTodayGuPageResponse, type GetTodayGuPageResponses, type GetTodayPageData, type GetTodayPageError, type GetTodayPageErrors, type GetTodayPageResponse, type GetTodayPageResponses, type GetTomorrowGuPageData, type GetTomorrowGuPageError, type GetTomorrowGuPageErrors, type GetTomorrowGuPageResponse, type GetTomorrowGuPageResponses, type GetTomorrowPageData, type GetTomorrowPageError, type GetTomorrowPageErrors, type GetTomorrowPageResponse, type GetTomorrowPageResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type GoogleLoginData, type GoogleLoginError, type GoogleLoginErrors, type GoogleLoginResponse, type GoogleLoginResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HeroTomorrow, type HourCell, type HoursSlide, type HttpValidationError, type ImageSlide, type ImportFortuneData, type ImportFortuneError, type ImportFortuneErrors, type ImportFortuneResponse, type ImportFortuneResponses, IndexCategory, type IndexSummary, type LatestCardData, type LatestCardError, type LatestCardErrorLine truncated
|
||||
export { addComment, addMyGak, addTalk, agreeTerms, attend, authConfig, blockAuthor, blockTalkAuthor, createCard, createReel, deleteComment, deleteMyGak, deleteTalk, drawFortune, getArticle, getCardImage, getFeed, getFortuneToday, getImage, getIndex, getPost, getReelCover, getReelVideo, getSeasonWeek, getSky, getSkyRanking, getTalkImage, getTodayGuPage, getTodayPage, getTomorrowGuPage, getTomorrowPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, importFortune, latestCard, likeComment, likePost, likeTalk, listArticles, listBlocked, listCards, listComments, listEvents, listIndices, listMyGak, listMyTalks, listPlaces, listPresets, listReels, listRegions, listSaved, listShorts, listTalks, login, logout, me, myLevel, nearestRegion, type Options, publishCard, publishInstagram, publishInstagram2, refresh, rejectCard, reportComment, reportTalk, saveDayLog, savePost, scoreMyGak, searchFortunePlaces, shared, signup, talkGroups, toss, tossUnlink, unblock, unlikeComment, unlikePost, unlikeTalk, unsavePost, updateMe, uploadTalkImage, withdraw } from './sdk.gen';
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AddMyGakData, type AddMyGakError, type AddMyGakErrors, type AddMyGakResponse, type AddMyGakResponses, type AddTalkData, type AddTalkError, type AddTalkErrors, type AddTalkResponse, type AddTalkResponses, type AgreeTermsData, type AgreeTermsError, type AgreeTermsErrors, type AgreeTermsResponse, type AgreeTermsResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, type AttendData, type AttendError, type AttendErrors, type AttendResponse, type AttendResponses, type AuthConfigData, type AuthConfigResponse, type AuthConfigResponses, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type BlockAuthorData, type BlockAuthorError, type BlockAuthorErrors, type BlockAuthorResponse, type BlockAuthorResponses, type BlockedUser, type BlockTalkAuthorData, type BlockTalkAuthorError, type BlockTalkAuthorErrors, type BlockTalkAuthorResponse, type BlockTalkAuthorResponses, type BodyUploadTalkImageV1TalkImagePost, type CardItem, CardStatus, type ClientOptions, type CommentData, type CommuteData, Confidence, type CreateCardData, type CreateCardError, type CreateCardErrors, type CreateCardResponse, type CreateCardResponses, type CreateReelData, type CreateReelError, type CreateReelErrors, type CreateReelResponse, type CreateReelResponses, type Cut, type DayData, type DayLogData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type DeleteMyGakData, type DeleteMyGakError, type DeleteMyGakErrors, type DeleteMyGakResponse, type DeleteMyGakResponses, type DeleteTalkData, type DeleteTalkError, type DeleteTalkErrors, type DeleteTalkResponse, type DeleteTalkResponses, type DrawFortuneData, type DrawFortuneError, type DrawFortuneErrors, type DrawFortuneResponse, type DrawFortuneResponses, type ErrorInfo, type EventData, type Factor, type FortuneCard, type FortuneLuck, type FortunePlace, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetCardImageData, type GetCardImageError, type GetCardImageErrors, type GetCardImageResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetFortuneTodayData, type GetFortuneTodayError, type GetFortuneTodayErrors, type GetFortuneTodayResponse, type GetFortuneTodayResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetReelCoverData, type GetReelCoverError, type GetReelCoverErrors, type GetReelCoverResponses, type GetReelVideoData, type GetReelVideoError, type GetReelVideoErrors, type GetReelVideoResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetTalkImageData, type GetTalkImageError, type GetTalkImageErrors, type GetTalkImageResponses, type GetTodayGuPageData, type GetTodayGuPageError, type GetTodayGuPageErrors, type GetTodayGuPageResponse, type GetTodayGuPageResponses, type GetTodayPageData, type GetTodayPageError, type GetTodayPageErrors, type GetTodayPageResponse, type GetTodayPageResponses, type GetTomorrowGuPageData, type GetTomorrowGuPageError, type GetTomorrowGuPageErrors, type GetTomorrowGuPageResponse, type GetTomorrowGuPageResponses, type GetTomorrowPageData, type GetTomorrowPageError, type GetTomorrowPageErrors, type GetTomorrowPageResponse, type GetTomorrowPageResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type GoogleLoginData, type GoogleLoginError, type GoogleLoginErrors, type GoogleLoginResponse, type GoogleLoginResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HeroTomorrow, type HourCell, type HoursSlide, type HttpValidationError, type ImageSlide, type ImportFortuneData, type ImportFortuneError, type ImportFortuneErrors, type ImportFortuneResponse, type ImportFortuneResponses,
Line truncated
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';
|
||||
import { client } from './client.gen';
|
||||
import type { AddCommentData, AddCommentErrors, AddCommentResponses, AddMyGakData, AddMyGakErrors, AddMyGakResponses, AddTalkData, AddTalkErrors, AddTalkResponses, AgreeTermsData, AgreeTermsErrors, AgreeTermsResponses, AuthConfigData, AuthConfigResponses, BlockAuthorData, BlockAuthorErrors, BlockAuthorResponses, BlockTalkAuthorData, BlockTalkAuthorErrors, BlockTalkAuthorResponses, CreateCardData, CreateCardErrors, CreateCardResponses, CreateReelData, CreateReelErrors, CreateReelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteMyGakData, DeleteMyGakErrors, DeleteMyGakResponses, DeleteTalkData, DeleteTalkErrors, DeleteTalkResponses, DrawFortuneData, DrawFortuneErrors, DrawFortuneResponses, GetArticleData, GetArticleErrors, GetArticleResponses, GetCardImageData, GetCardImageErrors, GetCardImageResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetFortuneTodayData, GetFortuneTodayErrors, GetFortuneTodayResponses, GetImageData, GetImageErrors, GetImageResponses, GetIndexData, GetIndexErrors, GetIndexResponses, GetPostData, GetPostErrors, GetPostResponses, GetReelCoverData, GetReelCoverErrors, GetReelCoverResponses, GetReelVideoData, GetReelVideoErrors, GetReelVideoResponses, GetSeasonWeekData, GetSeasonWeekResponses, GetSkyData, GetSkyErrors, GetSkyRankingData, GetSkyRankingResponses, GetSkyResponses, GetTalkImageData, GetTalkImageErrors, GetTalkImageResponses, GetTodayGuPageData, GetTodayGuPageErrors, GetTodayGuPageResponses, GetTodayPageData, GetTodayPageErrors, GetTodayPageResponses, GetTomorrowGuPageData, GetTomorrowGuPageErrors, GetTomorrowGuPageResponses, GetTomorrowPageData, GetTomorrowPageErrors, GetTomorrowPageResponses, GetWatchSummaryData, GetWatchSummaryErrors, GetWatchSummaryResponses, GetWeatherNowData, GetWeatherNowErrors, GetWeatherNowResponses, GetWeatherTodayData, GetWeatherTodayErrors, GetWeatherTodayResponses, GetWeekData, GetWeekErrors, GetWeekRankingData, GetWeekRankingResponses, GetWeekResponses, GoogleLoginData, GoogleLoginErrors, GoogleLoginResponses, HealthzHealthzGetData, HealthzHealthzGetResponses, ImportFortuneData, ImportFortuneErrors, ImportFortuneResponses, LatestCardData, LatestCardErrors, LatestCardResponses, LikeCommentData, LikeCommentErrors, LikeCommentResponses, LikePostData, LikePostErrors, LikePostResponses, LikeTalkData, LikeTalkErrors, LikeTalkResponses, ListArticlesData, ListArticlesErrors, ListArticlesResponses, ListBlockedData, ListBlockedErrors, ListBlockedResponses, ListCardsData, ListCardsErrors, ListCardsResponses, ListCommentsData, ListCommentsErrors, ListCommentsResponses, ListEventsData, ListEventsErrors, ListEventsResponses, ListIndicesData, ListIndicesErrors, ListIndicesResponses, ListMyGakData, ListMyGakErrors, ListMyGakResponses, ListMyTalksData, ListMyTalksErrors, ListMyTalksResponses, ListPlacesData, ListPlacesErrors, ListPlacesResponses, ListPresetsData, ListPresetsResponses, ListReelsData, ListReelsErrors, ListReelsResponses, ListRegionsData, ListRegionsErrors, ListRegionsResponses, ListSavedData, ListSavedErrors, ListSavedResponses, ListShortsData, ListShortsResponses, ListTalksData, ListTalksErrors, ListTalksResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutErrors, LogoutResponses, MeData, MeErrors, MeResponses, NearestRegionData, NearestRegionErrors, NearestRegionResponses, PublishCardData, PublishCardErrors, PublishCardResponses, PublishInstagram2Data, PublishInstagram2Errors, PublishInstagram2Responses, PublishInstagramData, PublishInstagramErrors, PublishInstagramResponses, RefreshData, RefreshErrors, RefreshResponses, RejectCardData, RejectCardErrors, RejectCardResponses, ReportCommentData, ReportCommentErrors, ReportCommentResponses, ReportTalkData, ReportTalkErrors, ReportTalkResponses, SaveDayLogData, SaveDayLogErrors, SaveDayLogResponses, SavePostData, SavePostErrors, SavePostResponses, ScoreMyGakData, ScoreMyGakErrors, ScoreMyGakResponses, SearchFortunePlacesData, SearchFortunePlacesErrors, SearchFortunePlacesResponses, SignupData, SignupErrors, SignupResponses, TalkGroupsData, TalkGroupsErrors, TalkGroupsResponses, TossData, TossErrors, TossResponses, TossUnlinkData, TossUnlinkErrors, TossUnlinkResponses, UnblockData, UnblockErrors, UnblockResponses, UnlikeCommentData, UnlikeCommentErrors, UnlikeCommentResponses, UnlikePostData, UnlikePostErrors, UnlikePostResponses, UnlikeTalkData, UnlikeTalkErrors, UnlikeTalkResponses, UnsavePostData, UnsavePostErrors, UnsavePostResponses, UpdateMeData, UpdateMeErrors, UpdateMeResponses, UploadTalkImageData, UploadTalkImageErrors, UploadTalkImageResponses, WithdrawData, WithdrawErrors, WithdrawResponses } from './types.gen';
|
||||
import type { AddCommentData, AddCommentErrors, AddCommentResponses, AddMyGakData, AddMyGakErrors, AddMyGakResponses, AddTalkData, AddTalkErrors, AddTalkResponses, AgreeTermsData, AgreeTermsErrors, AgreeTermsResponses, AttendData, AttendErrors, AttendResponses, AuthConfigData, AuthConfigResponses, BlockAuthorData, BlockAuthorErrors, BlockAuthorResponses, BlockTalkAuthorData, BlockTalkAuthorErrors, BlockTalkAuthorResponses, CreateCardData, CreateCardErrors, CreateCardResponses, CreateReelData, CreateReelErrors, CreateReelResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteMyGakData, DeleteMyGakErrors, DeleteMyGakResponses, DeleteTalkData, DeleteTalkErrors, DeleteTalkResponses, DrawFortuneData, DrawFortuneErrors, DrawFortuneResponses, GetArticleData, GetArticleErrors, GetArticleResponses, GetCardImageData, GetCardImageErrors, GetCardImageResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetFortuneTodayData, GetFortuneTodayErrors, GetFortuneTodayResponses, GetImageData, GetImageErrors, GetImageResponses, GetIndexData, GetIndexErrors, GetIndexResponses, GetPostData, GetPostErrors, GetPostResponses, GetReelCoverData, GetReelCoverErrors, GetReelCoverResponses, GetReelVideoData, GetReelVideoErrors, GetReelVideoResponses, GetSeasonWeekData, GetSeasonWeekResponses, GetSkyData, GetSkyErrors, GetSkyRankingData, GetSkyRankingResponses, GetSkyResponses, GetTalkImageData, GetTalkImageErrors, GetTalkImageResponses, GetTodayGuPageData, GetTodayGuPageErrors, GetTodayGuPageResponses, GetTodayPageData, GetTodayPageErrors, GetTodayPageResponses, GetTomorrowGuPageData, GetTomorrowGuPageErrors, GetTomorrowGuPageResponses, GetTomorrowPageData, GetTomorrowPageErrors, GetTomorrowPageResponses, GetWatchSummaryData, GetWatchSummaryErrors, GetWatchSummaryResponses, GetWeatherNowData, GetWeatherNowErrors, GetWeatherNowResponses, GetWeatherTodayData, GetWeatherTodayErrors, GetWeatherTodayResponses, GetWeekData, GetWeekErrors, GetWeekRankingData, GetWeekRankingResponses, GetWeekResponses, GoogleLoginData, GoogleLoginErrors, GoogleLoginResponses, HealthzHealthzGetData, HealthzHealthzGetResponses, ImportFortuneData, ImportFortuneErrors, ImportFortuneResponses, LatestCardData, LatestCardErrors, LatestCardResponses, LikeCommentData, LikeCommentErrors, LikeCommentResponses, LikePostData, LikePostErrors, LikePostResponses, LikeTalkData, LikeTalkErrors, LikeTalkResponses, ListArticlesData, ListArticlesErrors, ListArticlesResponses, ListBlockedData, ListBlockedErrors, ListBlockedResponses, ListCardsData, ListCardsErrors, ListCardsResponses, ListCommentsData, ListCommentsErrors, ListCommentsResponses, ListEventsData, ListEventsErrors, ListEventsResponses, ListIndicesData, ListIndicesErrors, ListIndicesResponses, ListMyGakData, ListMyGakErrors, ListMyGakResponses, ListMyTalksData, ListMyTalksErrors, ListMyTalksResponses, ListPlacesData, ListPlacesErrors, ListPlacesResponses, ListPresetsData, ListPresetsResponses, ListReelsData, ListReelsErrors, ListReelsResponses, ListRegionsData, ListRegionsErrors, ListRegionsResponses, ListSavedData, ListSavedErrors, ListSavedResponses, ListShortsData, ListShortsResponses, ListTalksData, ListTalksErrors, ListTalksResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutErrors, LogoutResponses, MeData, MeErrors, MeResponses, MyLevelData, MyLevelErrors, MyLevelResponses, NearestRegionData, NearestRegionErrors, NearestRegionResponses, PublishCardData, PublishCardErrors, PublishCardResponses, PublishInstagram2Data, PublishInstagram2Errors, PublishInstagram2Responses, PublishInstagramData, PublishInstagramErrors, PublishInstagramResponses, RefreshData, RefreshErrors, RefreshResponses, RejectCardData, RejectCardErrors, RejectCardResponses, ReportCommentData, ReportCommentErrors, ReportCommentResponses, ReportTalkData, ReportTalkErrors, ReportTalkResponses, SaveDayLogData, SaveDayLogErrors, SaveDayLogResponses, SavePostData, SavePostErrors, SavePostResponses, ScoreMyGakData, ScoreMyGakErrors, ScoreMyGakResponses, SearchFortunePlacesData, SearchFortunePlacesErrors, SearchFortunePlacesResponses, SharedData, SharedErrors, SharedResponses, SignupData, SignupErrors, SignupResponses, TalkGroupsData, TalkGroupsErrors, TalkGroupsResponses, TossData, TossErrors, TossResponses, TossUnlinkData, TossUnlinkErrors, TossUnlinkResponses, UnblockData, UnblockErrors, UnblockResponses, UnlikeCommentData, UnlikeCommentErrors, UnlikeCommentResponses, UnlikePostData, UnlikePostErrors, UnlikePostResponses, UnlikeTalkData, UnlikeTalkErrors, UnlikeTalkResponses, UnsavePostData, UnsavePostErrors, UnsavePostResponses, UpdateMeData, UpdateMeErrors, UpdateMeResponses, UploadTalkImageData, UploadTalkImageErrors, UploadTalkImageResponses, WithdrawData, WithdrawErrors, WithdrawResponses } from './types.gen';
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
||||
/**
|
||||
@@ -381,6 +381,21 @@ export const importFortune = <ThrowOnError extends boolean = true>(options: Opti
|
||||
*/
|
||||
export const searchFortunePlaces = <ThrowOnError extends boolean = true>(options: Options<SearchFortunePlacesData, ThrowOnError>): RequestResult<SearchFortunePlacesResponses, SearchFortunePlacesErrors, ThrowOnError> => (options.client ?? client).get<SearchFortunePlacesResponses, SearchFortunePlacesErrors, ThrowOnError>({ url: '/v1/fortune/places', ...options });
|
||||
|
||||
/**
|
||||
* 내 레벨: 모은 각, 다음 레벨, 오늘 받은 각, 레벨로 열리는 것
|
||||
*/
|
||||
export const myLevel = <ThrowOnError extends boolean = true>(options?: Options<MyLevelData, ThrowOnError>): RequestResult<MyLevelResponses, MyLevelErrors, ThrowOnError> => (options?.client ?? client).get<MyLevelResponses, MyLevelErrors, ThrowOnError>({ url: '/v1/level/me', ...options });
|
||||
|
||||
/**
|
||||
* 출석 (하루 한 번 각). 7일 이어지면 보너스
|
||||
*/
|
||||
export const attend = <ThrowOnError extends boolean = true>(options?: Options<AttendData, ThrowOnError>): RequestResult<AttendResponses, AttendErrors, ThrowOnError> => (options?.client ?? client).post<AttendResponses, AttendErrors, ThrowOnError>({ url: '/v1/level/attend', ...options });
|
||||
|
||||
/**
|
||||
* 공유를 마쳤을 때 (하루 한 번 각)
|
||||
*/
|
||||
export const shared = <ThrowOnError extends boolean = true>(options?: Options<SharedData, ThrowOnError>): RequestResult<SharedResponses, SharedErrors, ThrowOnError> => (options?.client ?? client).post<SharedResponses, SharedErrors, ThrowOnError>({ url: '/v1/level/share', ...options });
|
||||
|
||||
/**
|
||||
* 오늘 피드 묶음 (동네 사람들 + 주제별, 가까운 동네·덜 지난 글 먼저, 한 사람 한 장)
|
||||
*/
|
||||
|
||||
@@ -1115,6 +1115,76 @@ export type IndexSummary = {
|
||||
slots?: Array<SlotPoint>;
|
||||
};
|
||||
|
||||
/**
|
||||
* LevelAction
|
||||
*/
|
||||
export type LevelAction = {
|
||||
/**
|
||||
* Action
|
||||
*/
|
||||
action: string;
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Points
|
||||
*
|
||||
* 한 번에 주는 각
|
||||
*/
|
||||
points: number;
|
||||
/**
|
||||
* Cap
|
||||
*
|
||||
* 하루 한도
|
||||
*/
|
||||
cap: number;
|
||||
/**
|
||||
* Earned
|
||||
*
|
||||
* 오늘 받은 각
|
||||
*/
|
||||
earned: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* LevelStep
|
||||
*/
|
||||
export type LevelStep = {
|
||||
/**
|
||||
* Level
|
||||
*/
|
||||
level: number;
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Points
|
||||
*
|
||||
* 이 레벨이 되는 각 총량
|
||||
*/
|
||||
points: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* LevelUnlock
|
||||
*/
|
||||
export type LevelUnlock = {
|
||||
/**
|
||||
* Level
|
||||
*/
|
||||
level: number;
|
||||
/**
|
||||
* Key
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* LocalDraw
|
||||
*/
|
||||
@@ -2545,6 +2615,67 @@ export type ResLatestCard = {
|
||||
published_at?: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Res_Level
|
||||
*/
|
||||
export type ResLevel = {
|
||||
result?: ErrorInfo;
|
||||
/**
|
||||
* Msg
|
||||
*/
|
||||
msg?: string | null;
|
||||
/**
|
||||
* Points
|
||||
*
|
||||
* 모은 각 총량
|
||||
*/
|
||||
points?: number;
|
||||
/**
|
||||
* Level
|
||||
*/
|
||||
level?: number;
|
||||
/**
|
||||
* Name
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* Floor
|
||||
*
|
||||
* 지금 레벨이 시작하는 각
|
||||
*/
|
||||
floor?: number;
|
||||
/**
|
||||
* Next Points
|
||||
*
|
||||
* 다음 레벨에 필요한 총량 (마지막 레벨이면 없음)
|
||||
*/
|
||||
next_points?: number | null;
|
||||
/**
|
||||
* Next Name
|
||||
*/
|
||||
next_name?: string | null;
|
||||
/**
|
||||
* Streak
|
||||
*
|
||||
* 이어 출석한 날
|
||||
*/
|
||||
streak?: number;
|
||||
/**
|
||||
* Today
|
||||
*/
|
||||
today?: Array<LevelAction>;
|
||||
/**
|
||||
* Unlocks
|
||||
*/
|
||||
unlocks?: Array<LevelUnlock>;
|
||||
/**
|
||||
* Levels
|
||||
*
|
||||
* 레벨 전체 (이름·필요한 각)
|
||||
*/
|
||||
levels?: Array<LevelStep>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Res_Logout
|
||||
*/
|
||||
@@ -6033,6 +6164,99 @@ export type SearchFortunePlacesResponses = {
|
||||
|
||||
export type SearchFortunePlacesResponse = SearchFortunePlacesResponses[keyof SearchFortunePlacesResponses];
|
||||
|
||||
export type MyLevelData = {
|
||||
body?: never;
|
||||
headers?: {
|
||||
/**
|
||||
* Authorization
|
||||
*/
|
||||
authorization?: string | null;
|
||||
};
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/v1/level/me';
|
||||
};
|
||||
|
||||
export type MyLevelErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type MyLevelError = MyLevelErrors[keyof MyLevelErrors];
|
||||
|
||||
export type MyLevelResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: ResLevel;
|
||||
};
|
||||
|
||||
export type MyLevelResponse = MyLevelResponses[keyof MyLevelResponses];
|
||||
|
||||
export type AttendData = {
|
||||
body?: never;
|
||||
headers?: {
|
||||
/**
|
||||
* Authorization
|
||||
*/
|
||||
authorization?: string | null;
|
||||
};
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/v1/level/attend';
|
||||
};
|
||||
|
||||
export type AttendErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type AttendError = AttendErrors[keyof AttendErrors];
|
||||
|
||||
export type AttendResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: ResLevel;
|
||||
};
|
||||
|
||||
export type AttendResponse = AttendResponses[keyof AttendResponses];
|
||||
|
||||
export type SharedData = {
|
||||
body?: never;
|
||||
headers?: {
|
||||
/**
|
||||
* Authorization
|
||||
*/
|
||||
authorization?: string | null;
|
||||
};
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/v1/level/share';
|
||||
};
|
||||
|
||||
export type SharedErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type SharedError = SharedErrors[keyof SharedErrors];
|
||||
|
||||
export type SharedResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: ResLevel;
|
||||
};
|
||||
|
||||
export type SharedResponse = SharedResponses[keyof SharedResponses];
|
||||
|
||||
export type TalkGroupsData = {
|
||||
body?: never;
|
||||
headers?: {
|
||||
|
||||
Reference in new issue
Block a user