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
138553b7
Commit
138553b7
authored
Oct 18, 2019
by
钟尚武
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into 'master'
Like 2.5 上线 See merge request
alpha/sun!363
parents
e04dff75
f3ff85be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
survey.py
api/survey.py
+16
-3
topic.py
api/topic.py
+1
-0
urls.py
api/urls.py
+1
-0
No files found.
api/survey.py
View file @
138553b7
...
...
@@ -31,10 +31,23 @@ class SurveyView(APIView):
"template_id"
:
int
(
request
.
POST
.
get
(
'template_id'
,
0
)),
}
self
.
rpc
[
'venus/sun/survey/add'
](
data
=
data
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/survey/add'
](
data
=
data
)
.
unwrap
()
return
{
"status"
:
1
return
data
class
SurveyAddAnswerView
(
APIView
):
def
post
(
self
,
request
):
data
=
{
"answers"
:
json
.
loads
(
request
.
POST
.
get
(
'answers'
)),
"template_id"
:
request
.
POST
.
get
(
'template_id'
),
"question_order"
:
request
.
POST
.
get
(
'question_order'
),
}
self
.
rpc
[
'venus/sun/survey/answers_add'
](
data
=
data
)
.
unwrap
()
return
{
"status"
:
1
}
api/topic.py
View file @
138553b7
...
...
@@ -38,6 +38,7 @@ class TopicListView(APIView):
if
user_type
:
if
int
(
user_type
)
==
USER_EXTRA_TYPE
.
COMMON
:
filters
[
"is_shadow"
]
=
0
filters
[
"is_edit"
]
=
0
elif
int
(
user_type
)
==
USER_EXTRA_TYPE
.
SHADOW
:
filters
[
"is_shadow"
]
=
1
elif
int
(
user_type
)
==
USER_EXTRA_TYPE
.
KOL
:
...
...
api/urls.py
View file @
138553b7
...
...
@@ -252,6 +252,7 @@ urlpatterns = [
url
(
r'^survey_question/create$'
,
SurveyView
.
as_view
()),
url
(
r'^survey_question/get$'
,
SurveyView
.
as_view
()),
url
(
r'^survey_question/list$'
,
SurveyListView
.
as_view
()),
url
(
r'^survey_question/add_answer$'
,
SurveyAddAnswerView
.
as_view
()),
]
search_urlpatterns
=
[
...
...
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