stockticker-master

时间:2018-09-09 08:35:46
【文件属性】:

文件名称:stockticker-master

文件大小:13KB

文件格式:ZIP

更新时间:2018-09-09 08:35:46

websocket

基于spring websocket通讯,package com.concretepage.controller; import org.springframework.messaging.handler.annotation.MessageMapping; import org.springframework.messaging.handler.annotation.SendTo; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.concretepage.vo.CalcInput; import com.concretepage.vo.Result; @Controller public class WebSocketController { @MessageMapping("/add" ) @SendTo("/topic/showResult") public Result addNum(CalcInput input) throws Exception { Thread.sleep(2000); Result result = new Result(input.getNum1()+"+"+input.getNum2()+"="+(input.getNum1()+input.getNum2())); return result; } @RequestMapping("/start") public String start() { return "start"; } }


【文件预览】:
stockticker-master
----src()
--------test()
--------main()
----README.md(401B)
----pom.xml(4KB)
----.gitignore(50B)

网友评论