Commit dd6ac928 authored by yangchenglin's avatar yangchenglin

add total

parent 133d6c9a
...@@ -76,28 +76,28 @@ class ActivityDeleteView(APIView): ...@@ -76,28 +76,28 @@ class ActivityDeleteView(APIView):
return data return data
class PictorialActivityInfoView(APIView): class PictorialActivityListView(APIView):
def get(self, request): def get(self, request):
id_ = int(request.GET.get('id')) name = request.GET.get('name')
page = int(request.GET.get('page', 1))
count = int(request.GET.get('count', 10))
data = self.rpc['venus/sun/activity/pictrial/info'](id_=id_).unwrap() data = self.rpc['venus/sun/activity/pictrial/list'](name=name, offset=(page - 1) * count, count=count).unwrap()
if not data: if not data:
return r'获取失败' return r'获取失败'
return data.get("data") return data
class PictorialActivityView(APIView): class PictorialActivityView(APIView):
def get(self, request): def get(self, request):
name = request.GET.get('name') id_ = int(request.GET.get('id'))
page = int(request.GET.get('page', 1))
count = int(request.GET.get('count', 10))
data = self.rpc['venus/sun/activity/pictrial/list'](name=name, offset=(page - 1) * count, count=count).unwrap() data = self.rpc['venus/sun/activity/pictrial/info'](id_=id_).unwrap()
if not data: if not data:
return r'获取失败' return r'获取失败'
...@@ -108,8 +108,8 @@ class PictorialActivityView(APIView): ...@@ -108,8 +108,8 @@ class PictorialActivityView(APIView):
data = { data = {
"id": request.POST.get('id'), "id": request.POST.get('id'),
"name": request.POST.get('name', None), "name": request.POST.get('name', None),
"start_time": int(request.POST.get('start_time'))/1000, "start_time": request.POST.get('start_time'),
"end_time": int(request.POST.get('end_time'))/1000, "end_time": request.POST.get('end_time'),
"version": request.POST.get('version', '0.0.0'), "version": request.POST.get('version', '0.0.0'),
"banner": request.POST.get('banner'), "banner": request.POST.get('banner'),
"description": request.POST.get('description'), "description": request.POST.get('description'),
......
...@@ -184,8 +184,9 @@ urlpatterns = [ ...@@ -184,8 +184,9 @@ urlpatterns = [
url(r'^activity/create$', ActivityCreateView.as_view()), url(r'^activity/create$', ActivityCreateView.as_view()),
url(r'^activity/update$', ActivityUpdateView.as_view()), url(r'^activity/update$', ActivityUpdateView.as_view()),
url(r'^activity/delete$', ActivityDeleteView.as_view()), url(r'^activity/delete$', ActivityDeleteView.as_view()),
url(r'^activity/pictorial/get', PictorialActivityInfoView.as_view()),
url(r'^activity/pictorial', PictorialActivityView.as_view()), url(r'^activity/pictorial', PictorialActivityView.as_view()),
url(r'^activity/pictorial', PictorialActivityView.as_view()),
url(r'^activity/pictorial/list', PictorialActivityListView.as_view()),
url(r'^activity/pictorial/online', PictorialActivityView.as_view()), url(r'^activity/pictorial/online', PictorialActivityView.as_view()),
] ]
......
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