45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
from datetime import date
|
|
from typing import Optional
|
|
|
|
from common.enums import ArticleCategory
|
|
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
class TermData(WebPacketProtocol):
|
|
name: str
|
|
day: date
|
|
|
|
|
|
class ArticleSummary(WebPacketProtocol):
|
|
article_id: int
|
|
code: str
|
|
category: ArticleCategory
|
|
title: str
|
|
read_minutes: int
|
|
icon: str
|
|
image: Optional[str] = None # 있으면 아이콘 대신 사진
|
|
image_credit: Optional[str] = None # 사진 출처 표기 ("ⓒ저작자 · CC BY-SA 4.0")
|
|
|
|
|
|
class Res_SeasonWeek(Res_WebPacketProtocol):
|
|
year: Optional[int] = None
|
|
week: Optional[int] = None
|
|
start: Optional[date] = None
|
|
end: Optional[date] = None
|
|
headline: Optional[str] = None
|
|
poem_lines: list[str] = []
|
|
author: Optional[str] = None
|
|
term_now: Optional[TermData] = None
|
|
term_next: Optional[TermData] = None
|
|
progress: Optional[float] = None
|
|
news: list[ArticleSummary] = []
|
|
|
|
|
|
class Res_ArticleList(Res_WebPacketProtocol):
|
|
articles: list[ArticleSummary] = []
|
|
|
|
|
|
class Res_Article(Res_WebPacketProtocol):
|
|
article: Optional[ArticleSummary] = None
|
|
body: list[str] = []
|