mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-browsers: JsonParser static method in CustomWebhook
parent
3e9eef2d27
commit
189c6264c2
|
@ -46,7 +46,6 @@ public class CustomWebhook {
|
||||||
|
|
||||||
public static CountDownLatch initLatch;
|
public static CountDownLatch initLatch;
|
||||||
private static Map<String, BlockingQueue<JsonObject>> events = new ConcurrentHashMap<>();
|
private static Map<String, BlockingQueue<JsonObject>> events = new ConcurrentHashMap<>();
|
||||||
private static JsonParser jsonParser = new JsonParser();
|
|
||||||
|
|
||||||
public static void main(String[] args, CountDownLatch initLatch) {
|
public static void main(String[] args, CountDownLatch initLatch) {
|
||||||
CustomWebhook.initLatch = initLatch;
|
CustomWebhook.initLatch = initLatch;
|
||||||
|
@ -76,7 +75,7 @@ public class CustomWebhook {
|
||||||
public class WebhookController {
|
public class WebhookController {
|
||||||
@RequestMapping("/webhook")
|
@RequestMapping("/webhook")
|
||||||
public void webhook(@RequestBody String eventString) {
|
public void webhook(@RequestBody String eventString) {
|
||||||
JsonObject event = (JsonObject) jsonParser.parse(eventString);
|
JsonObject event = JsonParser.parseString(eventString).getAsJsonObject();
|
||||||
final String eventName = event.get("event").getAsString();
|
final String eventName = event.get("event").getAsString();
|
||||||
System.out.println("Webhook event: " + event.toString());
|
System.out.println("Webhook event: " + event.toString());
|
||||||
if (events.get(eventName) == null) {
|
if (events.get(eventName) == null) {
|
||||||
|
|
Loading…
Reference in New Issue