package hello;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/webhook")
public class HelloWorldController {

    @RequestMapping(method = RequestMethod.POST)
    public @ResponseBody WebhookResponse webhook(@RequestBody String obj){

        
        JSONObject objS = new JSONObject(obj);
//          System.out.println(objS.get("id"));
          JSONObject result = objS.getJSONObject("result");
          String text = result.getString("resolvedQuery");
        System.out.println(text);

        return new WebhookResponse(text, text);
    }
}

@@ -507,16 +507,44 @@
 g obj)%7B%0A
+        String text=%22%22;%0Atry%7B
 %0A       
@@ -793,16 +793,37 @@
 (text);%0A
+%7Dcatch(Exception e)%7B%7D
 %0A       

Update HelloWorldController.java