From 30cd519dff864eccf73c5beaa4233719a0533771 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Mon, 28 Aug 2023 16:27:43 +0900 Subject: [PATCH] =?UTF-8?q?WebClient=20JSON=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/interfaces/smg/service/bean/SmgReceiverBean.java | 4 ++-- .../xit/interfaces/smg/service/bean/SmgSenderBean.java | 8 ++++---- .../java/cokr/xit/interfaces/smg/web/SmgController.java | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgReceiverBean.java b/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgReceiverBean.java index 9006607..1d9d922 100644 --- a/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgReceiverBean.java +++ b/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgReceiverBean.java @@ -149,8 +149,8 @@ public class SmgReceiverBean extends FileJobBean { new WebClient().post(req -> req.uri(alert) - .data("interfaceSequences", interfaceSequences) - .json(true) + .contentType(WebClient.Request.ContentType.JSON) + .bodyData(interfaceSequences) .async(true) ); } diff --git a/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgSenderBean.java b/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgSenderBean.java index 610e9b3..0db042a 100644 --- a/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgSenderBean.java +++ b/src/main/java/cokr/xit/interfaces/smg/service/bean/SmgSenderBean.java @@ -161,10 +161,10 @@ public class SmgSenderBean extends FileJobBean { new WebClient().post(req -> req.uri(alert) - .data("success", success) - .data("fail", fail) - .json(true) - .async(true) + .contentType(WebClient.Request.ContentType.JSON) + .data("success", success) + .data("fail", fail) + .async(true) ); } } \ No newline at end of file diff --git a/src/main/java/cokr/xit/interfaces/smg/web/SmgController.java b/src/main/java/cokr/xit/interfaces/smg/web/SmgController.java index 702b92f..b3477e3 100644 --- a/src/main/java/cokr/xit/interfaces/smg/web/SmgController.java +++ b/src/main/java/cokr/xit/interfaces/smg/web/SmgController.java @@ -32,8 +32,7 @@ public class SmgController extends AbstractController { * */ @PostMapping(value = "/petition/receive.do", name = "국민 신문고 민원 수신") - public ModelAndView receivePetitions(@RequestBody Map result) { - List interfaceSequences = (List)result.get("interfaceSequences"); + public ModelAndView receivePetitions(@RequestBody List interfaceSequences) { boolean empty = isEmpty(interfaceSequences); log().debug("interfaceSequences received: {}", empty ? "none" : String.join(", ", interfaceSequences));