HonkaiStarRailWikiDataParser/models/wiki.py

35 lines
596 B
Python
Raw Normal View History

2023-04-23 14:06:11 +00:00
from typing import List, Dict
import ujson
from pydantic import BaseModel
class Content(BaseModel):
content_id: int
"""内容ID"""
ext: str
"""扩展信息"""
icon: str
"""图标"""
summary: str
"""摘要"""
title: str
"""标题"""
2023-04-24 14:30:16 +00:00
article_user_name: str = ""
"""作者"""
bbs_url: str = ""
"""BBS对应地址"""
2023-04-23 14:06:11 +00:00
@property
def data(self) -> Dict:
return ujson.loads(self.ext)
class Children(BaseModel):
id: int
"""分类ID"""
name: str
"""分类名称"""
list: List[Content]
"""内容列表"""