WebClient JSON 요청 수정

master
mjkhan21 1 year ago
parent 1d48c425a9
commit 30cd519dff

@ -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)
);
}

@ -161,9 +161,9 @@ public class SmgSenderBean extends FileJobBean {
new WebClient().post(req ->
req.uri(alert)
.contentType(WebClient.Request.ContentType.JSON)
.data("success", success)
.data("fail", fail)
.json(true)
.async(true)
);
}

@ -32,8 +32,7 @@ public class SmgController extends AbstractController {
* </ul>
*/
@PostMapping(value = "/petition/receive.do", name = "국민 신문고 민원 수신")
public ModelAndView receivePetitions(@RequestBody Map<String, Object> result) {
List<String> interfaceSequences = (List<String>)result.get("interfaceSequences");
public ModelAndView receivePetitions(@RequestBody List<String> interfaceSequences) {
boolean empty = isEmpty(interfaceSequences);
log().debug("interfaceSequences received: {}", empty ? "none" : String.join(", ", interfaceSequences));

Loading…
Cancel
Save