|  |  |  | 
|---|
|  |  |  | 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.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestParam; | 
|---|
|  |  |  | import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | AlarmEventListener alarmEventListener; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("设置响应") | 
|---|
|  |  |  | @ApiOperation("浏览器推送") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(name = "browserId", value = "浏览器ID", dataTypeClass = String.class), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @RequestMapping("/emit") | 
|---|
|  |  |  | @PostMapping("/emit") | 
|---|
|  |  |  | public SseEmitter emit(@RequestParam String browserId) { | 
|---|
|  |  |  | final SseEmitter sseEmitter = new SseEmitter(0L); | 
|---|
|  |  |  | try { | 
|---|