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
49bcea70
Commit
49bcea70
authored
Feb 14, 2019
by
陈伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/suggestion' into 'dev'
增加意见接口 See merge request
alpha/sun!61
parents
06e7e5aa
3c2ea6dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
commons.py
api/commons.py
+21
-0
urls.py
api/urls.py
+3
-0
No files found.
api/commons.py
0 → 100644
View file @
49bcea70
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# Date: 2019/2/14
from
utils.base
import
APIView
from
utils.logger
import
error_logger
class
SuggestionListView
(
APIView
):
def
get
(
self
,
request
):
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/sun/suggestion/list'
](
offset
=
(
page
-
1
)
*
limit
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取建议列表失败
%
s'
,
e
)
raise
return
data
\ No newline at end of file
api/urls.py
View file @
49bcea70
...
@@ -19,6 +19,7 @@ from .upload import *
...
@@ -19,6 +19,7 @@ from .upload import *
from
.token
import
*
from
.token
import
*
from
.face_star
import
*
from
.face_star
import
*
from
.advertise
import
*
from
.advertise
import
*
from
.commons
import
*
urlpatterns
=
[
urlpatterns
=
[
# 登陆,注销相关
# 登陆,注销相关
...
@@ -111,6 +112,8 @@ urlpatterns = [
...
@@ -111,6 +112,8 @@ urlpatterns = [
url
(
r'^advertise/edit'
,
AdvertiseCreateView
.
as_view
()),
url
(
r'^advertise/edit'
,
AdvertiseCreateView
.
as_view
()),
url
(
r'^advertise/list$'
,
AdvertiseListView
.
as_view
()),
url
(
r'^advertise/list$'
,
AdvertiseListView
.
as_view
()),
url
(
r'^advertise/create$'
,
AdvertiseCreateView
.
as_view
()),
url
(
r'^advertise/create$'
,
AdvertiseCreateView
.
as_view
()),
url
(
r'^suggestion/list$'
,
SuggestionListView
.
as_view
())
]
]
search_urlpatterns
=
[
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