示例#1
0
def booth(*args, **kwargs):
    user = kwargs['user'].as_dict()
    if(request.method == 'PUT' or request.method == 'PATCH'):
        if(user['role_id'] == ROLE['booth']):
            return BoothController.update(request, user['id'])
        return Response(json.dumps({'message': 'unauthorized'}), status=401, mimetype='application/json')
    elif(request.method == 'POST'):
        return BoothController.create(request)
示例#2
0
文件: api.py 项目: devsummit/backend
def booth(*args, **kwargs):
    user = kwargs['user'].as_dict()
    if(request.method == 'PUT' or request.method == 'PATCH'):
        if(user['role_id'] == ROLE['booth']):
            return BoothController.update(request, user['id'])
        return 'Unauthorized'
    elif(request.method == 'POST'):
        return BoothController.create(request)
    elif(request.method == 'GET'):
        return BoothController.index(request)
示例#3
0
def generate_token(booth_id, *args, **kwargs):
    
    return BoothController.generate_room(request, booth_id)
示例#4
0
def update_booth_logo(*args, **kwargs):
    user = kwargs['user'].as_dict()
    return BoothController.update_logo(request, user)
示例#5
0
def booth_id(booth_id, *args, **kwargs):
    if(request.method == 'GET'):
        return BoothController.show(booth_id)
    return BoothController.update(request, None, booth_id)
示例#6
0
def get_exhibitors(*args, **kwargs):
    return BoothController.index(request)