update
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
CODE_SUCCESS = 0
|
||||
CODE_FAILED = -1
|
||||
@@ -1,5 +1,6 @@
|
||||
from rest_framework.response import Response
|
||||
from server.util.constant_util import *
|
||||
|
||||
|
||||
def build_response(code=0, msg='', data=''):
|
||||
def build_response(code=CODE_SUCCESS, msg='', data=''):
|
||||
return Response({'code': code, 'msg': msg, 'data': data})
|
||||
|
||||
@@ -9,9 +9,10 @@ from server.filters import CooperationMindFilter
|
||||
from server.serializers import *
|
||||
from server.util.mix_util import build_response
|
||||
from server.util.pagination import NewPagination
|
||||
from server_auth.lib.auth import LoginRequiredJSONMixin
|
||||
|
||||
|
||||
class JsMindView(ListAPIView):
|
||||
class JsMindView(LoginRequiredJSONMixin, ListAPIView):
|
||||
"""
|
||||
思维导图view
|
||||
"""
|
||||
@@ -21,7 +22,6 @@ class JsMindView(ListAPIView):
|
||||
filter_class = CooperationMindFilter
|
||||
pagination_class = NewPagination
|
||||
|
||||
@login_required(login_url="dashboard")
|
||||
def get(self, request, *args, **kwargs):
|
||||
"""
|
||||
查询思维导图
|
||||
@@ -34,7 +34,6 @@ class JsMindView(ListAPIView):
|
||||
return build_response(data=serializer.data)
|
||||
return self.list(request, *args, **kwargs)
|
||||
|
||||
@login_required(login_url="dashboard")
|
||||
def post(self, request):
|
||||
"""
|
||||
创建思维导图
|
||||
|
||||
Reference in New Issue
Block a user