Commit 82a9cb82 authored by zhanglu's avatar zhanglu

🐛 fix: 修复图片宽字段类型;问题schema去除部分无用字段

parent ecef6843
......@@ -24,7 +24,7 @@ class LiveNoticeListRequest(Schema):
class Image(Schema):
height: int = Field(0, description="图片地址")
width: str = Field(0, description="图片地址")
width: int = Field(0, description="图片地址")
image_url: str = Field(..., description="图片地址")
......
......@@ -130,9 +130,9 @@ class QuestionFormat(AnswerFormat):
question.video_pic = video_item.get("video_pic", "")
question.short_video_url = video_item.get("short_video_url", "")
question.images.video_url = question.video_url
question.images.video_pic = question.video_url
question.images.short_video_url = question.video_url
# question.images.video_url = question.video_url
# question.images.video_pic = question.video_pic
# question.images.short_video_url = question.short_video_url
question.content = gm_decode_html(item.pop("row_content", ""))
......
......@@ -19,7 +19,7 @@ class QaImage(Schema):
image_url: str = Field(..., description="图片地址")
image_webp: str = Field(..., description="webp图片地址")
height: int = Field(0, description="图片地址")
width: str = Field(0, description="图片地址")
width: int = Field(0, description="图片地址")
class AnswerInfo(Schema):
......@@ -54,13 +54,13 @@ class QuestionListRequest(Schema):
class QuestionImage(Schema):
video_pic: Optional[str] = Field('', description="图片地址")
video_url: Optional[str] = Field('', description="视频地址")
short_video_url: Optional[str] = Field('', description="短视频地址")
# video_pic: Optional[str] = Field('', description="图片地址")
# video_url: Optional[str] = Field('', description="视频地址")
# short_video_url: Optional[str] = Field('', description="短视频地址")
# image_webp: str = Field(..., description="webp图片地址")
image_url: str = Field(..., description="图片地址")
image_webp: str = Field(..., description="webp图片地址")
height: int = Field(0, description="图片地址")
width: str = Field(0, description="图片地址")
width: int = Field(0, description="图片地址")
class VideoCoverList(Schema):
......@@ -68,7 +68,7 @@ class VideoCoverList(Schema):
video_url: Optional[str] = Field('', description="视频地址")
short_video_url: Optional[str] = Field('', description="短视频地址")
height: int = Field(0, description="图片地址")
width: str = Field(0, description="图片地址")
width: int = Field(0, description="图片地址")
class QuestionInfo(Schema):
......
......@@ -20,7 +20,7 @@ class VisualPageListRequest(Schema):
class Image(Schema):
height: int = Field(0, description="图片地址")
width: str = Field(0, description="图片地址")
width: int = Field(0, description="图片地址")
image_url: str = Field(..., description="图片地址")
......
......@@ -106,7 +106,8 @@ class TractateFormat(BaseFormat):
tractate_data = {
"id": info["tractate_id"],
"title": info["title"],
"content": gm_decode_html(info["content"]),
"gm_url": gm_protocol.get_tractate_detail(info["tractate_id"]),
"content": gm_decode_html(info["title"] or info["content"]),
"is_voted": info.get("is_voted", False),
"vote_num": info.get("is_voted", 0),
"reply_amount": info.get("reply_amount", 0),
......
......@@ -18,7 +18,7 @@ class Image(Schema):
image_webp: str = Field('', description="webp图片地址")
height: int = Field(0, description="图片地址")
width: str = Field(0, description="图片地址")
width: int = Field(0, description="图片地址")
image_url: str = Field(..., description="图片地址")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment