This commit is contained in:
chenyang
2022-07-01 21:39:55 +08:00
parent 19e477a9ca
commit 0a244b34cc
5 changed files with 29 additions and 9 deletions
+2
View File
@@ -0,0 +1,2 @@
CODE_SUCCESS = 0
CODE_FAILED = -1
+2 -1
View File
@@ -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})