-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix gatewat swagger * fix gateway * add log stream * update log stream * update log stream * update log stream * update log stream * update log stream * update log stream * update log stream * update log stream * fix ftl * fix label_field * fix mode * update log stream * update log stream * Optimize (#236) * add model log * rm model log * fix template --------- Co-authored-by: rk2b-fenghaolun <[email protected]>
- Loading branch information
1 parent
8470ecd
commit 56f854e
Showing
25 changed files
with
244 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...pplication/src/main/java/com/primihub/application/controller/stream/StreamController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.primihub.application.controller.stream; | ||
|
||
import com.primihub.biz.entity.base.BaseResultEntity; | ||
import com.primihub.biz.entity.base.BaseResultEnum; | ||
import com.primihub.biz.service.data.DataTaskService; | ||
import io.swagger.annotations.Api; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; | ||
|
||
|
||
|
||
@Api(value = "流传输接口",tags = "流传输接口") | ||
@RequestMapping("stream") | ||
@RestController | ||
@Slf4j | ||
public class StreamController { | ||
|
||
@Autowired | ||
private DataTaskService dataTaskService; | ||
|
||
/** | ||
* 用于创建连接 | ||
*/ | ||
@GetMapping(value = "sseTaskConnect/{taskId}",produces = MediaType.TEXT_EVENT_STREAM_VALUE) | ||
public SseEmitter connect(@PathVariable String taskId) { | ||
// return dataTaskService.connectSseTask1(taskId); | ||
return dataTaskService.connectSseTask(taskId); | ||
} | ||
|
||
// @GetMapping(value = "send/{taskId}") | ||
// public String send(@PathVariable String taskId){ | ||
// dataTaskService.send(taskId); | ||
// return "su"; | ||
// } | ||
|
||
/** | ||
* 关闭连接 | ||
*/ | ||
@GetMapping("sseTaskClose/{taskId}") | ||
public BaseResultEntity close(@PathVariable("taskId") String taskId) { | ||
if (StringUtils.isBlank(taskId)) { | ||
return BaseResultEntity.failure(BaseResultEnum.LACK_OF_PARAM,"taskId"); | ||
} | ||
dataTaskService.removeSseTask(taskId); | ||
return BaseResultEntity.success(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.