Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
card
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanglu
card
Commits
82a9cb82
Commit
82a9cb82
authored
Dec 07, 2020
by
zhanglu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
fix: 修复图片宽字段类型;问题schema去除部分无用字段
parent
ecef6843
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
14 deletions
+15
-14
schemas.py
card/views/live/schemas.py
+1
-1
format.py
card/views/qa/format.py
+3
-3
schemas.py
card/views/qa/schemas.py
+7
-7
schemas.py
card/views/special_pool/schemas.py
+1
-1
format.py
card/views/tractate/format.py
+2
-1
schemas.py
card/views/tractate/schemas.py
+1
-1
No files found.
card/views/live/schemas.py
View file @
82a9cb82
...
@@ -24,7 +24,7 @@ class LiveNoticeListRequest(Schema):
...
@@ -24,7 +24,7 @@ class LiveNoticeListRequest(Schema):
class
Image
(
Schema
):
class
Image
(
Schema
):
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
str
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
...
...
card/views/qa/format.py
View file @
82a9cb82
...
@@ -130,9 +130,9 @@ class QuestionFormat(AnswerFormat):
...
@@ -130,9 +130,9 @@ class QuestionFormat(AnswerFormat):
question
.
video_pic
=
video_item
.
get
(
"video_pic"
,
""
)
question
.
video_pic
=
video_item
.
get
(
"video_pic"
,
""
)
question
.
short_video_url
=
video_item
.
get
(
"short_video_url"
,
""
)
question
.
short_video_url
=
video_item
.
get
(
"short_video_url"
,
""
)
question
.
images
.
video_url
=
question
.
video_url
#
question.images.video_url = question.video_url
question
.
images
.
video_pic
=
question
.
video_url
# question.images.video_pic = question.video_pic
question
.
images
.
short_video_url
=
question
.
video_url
# question.images.short_video_url = question.short_
video_url
question
.
content
=
gm_decode_html
(
item
.
pop
(
"row_content"
,
""
))
question
.
content
=
gm_decode_html
(
item
.
pop
(
"row_content"
,
""
))
...
...
card/views/qa/schemas.py
View file @
82a9cb82
...
@@ -19,7 +19,7 @@ class QaImage(Schema):
...
@@ -19,7 +19,7 @@ class QaImage(Schema):
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
image_webp
:
str
=
Field
(
...
,
description
=
"webp图片地址"
)
image_webp
:
str
=
Field
(
...
,
description
=
"webp图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
str
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
class
AnswerInfo
(
Schema
):
class
AnswerInfo
(
Schema
):
...
@@ -54,13 +54,13 @@ class QuestionListRequest(Schema):
...
@@ -54,13 +54,13 @@ class QuestionListRequest(Schema):
class
QuestionImage
(
Schema
):
class
QuestionImage
(
Schema
):
video_pic
:
Optional
[
str
]
=
Field
(
''
,
description
=
"图片地址"
)
# video_pic: Optional[str] = Field('', description="图片地址")
video_url
:
Optional
[
str
]
=
Field
(
''
,
description
=
"视频地址"
)
# video_url: Optional[str] = Field('', description="视频地址")
short_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_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
image_webp
:
str
=
Field
(
...
,
description
=
"webp图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
str
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
class
VideoCoverList
(
Schema
):
class
VideoCoverList
(
Schema
):
...
@@ -68,7 +68,7 @@ class VideoCoverList(Schema):
...
@@ -68,7 +68,7 @@ class VideoCoverList(Schema):
video_url
:
Optional
[
str
]
=
Field
(
''
,
description
=
"视频地址"
)
video_url
:
Optional
[
str
]
=
Field
(
''
,
description
=
"视频地址"
)
short_video_url
:
Optional
[
str
]
=
Field
(
''
,
description
=
"短视频地址"
)
short_video_url
:
Optional
[
str
]
=
Field
(
''
,
description
=
"短视频地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
str
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
class
QuestionInfo
(
Schema
):
class
QuestionInfo
(
Schema
):
...
...
card/views/special_pool/schemas.py
View file @
82a9cb82
...
@@ -20,7 +20,7 @@ class VisualPageListRequest(Schema):
...
@@ -20,7 +20,7 @@ class VisualPageListRequest(Schema):
class
Image
(
Schema
):
class
Image
(
Schema
):
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
str
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
...
...
card/views/tractate/format.py
View file @
82a9cb82
...
@@ -106,7 +106,8 @@ class TractateFormat(BaseFormat):
...
@@ -106,7 +106,8 @@ class TractateFormat(BaseFormat):
tractate_data
=
{
tractate_data
=
{
"id"
:
info
[
"tractate_id"
],
"id"
:
info
[
"tractate_id"
],
"title"
:
info
[
"title"
],
"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
),
"is_voted"
:
info
.
get
(
"is_voted"
,
False
),
"vote_num"
:
info
.
get
(
"is_voted"
,
0
),
"vote_num"
:
info
.
get
(
"is_voted"
,
0
),
"reply_amount"
:
info
.
get
(
"reply_amount"
,
0
),
"reply_amount"
:
info
.
get
(
"reply_amount"
,
0
),
...
...
card/views/tractate/schemas.py
View file @
82a9cb82
...
@@ -18,7 +18,7 @@ class Image(Schema):
...
@@ -18,7 +18,7 @@ class Image(Schema):
image_webp
:
str
=
Field
(
''
,
description
=
"webp图片地址"
)
image_webp
:
str
=
Field
(
''
,
description
=
"webp图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
height
:
int
=
Field
(
0
,
description
=
"图片地址"
)
width
:
str
=
Field
(
0
,
description
=
"图片地址"
)
width
:
int
=
Field
(
0
,
description
=
"图片地址"
)
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
image_url
:
str
=
Field
(
...
,
description
=
"图片地址"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment