From 6b5849899a4a2fdda81f72794f403355ec57f277 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sat, 18 May 2024 13:59:12 +0800 Subject: [PATCH] re-order FormJsonPost --- .../formJsonPost/app/src/FormJsonPost.scala | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/example/formJsonPost/app/src/FormJsonPost.scala b/example/formJsonPost/app/src/FormJsonPost.scala index f52cc274e2..4393eeb30c 100644 --- a/example/formJsonPost/app/src/FormJsonPost.scala +++ b/example/formJsonPost/app/src/FormJsonPost.scala @@ -13,17 +13,6 @@ object FormJsonPost extends cask.MainRoutes{ ) } - @cask.postJsonCached("/json-obj-cached") - def jsonEndpointObjCached(value1: ujson.Value, value2: Seq[Int], request: cask.Request) = { - ujson.Obj( - "value1" -> value1, - "value2" -> value2, - // `postJsonCached` buffers up the body of the request in memory before parsing, - // giving you access to the request body data if you want to use it yourself - "body" -> request.text() - ) - } - @cask.postForm("/form") def formEndpoint(value1: cask.FormValue, value2: Seq[Int]) = { "OK " + value1 + " " + value2 @@ -51,6 +40,17 @@ object FormJsonPost extends cask.MainRoutes{ "OK " + value1 + " " + value2 + " " + params.value + " " + segments.value } + @cask.postJsonCached("/json-obj-cached") + def jsonEndpointObjCached(value1: ujson.Value, value2: Seq[Int], request: cask.Request) = { + ujson.Obj( + "value1" -> value1, + "value2" -> value2, + // `postJsonCached` buffers up the body of the request in memory before parsing, + // giving you access to the request body data if you want to use it yourself + "body" -> request.text() + ) + } + @cask.postForm("/form-extra") def formEndpointExtra(value1: cask.FormValue, value2: Seq[Int],