diff --git a/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java
index 8633cceb..bbee224c 100755
--- a/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java
+++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/controller/StreamProxyController.java
@@ -192,10 +192,9 @@ public class StreamProxyController {
@GetMapping(value = "/stop")
@ResponseBody
@Operation(summary = "停用代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
- @Parameter(name = "app", description = "应用名", required = true)
- @Parameter(name = "stream", description = "流id", required = true)
- public void stop(String app, String stream){
- log.info("停用代理: " + app + "/" + stream);
- streamProxyService.stopByAppAndStream(app, stream);
+ @Parameter(name = "id", description = "代理Id", required = true)
+ public void stop(int id){
+ log.info("停用代理: {}", id);
+ streamProxyService.stop(id);
}
}
diff --git a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/IStreamProxyService.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/IStreamProxyService.java
index 77259ee8..f445cc16 100755
--- a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/IStreamProxyService.java
+++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/IStreamProxyService.java
@@ -94,4 +94,6 @@ public interface IStreamProxyService {
void delete(int id);
StreamInfo start(int id);
+
+ void stop(int id);
}
diff --git a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java
index 8a14dfd7..1e7a3ab8 100755
--- a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java
@@ -474,8 +474,14 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
return streamProxyMapper.select(id);
}
-
-
+ @Override
+ public void stop(int id) {
+ StreamProxy streamProxy = streamProxyMapper.select(id);
+ if (streamProxy == null) {
+ throw new ControllerException(ErrorCode.ERROR404.getCode(), "代理信息未找到");
+ }
+ stopProxy(streamProxy);
+ }
// @Scheduled(cron = "* 0/10 * * * ?")
// public void asyncCheckStreamProxyStatus() {
diff --git a/web_src/src/components/StreamProxyList.vue b/web_src/src/components/StreamProxyList.vue
index 4a523bad..6255fc65 100755
--- a/web_src/src/components/StreamProxyList.vue
+++ b/web_src/src/components/StreamProxyList.vue
@@ -74,8 +74,10 @@
- 播放
+ 播放
+ 停止
+
编辑
@@ -274,6 +276,26 @@
console.log(error);
});
+ },
+ stopPlay: function(row){
+ let that = this;
+ this.$axios({
+ method: 'get',
+ url:`/api/proxy/stop`,
+ params: {
+ id: row.id,
+ }
+ }).then(function (res) {
+ if (res.data.code === 0) {
+
+ }else {
+ that.$message.error(res.data.msg);
+ }
+
+ }).catch(function (error) {
+ console.log(error);
+ });
+
},
queryCloudRecords: function (row) {