Beispiel #1
0
def pRarams(context, flute, request):

    response = LinkedHashMap()
    text = request.path()
    status = None

    if request.queryParams().size() != 0:
        text = text + "?"

        params = request.queryParams().toSingleValueMap()
        theFirst = True

        for key in params.keySet():
            if theFirst != True:
                text = text + "&"
            text = text + key + "=" + params.get(key)
            theFirst = False

        status = 200
    else:
        text = "there are no params received"
        status = 422

    response.put('text', text)
    response.put('status', status)

    return ServerResponse.status(HttpStatus.valueOf(status))\
        .body(Mono.just(text), String)
Beispiel #2
0
def handlerForApplicationFormUrlencoded(context, flute, request):
    data = request.body(BodyExtractors.toFormData()).block()

    result = 'param1='

    param1 = data['param1']
    for val in param1:
        result = result + val + ","

    result = result + 'param2='
    param2 = data['param2']
    for val in param2:
        result = result + val + ","

    return ServerResponse.ok().body(Mono.just(result), String)
Beispiel #3
0
def postorder(context, flute, request):
    doc = request.bodyToMono(dict).block()
    basic_operations.post_order(context, doc)
    return ServerResponse.ok().body(Mono.just('OK'), str)
Beispiel #4
0
def foo(context, flute, request):
    report = basic_operations.get_aggregate_report(context)
    return ServerResponse.ok().body(Mono.just(report), report.__class__)
Beispiel #5
0
def afterFilter(context, flute, request):
    data = request.attributes().get('data')
    data['foo'] = data['foo'] + 1
    return ServerResponse.ok().body(Mono.just(data), data.__class__)
Beispiel #6
0
def handlerForDoubleBeforeFilter(context, flute, request):
    data = request.attributes().get('data')
    data.add(3)
    return ServerResponse.ok().body(Mono.just(data), data.__class__)
Beispiel #7
0
def postWithJsonBody(context, flute, request):
    dto = request.bodyToMono(dict).block()
    dto['numb'] = dto['numb'] + 1
    return ServerResponse.ok().body(Mono.just(dto), dto.__class__)
Beispiel #8
0
def handlerForTestReturnFromHandler(context, flute, request):
    dto = {"foo": 1}
    return ServerResponse.ok().body(Mono.just(dto), dto.__class__)
Beispiel #9
0
def after2TestReturnFromAfter(context, flute, request):
    dto = {"foo": 2}
    return ServerResponse.ok().body(Mono.just(dto), dto.__class__)
Beispiel #10
0
def fluteparam(context, flute, request):
    sid = flute.sourceId
    return ServerResponse.ok().body(Mono.just(sid), String)
Beispiel #11
0
def beforeTestReturnFromBefore(context, flute, request):
    dto = {"foo": 1}
    return ServerResponse.ok().body(Mono.just(dto), dto.__class__)
Beispiel #12
0
def handlerForCustomCelestaUserIdFilter(context, flute, request):
    dto = {"userId": context.getUserId()}
    return ServerResponse.ok().body(Mono.just(dto), dto.__class__)
Beispiel #13
0
def doubleAfterFilter2(context, flute, request):
    data = request.attributes().get('data')
    data.add(3)
    return ServerResponse.ok().body(Mono.just(data), data.__class__)
Beispiel #14
0
def foo(context, flute, request):
    dto = {"foo": 1, "bar": 2}
    return ServerResponse.ok().body(Mono.just(dto), dto.__class__)