feat: 계절 이야기에 사진 연결 (띠·목록·상세·피드, CC BY 계열 출처 표기)
This commit is contained in:
1 parent
e8382f450b
commit
ba62e82f1b
15 files changed
+77
-21
No files matched your search
@@ -171,6 +171,8 @@ class BandArticle(WebPacketProtocol):
|
||||
title: str
|
||||
meta: str
|
||||
icon: str
|
||||
image: Optional[str] = None
|
||||
image_credit: Optional[str] = None
|
||||
|
||||
|
||||
class Bands(WebPacketProtocol):
|
||||
|
||||
@@ -17,6 +17,8 @@ class ArticleSummary(WebPacketProtocol):
|
||||
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):
|
||||
|
||||
@@ -12,7 +12,8 @@ router = APIRouter(prefix="/v1/season", tags=["season"])
|
||||
|
||||
|
||||
def _summary(a: Article) -> ArticleSummary:
|
||||
return ArticleSummary(article_id=a.article_id, code=a.code, category=ArticleCategory(a.category), title=a.title, read_minutes=a.read_minutes, icon=a.icon)
|
||||
return ArticleSummary(article_id=a.article_id, code=a.code, category=ArticleCategory(a.category), title=a.title, read_minutes=a.read_minutes, icon=a.icon,
|
||||
image=a.image_url, image_credit=a.image_credit)
|
||||
|
||||
|
||||
@router.get("/week", response_model=Res_SeasonWeek, response_model_exclude_none=True, summary="이번 주 계절 책: 시, 절기, 계절 소식")
|
||||
|
||||
Reference in new issue
Block a user