Commit c84fc087 authored by 陈伟's avatar 陈伟

Merge branch 'feature/suggestion' into 'test'

增加意见接口

See merge request alpha/sun!60
parents b073175f 3c2ea6dc
#! /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
...@@ -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 = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment