From aea7609e9c4b670b26379754f0299bf8c5d2c646 Mon Sep 17 00:00:00 2001 From: dds Date: Fri, 2 Aug 2019 09:53:26 +0800 Subject: [PATCH] Revert "first blood" This reverts commit 771d75a --- .../com/example/demo/RemoteOperation.java | 22 +++++++++++++++ .../com/example/demo/WebSocketController.java | 27 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/main/java/com/example/demo/RemoteOperation.java create mode 100644 src/main/java/com/example/demo/WebSocketController.java diff --git a/src/main/java/com/example/demo/RemoteOperation.java b/src/main/java/com/example/demo/RemoteOperation.java new file mode 100644 index 0000000..c028b58 --- /dev/null +++ b/src/main/java/com/example/demo/RemoteOperation.java @@ -0,0 +1,22 @@ +package com.example.demo; + +public class RemoteOperation { + long vmc_no; + String operation; + + public long getVmc_no() { + return vmc_no; + } + + public void setVmc_no(long vmc_no) { + this.vmc_no = vmc_no; + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } +} diff --git a/src/main/java/com/example/demo/WebSocketController.java b/src/main/java/com/example/demo/WebSocketController.java new file mode 100644 index 0000000..cd691d5 --- /dev/null +++ b/src/main/java/com/example/demo/WebSocketController.java @@ -0,0 +1,27 @@ +package com.example.demo; + +import com.google.gson.Gson; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class WebSocketController { + +// @RequestMapping(value = "/operation/{vmc}/{cmd}") +// public String remote(@PathVariable("vmc") long vmc, @PathVariable("cmd") String cmd) { +// System.out.print("remote"); +// RemoteOperation operation = new RemoteOperation(); +// operation.setVmc_no(vmc); +// operation.setOperation(cmd); +// String message = new Gson().toJson(operation); +// System.out.println("message in json is :" + message); +// return WebSocketServer.sendMessage(message, vmc); +// } + +// @RequestMapping(value = "/test") +// public String test() { +// System.out.print("test"); +// return "hello world"; +// } +} \ No newline at end of file