From fd296d1a6acccbe9f3a72623719bf7101725f4e9 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 06 五月 2021 09:28:22 +0800 Subject: [PATCH] Merge pull request #93 from yu1183688986/wvp-28181-2.0 --- src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java index 9b2e4f0..62f732e 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java @@ -4,12 +4,12 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.service.IStreamProxyService; +import com.genersoft.iot.vmp.vmanager.bean.WVPResult; import com.github.pagehelper.PageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -import io.swagger.models.auth.In; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -57,10 +57,13 @@ }) @PostMapping(value = "/save") @ResponseBody - public Object save(@RequestBody StreamProxyItem param){ + public WVPResult save(@RequestBody StreamProxyItem param){ logger.info("娣诲姞浠g悊锛� " + JSONObject.toJSONString(param)); - streamProxyService.save(param); - return "success"; + String msg = streamProxyService.save(param); + WVPResult<Object> result = new WVPResult<>(); + result.setCode(0); + result.setMsg(msg); + return result; } @ApiOperation("绉婚櫎浠g悊") @@ -70,10 +73,13 @@ }) @DeleteMapping(value = "/del") @ResponseBody - public Object del(String app, String stream){ + public WVPResult del(String app, String stream){ logger.info("绉婚櫎浠g悊锛� " + app + "/" + stream); streamProxyService.del(app, stream); - return "success"; + WVPResult<Object> result = new WVPResult<>(); + result.setCode(0); + result.setMsg("success"); + return result; } @ApiOperation("鍚敤浠g悊") @@ -86,7 +92,7 @@ public Object start(String app, String stream){ logger.info("鍚敤浠g悊锛� " + app + "/" + stream); boolean result = streamProxyService.start(app, stream); - return "success"; + return result?"success":"fail"; } @ApiOperation("鍋滅敤浠g悊") -- Gitblit v1.8.0