Commit 3d88881f670c4404bf8c7c984a8f484a8f69f60f
1 parent
e4148d9b
SSE推送请求应为GET
Showing
1 changed file
with
2 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java
| @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiOperation; | @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiOperation; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.stereotype.Controller; | 9 | import org.springframework.stereotype.Controller; |
| 10 | import org.springframework.web.bind.annotation.CrossOrigin; | 10 | import org.springframework.web.bind.annotation.CrossOrigin; |
| 11 | -import org.springframework.web.bind.annotation.PostMapping; | 11 | +import org.springframework.web.bind.annotation.GetMapping; |
| 12 | import org.springframework.web.bind.annotation.RequestMapping; | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
| 13 | import org.springframework.web.bind.annotation.RequestParam; | 13 | import org.springframework.web.bind.annotation.RequestParam; |
| 14 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; | 14 | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; |
| @@ -30,7 +30,7 @@ public class SseController { | @@ -30,7 +30,7 @@ public class SseController { | ||
| 30 | @ApiImplicitParams({ | 30 | @ApiImplicitParams({ |
| 31 | @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), | 31 | @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), |
| 32 | }) | 32 | }) |
| 33 | - @PostMapping("/emit") | 33 | + @GetMapping("/emit") |
| 34 | public SseEmitter emit(@RequestParam String browserId) { | 34 | public SseEmitter emit(@RequestParam String browserId) { |
| 35 | final SseEmitter sseEmitter = new SseEmitter(0L); | 35 | final SseEmitter sseEmitter = new SseEmitter(0L); |
| 36 | try { | 36 | try { |