callback api: String[] -> List<String>

master
mjkhan21 1 year ago
parent e2ec38191a
commit f7f30c9feb

@ -1,9 +1,13 @@
package cokr.xit.interfaces.smg.web; package cokr.xit.interfaces.smg.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -28,11 +32,13 @@ public class SmgController extends AbstractController {
* </ul> * </ul>
*/ */
@PostMapping(value = "/petition/receive.do", name = "국민 신문고 민원 수신") @PostMapping(value = "/petition/receive.do", name = "국민 신문고 민원 수신")
public ModelAndView receivePetitions(String[] interfaceSequences) { public ModelAndView receivePetitions(@RequestBody Map<String, Object> result) {
log().debug("interfaceSequences received: {}", String.join(", ", interfaceSequences)); List<String> interfaceSequences = (List<String>)result.get("interfaceSequences");
boolean empty = isEmpty(interfaceSequences);
log().debug("interfaceSequences received: {}", empty ? "none" : String.join(", ", interfaceSequences));
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("received", !isEmpty(interfaceSequences)) .addObject("received", !empty)
.addObject("saved", true); .addObject("saved", true);
} }
@ -45,7 +51,10 @@ public class SmgController extends AbstractController {
* </ul> * </ul>
*/ */
@PostMapping(value = "/petition/reply.do", name = "국민 신문고 민원 답변/반송 생성") @PostMapping(value = "/petition/reply.do", name = "국민 신문고 민원 답변/반송 생성")
public ModelAndView sendReplies(String[] success, String[] fail) { public ModelAndView sendReplies(@RequestBody Map<String, Object> result) {
List<String>
success = (List<String>)result.get("success"),
fail = (List<String>)result.get("fail");
log().debug("success: {}", String.join(", ", success)); log().debug("success: {}", String.join(", ", success));
log().debug("fail: {}", String.join(", ", fail)); log().debug("fail: {}", String.join(", ", fail));

Loading…
Cancel
Save