648540858
2022-10-18 1af77ab5f7c11a4b3d59c1989b51b9fca29679ce
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/SseController/SseController.java
@@ -1,13 +1,12 @@
package com.genersoft.iot.vmp.vmanager.gb28181.SseController;
import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEventListener;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
@@ -17,7 +16,7 @@
 * @author: lawrencehj
 * @data: 2021-01-20
 */
@Api(tags = "SSE推送")
@Tag(name  = "SSE推送")
@CrossOrigin
@Controller
@RequestMapping("/api")
@@ -25,11 +24,7 @@
    @Autowired
    AlarmEventListener alarmEventListener;
    @ApiOperation("设置响应")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class),
    })
    @RequestMapping("/emit")
    @GetMapping("/emit")
    public SseEmitter emit(@RequestParam String browserId) {
        final SseEmitter sseEmitter = new SseEmitter(0L);
        try {