Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
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
谢林臻
sun
Commits
bdef5df7
Commit
bdef5df7
authored
Sep 05, 2019
by
钟尚武
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Like 2.3功能上线 See merge request
alpha/sun!346
parents
dc54a451
28b3b78f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
pictorial.py
api/pictorial.py
+2
-1
reply.py
api/reply.py
+1
-1
tag.py
api/tag.py
+8
-0
user.py
api/user.py
+8
-0
No files found.
api/pictorial.py
View file @
bdef5df7
...
@@ -51,6 +51,7 @@ class PictorialUpdateOrCreate(APIView):
...
@@ -51,6 +51,7 @@ class PictorialUpdateOrCreate(APIView):
pictorial_user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'pictorial_user_ids'
,
'[]'
))
pictorial_user_ids
=
json
.
loads
(
request
.
POST
.
get
(
'pictorial_user_ids'
,
'[]'
))
collection_tag_ids
=
json
.
loads
(
request
.
POST
.
get
(
'collection_tag_ids'
,
'[]'
))
collection_tag_ids
=
json
.
loads
(
request
.
POST
.
get
(
'collection_tag_ids'
,
'[]'
))
pictorial_activity_id
=
request
.
POST
.
get
(
'pictorial_activity_id'
)
pictorial_activity_id
=
request
.
POST
.
get
(
'pictorial_activity_id'
)
tab_config
=
request
.
POST
.
get
(
"tab_config"
,
"[]"
)
data
=
{
data
=
{
'name'
:
request
.
POST
.
get
(
'name'
,
''
),
'name'
:
request
.
POST
.
get
(
'name'
,
''
),
'description'
:
request
.
POST
.
get
(
'description'
,
''
),
'description'
:
request
.
POST
.
get
(
'description'
,
''
),
...
@@ -69,7 +70,7 @@ class PictorialUpdateOrCreate(APIView):
...
@@ -69,7 +70,7 @@ class PictorialUpdateOrCreate(APIView):
'pictorial_activity_ids'
:
[
int
(
pictorial_activity_id
)]
if
pictorial_activity_id
else
[],
'pictorial_activity_ids'
:
[
int
(
pictorial_activity_id
)]
if
pictorial_activity_id
else
[],
'alias'
:
request
.
POST
.
get
(
'alias'
,
''
),
'alias'
:
request
.
POST
.
get
(
'alias'
,
''
),
'comment_talk'
:
request
.
POST
.
get
(
'pictorial_comment_talk'
,
''
),
'comment_talk'
:
request
.
POST
.
get
(
'pictorial_comment_talk'
,
''
),
'tab_config'
:
json
.
loads
(
tab_config
),
}
}
try
:
try
:
data
=
self
.
rpc
[
'venus/sun/pictorial/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/pictorial/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
...
...
api/reply.py
View file @
bdef5df7
...
@@ -72,7 +72,7 @@ class ReplyVote(APIView):
...
@@ -72,7 +72,7 @@ class ReplyVote(APIView):
vote_num
=
int
(
request
.
POST
.
get
(
'vote_num'
))
vote_num
=
int
(
request
.
POST
.
get
(
'vote_num'
))
try
:
try
:
self
.
rpc
[
'venus/sun/reply/vote'
](
reply_id
=
reply_id
,
vote_num
=
vote_num
)
.
unwrap
()
self
.
rpc
[
'venus/sun/reply/vote'
](
reply_id
=
reply_id
,
v
irtual_v
ote_num
=
vote_num
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
error_logger
.
error
(
u'编辑帖子失败
%
s'
,
e
)
error_logger
.
error
(
u'编辑帖子失败
%
s'
,
e
)
raise
raise
...
...
api/tag.py
View file @
bdef5df7
...
@@ -54,6 +54,12 @@ class TagUpdateOrCreateView(APIView):
...
@@ -54,6 +54,12 @@ class TagUpdateOrCreateView(APIView):
down_tags
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'down_tags'
,
'[]'
))))))
down_tags
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'down_tags'
,
'[]'
))))))
up_tags
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'up_tags'
,
'[]'
))))))
up_tags
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'up_tags'
,
'[]'
))))))
tagtypes
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'tagtypes'
,
'[]'
))))))
tagtypes
=
list
(
set
(
map
(
lambda
x
:
x
.
split
(
":"
)[
0
],
json
.
loads
((
request
.
POST
.
get
(
'tagtypes'
,
'[]'
))))))
request
.
POST
.
get
(
'official_pictorial_id'
,
''
)
.
split
(
":"
)
official_pictorial_id
=
request
.
POST
.
get
(
'official_pictorial_id'
,
''
)
.
split
(
":"
)
if
official_pictorial_id
:
official_pictorial_id
=
official_pictorial_id
[
0
]
else
:
official_pictorial_id
=
None
data
=
{
data
=
{
'name'
:
request
.
POST
.
get
(
'name'
)
.
lower
(),
'name'
:
request
.
POST
.
get
(
'name'
)
.
lower
(),
...
@@ -65,6 +71,8 @@ class TagUpdateOrCreateView(APIView):
...
@@ -65,6 +71,8 @@ class TagUpdateOrCreateView(APIView):
'platform'
:
request
.
POST
.
get
(
'platform'
,
1
),
'platform'
:
request
.
POST
.
get
(
'platform'
,
1
),
'collection'
:
request
.
POST
.
get
(
'collection'
,
0
),
'collection'
:
request
.
POST
.
get
(
'collection'
,
0
),
'alias'
:
request
.
POST
.
get
(
'alias'
,
''
),
'alias'
:
request
.
POST
.
get
(
'alias'
,
''
),
'is_core'
:
request
.
POST
.
get
(
'is_core'
,
0
),
'official_pictorial_id'
:
official_pictorial_id
,
'is_show_in_register'
:
request
.
POST
.
get
(
'is_show_in_register'
,
'false'
),
'is_show_in_register'
:
request
.
POST
.
get
(
'is_show_in_register'
,
'false'
),
'pictorial_ids'
:
list
(
'pictorial_ids'
:
list
(
(
map
(
lambda
x
:
int
(
x
.
split
(
":"
)[
0
]),
json
.
loads
((
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
))))))
(
map
(
lambda
x
:
int
(
x
.
split
(
":"
)[
0
]),
json
.
loads
((
request
.
POST
.
get
(
'pictorial_ids'
,
'[]'
))))))
...
...
api/user.py
View file @
bdef5df7
...
@@ -66,6 +66,13 @@ class UserUpdateOrCreate(APIView):
...
@@ -66,6 +66,13 @@ class UserUpdateOrCreate(APIView):
body_esthetics_tag_ids
=
list
(
body_esthetics_tag_ids
=
list
(
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'body_esthetics_tags'
,
'[]'
))))
map
(
lambda
x
:
x
.
split
(
':'
)[
0
],
json
.
loads
(
request
.
POST
.
get
(
'body_esthetics_tags'
,
'[]'
))))
expert_tags
=
json
.
loads
(
request
.
POST
.
get
(
'expert_tags'
,
'[]'
))
try
:
expert_tag_ids
=
[[
int
(
item
[
0
]
.
split
(
":"
)[
0
]),
int
(
item
[
1
])]
for
item
in
expert_tags
]
except
:
error_logger
.
error
(
u'创建/编辑
%
s用户详情失败
%
s'
%
(
id
,
e
))
raise
data
=
{
data
=
{
'user_id'
:
user_id
,
'user_id'
:
user_id
,
'password'
:
password
,
'password'
:
password
,
...
@@ -80,6 +87,7 @@ class UserUpdateOrCreate(APIView):
...
@@ -80,6 +87,7 @@ class UserUpdateOrCreate(APIView):
'gender'
:
request
.
POST
.
get
(
'gender'
),
'gender'
:
request
.
POST
.
get
(
'gender'
),
'is_tcc'
:
int
(
request
.
POST
.
get
(
'is_tcc'
,
0
)),
'is_tcc'
:
int
(
request
.
POST
.
get
(
'is_tcc'
,
0
)),
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
'body_esthetics_tag_ids'
:
body_esthetics_tag_ids
,
'expert_tag_ids'
:
expert_tag_ids
,
'is_kol'
:
int
(
request
.
POST
.
get
(
'is_kol'
,
0
)),
'is_kol'
:
int
(
request
.
POST
.
get
(
'is_kol'
,
0
)),
}
}
...
...
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