- 카드: 군산각 카드를 옮겨 그림, 토끼 로딩, 실패하면 '날씨각에서 날씨 보기' 링크, 8초 제한, nginx 대체 화면, '자세히 보기' 버튼만 링크 - 크기: 폭은 자리에 맞춰 자동, 높이는 폭에 따라 비율대로(기본형 245~320px, 상세형 400~520px) - 부하: 지역별 카드 데이터 5분 저장, 저장분이 비면 지역마다 한 요청만 새로 만듦, 노출 수는 Redis 에 쌓았다가 관리자 조회 때 DB(widget_view_daily)로 옮김 - 사용 방법 페이지: 지역(앱 지역은 바꾸지 않음)·모양·배경 고르기, 미리보기, 코드 복사. 들어오는 길은 문의 창 버튼(토스에서는 숨김)과 검색 - GA: 위젯_안내_보기, 위젯_옵션_고름, 위젯_코드_복사 - 문서: docs/위젯_운영.md, 백엔드 테스트 실행법(CLAUDE.md)
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
from datetime import date, datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import Field
|
|
|
|
from common.enums import AuthProvider
|
|
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
class AdminUser(WebPacketProtocol):
|
|
nickname: str
|
|
provider: AuthProvider
|
|
points: int = Field(description="모은 각 총량")
|
|
level: int
|
|
level_name: str
|
|
suspended: bool
|
|
created_at: datetime
|
|
last_active: Optional[date] = Field(None, description="각을 마지막으로 받은 날")
|
|
|
|
|
|
class Res_AdminUsers(Res_WebPacketProtocol):
|
|
total: int = 0
|
|
counts: dict[int, int] = Field({}, description="가입 경로(AuthProvider)별 인원")
|
|
items: list[AdminUser] = []
|
|
|
|
|
|
class WidgetViewData(WebPacketProtocol):
|
|
host: str = Field(description="부른 사이트 호스트(소문자), (알 수 없음), (기타)")
|
|
views_7d: int = Field(description="오늘 포함 최근 7일(한국 날짜) 노출 수")
|
|
views_30d: int = Field(description="오늘 포함 최근 30일(한국 날짜) 노출 수")
|
|
|
|
|
|
class Res_WidgetViews(Res_WebPacketProtocol):
|
|
items: list[WidgetViewData] = Field([], description="views_30d 많은 순 (같으면 호스트 이름순)")
|
|
total_7d: int = Field(0, description="최근 7일 노출 수 합")
|
|
total_30d: int = Field(0, description="최근 30일 노출 수 합")
|