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
1
Merge Requests
1
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
alpha
sun
Commits
b9dbd592
Commit
b9dbd592
authored
Sep 23, 2019
by
yangchenglin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
survey
parent
8d3b5758
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
survey.py
api/survey.py
+37
-0
urls.py
api/urls.py
+7
-0
No files found.
api/survey.py
0 → 100644
View file @
b9dbd592
from
utils.base
import
APIView
class
SurveyListView
(
APIView
):
def
get
(
self
,
request
):
data
=
self
.
rpc
[
'venus/sun/survey/list'
]()
.
unwrap
()
return
data
class
SurveyView
(
APIView
):
def
get
(
self
,
request
):
id_
=
int
(
request
.
GET
.
get
(
'template_id'
))
data
=
self
.
rpc
[
'venus/sun/survey/get'
](
id_
=
id_
)
.
unwrap
()
return
data
def
post
(
self
,
request
):
questions
=
request
.
POST
.
get
(
'questions'
)
data
=
{
"name"
:
request
.
POST
.
get
(
'name'
,
""
),
"questions"
:
questions
,
"template_id"
:
int
(
request
.
POST
.
get
(
'template_id'
,
0
)),
}
self
.
rpc
[
'venus/sun/survey/add'
](
data
=
data
)
.
unwrap
()
return
{
"status"
:
1
}
api/urls.py
View file @
b9dbd592
...
...
@@ -33,6 +33,7 @@ from .classify import *
from
.effect
import
*
from
.skin_check
import
*
from
.reply
import
*
from
.survey
import
*
urlpatterns
=
[
...
...
@@ -244,6 +245,12 @@ urlpatterns = [
# 测肤
url
(
r'^skin_check/pictorial$'
,
SkinCheckPictorial
.
as_view
()),
url
(
r'^skin_check/config$'
,
SkinCheckConfig
.
as_view
()),
# 调查问卷
url
(
r'^survey_question/create$'
,
SurveyView
.
as_view
()),
url
(
r'^survey_question/get$'
,
SurveyView
.
as_view
()),
url
(
r'^survey_question/list$'
,
SurveyListView
.
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