Commit f10a9238dce358b197142564259d975358c48cb3
1 parent
2310087e
规范化api, 进行中。。。
Showing
12 changed files
with
113 additions
and
43 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/MobilePosition/MobilePositionController.java
| @@ -12,6 +12,10 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | @@ -12,6 +12,10 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | ||
| 12 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 12 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 13 | import com.github.pagehelper.util.StringUtil; | 13 | import com.github.pagehelper.util.StringUtil; |
| 14 | 14 | ||
| 15 | +import io.swagger.annotations.Api; | ||
| 16 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 17 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 18 | +import io.swagger.annotations.ApiOperation; | ||
| 15 | import org.slf4j.Logger; | 19 | import org.slf4j.Logger; |
| 16 | import org.slf4j.LoggerFactory; | 20 | import org.slf4j.LoggerFactory; |
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -25,9 +29,13 @@ import org.springframework.web.bind.annotation.RequestParam; | @@ -25,9 +29,13 @@ import org.springframework.web.bind.annotation.RequestParam; | ||
| 25 | import org.springframework.web.bind.annotation.RestController; | 29 | import org.springframework.web.bind.annotation.RestController; |
| 26 | import org.springframework.web.context.request.async.DeferredResult; | 30 | import org.springframework.web.context.request.async.DeferredResult; |
| 27 | 31 | ||
| 32 | +/** | ||
| 33 | + * 位置信息管理 | ||
| 34 | + */ | ||
| 35 | +@Api(tags = "位置信息管理") | ||
| 28 | @CrossOrigin | 36 | @CrossOrigin |
| 29 | @RestController | 37 | @RestController |
| 30 | -@RequestMapping("/api") | 38 | +@RequestMapping("/api/position") |
| 31 | public class MobilePositionController { | 39 | public class MobilePositionController { |
| 32 | 40 | ||
| 33 | private final static Logger logger = LoggerFactory.getLogger(MobilePositionController.class); | 41 | private final static Logger logger = LoggerFactory.getLogger(MobilePositionController.class); |
| @@ -40,8 +48,21 @@ public class MobilePositionController { | @@ -40,8 +48,21 @@ public class MobilePositionController { | ||
| 40 | 48 | ||
| 41 | @Autowired | 49 | @Autowired |
| 42 | private DeferredResultHolder resultHolder; | 50 | private DeferredResultHolder resultHolder; |
| 43 | - | ||
| 44 | - @GetMapping("/positions/{deviceId}/history") | 51 | + |
| 52 | + /** | ||
| 53 | + * 查询历史轨迹 | ||
| 54 | + * @param deviceId 设备ID | ||
| 55 | + * @param start 开始时间 | ||
| 56 | + * @param end 结束时间 | ||
| 57 | + * @return | ||
| 58 | + */ | ||
| 59 | + @ApiOperation("查询历史轨迹") | ||
| 60 | + @ApiImplicitParams({ | ||
| 61 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 62 | + @ApiImplicitParam(name = "start", value = "开始时间", required = true), | ||
| 63 | + @ApiImplicitParam(name = "end", value = "结束时间", required = true), | ||
| 64 | + }) | ||
| 65 | + @GetMapping("/history/{deviceId}") | ||
| 45 | public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId, | 66 | public ResponseEntity<List<MobilePosition>> positions(@PathVariable String deviceId, |
| 46 | @RequestParam(required = false) String start, | 67 | @RequestParam(required = false) String start, |
| 47 | @RequestParam(required = false) String end) { | 68 | @RequestParam(required = false) String end) { |
| @@ -60,7 +81,16 @@ public class MobilePositionController { | @@ -60,7 +81,16 @@ public class MobilePositionController { | ||
| 60 | return new ResponseEntity<>(result, HttpStatus.OK); | 81 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 61 | } | 82 | } |
| 62 | 83 | ||
| 63 | - @GetMapping("/positions/{deviceId}/latest") | 84 | + /** |
| 85 | + * 查询设备最新位置 | ||
| 86 | + * @param deviceId 设备ID | ||
| 87 | + * @return | ||
| 88 | + */ | ||
| 89 | + @ApiOperation("查询设备最新位置") | ||
| 90 | + @ApiImplicitParams({ | ||
| 91 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 92 | + }) | ||
| 93 | + @GetMapping("/latest/{deviceId}") | ||
| 64 | public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) { | 94 | public ResponseEntity<MobilePosition> latestPosition(@PathVariable String deviceId) { |
| 65 | if (logger.isDebugEnabled()) { | 95 | if (logger.isDebugEnabled()) { |
| 66 | logger.debug("查询设备" + deviceId + "的最新位置"); | 96 | logger.debug("查询设备" + deviceId + "的最新位置"); |
| @@ -69,7 +99,16 @@ public class MobilePositionController { | @@ -69,7 +99,16 @@ public class MobilePositionController { | ||
| 69 | return new ResponseEntity<>(result, HttpStatus.OK); | 99 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 70 | } | 100 | } |
| 71 | 101 | ||
| 72 | - @GetMapping("/positions/{deviceId}/realtime") | 102 | + /** |
| 103 | + * 获取移动位置信息 | ||
| 104 | + * @param deviceId 设备ID | ||
| 105 | + * @return | ||
| 106 | + */ | ||
| 107 | + @ApiOperation("获取移动位置信息") | ||
| 108 | + @ApiImplicitParams({ | ||
| 109 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 110 | + }) | ||
| 111 | + @GetMapping("/realtime/{deviceId}") | ||
| 73 | public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) { | 112 | public DeferredResult<ResponseEntity<MobilePosition>> realTimePosition(@PathVariable String deviceId) { |
| 74 | Device device = storager.queryVideoDevice(deviceId); | 113 | Device device = storager.queryVideoDevice(deviceId); |
| 75 | cmder.mobilePostitionQuery(device, event -> { | 114 | cmder.mobilePostitionQuery(device, event -> { |
| @@ -92,7 +131,20 @@ public class MobilePositionController { | @@ -92,7 +131,20 @@ public class MobilePositionController { | ||
| 92 | return result; | 131 | return result; |
| 93 | } | 132 | } |
| 94 | 133 | ||
| 95 | - @GetMapping("/positions/{deviceId}/subscribe") | 134 | + /** |
| 135 | + * 订阅位置信息 | ||
| 136 | + * @param deviceId 设备ID | ||
| 137 | + * @param expires 订阅超时时间 | ||
| 138 | + * @param interval 上报时间间隔 | ||
| 139 | + * @return true = 命令发送成功 | ||
| 140 | + */ | ||
| 141 | + @ApiOperation("订阅位置信息") | ||
| 142 | + @ApiImplicitParams({ | ||
| 143 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true), | ||
| 144 | + @ApiImplicitParam(name = "expires", value = "订阅超时时间"), | ||
| 145 | + @ApiImplicitParam(name = "interval", value = "上报时间间隔"), | ||
| 146 | + }) | ||
| 147 | + @GetMapping("/subscribe/{deviceId}") | ||
| 96 | public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId, | 148 | public ResponseEntity<String> positionSubscribe(@PathVariable String deviceId, |
| 97 | @RequestParam String expires, | 149 | @RequestParam String expires, |
| 98 | @RequestParam String interval) { | 150 | @RequestParam String interval) { |
src/main/java/com/genersoft/iot/vmp/vmanager/gbStream/GbStreamController.java
| @@ -75,15 +75,12 @@ public class GbStreamController { | @@ -75,15 +75,12 @@ public class GbStreamController { | ||
| 75 | * @return | 75 | * @return |
| 76 | */ | 76 | */ |
| 77 | @ApiOperation("保存国标关联") | 77 | @ApiOperation("保存国标关联") |
| 78 | -// @ApiImplicitParams({ | ||
| 79 | -// @ApiImplicitParam(name = "app", value = "视频流应用名", required = true ), | ||
| 80 | -// @ApiImplicitParam(name = "gbId", value = "国标ID", required = true ), | ||
| 81 | -// }) | 78 | + @ApiImplicitParams({ |
| 79 | + @ApiImplicitParam(name = "gbStreamParam", value = "GbStreamParam", required = true ), | ||
| 80 | + }) | ||
| 82 | @PostMapping(value = "/add") | 81 | @PostMapping(value = "/add") |
| 83 | @ResponseBody | 82 | @ResponseBody |
| 84 | public Object add(@RequestBody GbStreamParam gbStreamParam){ | 83 | public Object add(@RequestBody GbStreamParam gbStreamParam){ |
| 85 | - System.out.println(3333); | ||
| 86 | - System.out.println(gbStreamParam.getGbStreams().size()); | ||
| 87 | if (gbStreamService.addPlatformInfo(gbStreamParam.getGbStreams(), gbStreamParam.getPlatformId())) { | 84 | if (gbStreamService.addPlatformInfo(gbStreamParam.getGbStreams(), gbStreamParam.getPlatformId())) { |
| 88 | return "success"; | 85 | return "success"; |
| 89 | }else { | 86 | }else { |
src/main/java/com/genersoft/iot/vmp/vmanager/media/MediaController.java
| @@ -9,6 +9,10 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | @@ -9,6 +9,10 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | ||
| 9 | import com.genersoft.iot.vmp.service.IMediaService; | 9 | import com.genersoft.iot.vmp.service.IMediaService; |
| 10 | import com.genersoft.iot.vmp.service.IStreamProxyService; | 10 | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| 11 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 11 | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| 12 | +import io.swagger.annotations.Api; | ||
| 13 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 14 | +import io.swagger.annotations.ApiImplicitParams; | ||
| 15 | +import io.swagger.annotations.ApiOperation; | ||
| 12 | import org.slf4j.Logger; | 16 | import org.slf4j.Logger; |
| 13 | import org.slf4j.LoggerFactory; | 17 | import org.slf4j.LoggerFactory; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -16,6 +20,7 @@ import org.springframework.stereotype.Controller; | @@ -16,6 +20,7 @@ import org.springframework.stereotype.Controller; | ||
| 16 | import org.springframework.web.bind.annotation.*; | 20 | import org.springframework.web.bind.annotation.*; |
| 17 | 21 | ||
| 18 | 22 | ||
| 23 | +@Api(tags = "媒体流相关") | ||
| 19 | @Controller | 24 | @Controller |
| 20 | @CrossOrigin | 25 | @CrossOrigin |
| 21 | @RequestMapping(value = "/api/media") | 26 | @RequestMapping(value = "/api/media") |
| @@ -33,8 +38,17 @@ public class MediaController { | @@ -33,8 +38,17 @@ public class MediaController { | ||
| 33 | private IMediaService mediaService; | 38 | private IMediaService mediaService; |
| 34 | 39 | ||
| 35 | 40 | ||
| 36 | - | ||
| 37 | - | 41 | + /** |
| 42 | + * 根据应用名和流id获取播放地址 | ||
| 43 | + * @param app 应用名 | ||
| 44 | + * @param stream 流id | ||
| 45 | + * @return | ||
| 46 | + */ | ||
| 47 | + @ApiOperation("根据应用名和流id获取播放地址") | ||
| 48 | + @ApiImplicitParams({ | ||
| 49 | + @ApiImplicitParam(name = "app", value = "应用名"), | ||
| 50 | + @ApiImplicitParam(name = "stream", value = "流id"), | ||
| 51 | + }) | ||
| 38 | @RequestMapping(value = "/getStreamInfoByAppAndStream") | 52 | @RequestMapping(value = "/getStreamInfoByAppAndStream") |
| 39 | @ResponseBody | 53 | @ResponseBody |
| 40 | public StreamInfo getStreamInfoByAppAndStream(String app, String stream){ | 54 | public StreamInfo getStreamInfoByAppAndStream(String app, String stream){ |
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
| @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | ||
| 8 | import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; | 8 | import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; |
| 9 | import com.genersoft.iot.vmp.vmanager.platform.bean.UpdateChannelParam; | 9 | import com.genersoft.iot.vmp.vmanager.platform.bean.UpdateChannelParam; |
| 10 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| 11 | +import io.swagger.annotations.Api; | ||
| 11 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
| 12 | import org.slf4j.LoggerFactory; | 13 | import org.slf4j.LoggerFactory; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -17,9 +18,13 @@ import org.springframework.util.StringUtils; | @@ -17,9 +18,13 @@ import org.springframework.util.StringUtils; | ||
| 17 | import org.springframework.web.bind.annotation.*; | 18 | import org.springframework.web.bind.annotation.*; |
| 18 | import com.genersoft.iot.vmp.conf.SipConfig; | 19 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 19 | 20 | ||
| 21 | +/** | ||
| 22 | + * 级联平台管理 | ||
| 23 | + */ | ||
| 24 | +@Api("级联平台管理") | ||
| 20 | @CrossOrigin | 25 | @CrossOrigin |
| 21 | @RestController | 26 | @RestController |
| 22 | -@RequestMapping("/api") | 27 | +@RequestMapping("/api/platform") |
| 23 | public class PlatformController { | 28 | public class PlatformController { |
| 24 | 29 | ||
| 25 | private final static Logger logger = LoggerFactory.getLogger(PlatformController.class); | 30 | private final static Logger logger = LoggerFactory.getLogger(PlatformController.class); |
| @@ -36,7 +41,7 @@ public class PlatformController { | @@ -36,7 +41,7 @@ public class PlatformController { | ||
| 36 | @Autowired | 41 | @Autowired |
| 37 | private SipConfig sipConfig; | 42 | private SipConfig sipConfig; |
| 38 | 43 | ||
| 39 | - @GetMapping("/platforms/serverconfig") | 44 | + @GetMapping("/server_config") |
| 40 | public ResponseEntity<JSONObject> serverConfig() { | 45 | public ResponseEntity<JSONObject> serverConfig() { |
| 41 | JSONObject result = new JSONObject(); | 46 | JSONObject result = new JSONObject(); |
| 42 | result.put("deviceIp", sipConfig.getSipIp()); | 47 | result.put("deviceIp", sipConfig.getSipIp()); |
| @@ -46,7 +51,7 @@ public class PlatformController { | @@ -46,7 +51,7 @@ public class PlatformController { | ||
| 46 | return new ResponseEntity<>(result, HttpStatus.OK); | 51 | return new ResponseEntity<>(result, HttpStatus.OK); |
| 47 | } | 52 | } |
| 48 | 53 | ||
| 49 | - @GetMapping("/platforms/{count}/{page}") | 54 | + @GetMapping("/query/{count}/{page}") |
| 50 | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ | 55 | public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ |
| 51 | 56 | ||
| 52 | if (logger.isDebugEnabled()) { | 57 | if (logger.isDebugEnabled()) { |
| @@ -55,7 +60,7 @@ public class PlatformController { | @@ -55,7 +60,7 @@ public class PlatformController { | ||
| 55 | return storager.queryParentPlatformList(page, count); | 60 | return storager.queryParentPlatformList(page, count); |
| 56 | } | 61 | } |
| 57 | 62 | ||
| 58 | - @RequestMapping("/platforms/save") | 63 | + @PostMapping("/save") |
| 59 | @ResponseBody | 64 | @ResponseBody |
| 60 | public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){ | 65 | public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){ |
| 61 | 66 | ||
| @@ -98,18 +103,19 @@ public class PlatformController { | @@ -98,18 +103,19 @@ public class PlatformController { | ||
| 98 | } | 103 | } |
| 99 | } | 104 | } |
| 100 | 105 | ||
| 101 | - @RequestMapping("/platforms/delete") | 106 | + @DeleteMapping("/delete/{serverGBId}") |
| 102 | @ResponseBody | 107 | @ResponseBody |
| 103 | - public ResponseEntity<String> deletePlatform(@RequestBody ParentPlatform parentPlatform){ | 108 | + public ResponseEntity<String> deletePlatform(@PathVariable String serverGBId){ |
| 104 | 109 | ||
| 105 | if (logger.isDebugEnabled()) { | 110 | if (logger.isDebugEnabled()) { |
| 106 | logger.debug("删除上级平台API调用"); | 111 | logger.debug("删除上级平台API调用"); |
| 107 | } | 112 | } |
| 108 | - if (StringUtils.isEmpty(parentPlatform.getServerGBId()) | 113 | + if (StringUtils.isEmpty(serverGBId) |
| 109 | ){ | 114 | ){ |
| 110 | return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST); | 115 | return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST); |
| 111 | } | 116 | } |
| 112 | - | 117 | + ParentPlatform parentPlatform = storager.queryParentPlatById(serverGBId); |
| 118 | + if (parentPlatform == null) return new ResponseEntity<>("fail", HttpStatus.OK); | ||
| 113 | // 发送离线消息,无论是否成功都删除缓存 | 119 | // 发送离线消息,无论是否成功都删除缓存 |
| 114 | commanderForPlatform.unregister(parentPlatform, (event -> { | 120 | commanderForPlatform.unregister(parentPlatform, (event -> { |
| 115 | // 清空redis缓存 | 121 | // 清空redis缓存 |
| @@ -133,7 +139,7 @@ public class PlatformController { | @@ -133,7 +139,7 @@ public class PlatformController { | ||
| 133 | } | 139 | } |
| 134 | } | 140 | } |
| 135 | 141 | ||
| 136 | - @RequestMapping("/platforms/exit/{deviceGbId}") | 142 | + @GetMapping("/exit/{deviceGbId}") |
| 137 | @ResponseBody | 143 | @ResponseBody |
| 138 | public ResponseEntity<String> exitPlatform(@PathVariable String deviceGbId){ | 144 | public ResponseEntity<String> exitPlatform(@PathVariable String deviceGbId){ |
| 139 | 145 | ||
| @@ -144,7 +150,7 @@ public class PlatformController { | @@ -144,7 +150,7 @@ public class PlatformController { | ||
| 144 | return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK); | 150 | return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK); |
| 145 | } | 151 | } |
| 146 | 152 | ||
| 147 | - @RequestMapping("/platforms/channelList") | 153 | + @GetMapping("/channel_list") |
| 148 | @ResponseBody | 154 | @ResponseBody |
| 149 | public PageInfo<ChannelReduce> channelList(int page, int count, | 155 | public PageInfo<ChannelReduce> channelList(int page, int count, |
| 150 | @RequestParam(required = false) String platformId, | 156 | @RequestParam(required = false) String platformId, |
| @@ -167,7 +173,7 @@ public class PlatformController { | @@ -167,7 +173,7 @@ public class PlatformController { | ||
| 167 | } | 173 | } |
| 168 | 174 | ||
| 169 | 175 | ||
| 170 | - @RequestMapping("/platforms/updateChannelForGB") | 176 | + @PostMapping("/update_channel_for_gb") |
| 171 | @ResponseBody | 177 | @ResponseBody |
| 172 | public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ | 178 | public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ |
| 173 | 179 | ||
| @@ -179,7 +185,7 @@ public class PlatformController { | @@ -179,7 +185,7 @@ public class PlatformController { | ||
| 179 | return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK); | 185 | return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK); |
| 180 | } | 186 | } |
| 181 | 187 | ||
| 182 | - @RequestMapping("/platforms/delChannelForGB") | 188 | + @DeleteMapping("/del_channel_for_gb") |
| 183 | @ResponseBody | 189 | @ResponseBody |
| 184 | public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){ | 190 | public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){ |
| 185 | 191 |
web_src/src/components/ParentPlatformList.vue
| @@ -121,7 +121,7 @@ export default { | @@ -121,7 +121,7 @@ export default { | ||
| 121 | }, | 121 | }, |
| 122 | deletePlatformCommit: function(platform) { | 122 | deletePlatformCommit: function(platform) { |
| 123 | var that = this; | 123 | var that = this; |
| 124 | - that.$axios.post(`/api/platforms/delete`, platform) | 124 | + that.$axios.delete(`/api/platform/delete/${platform.serverGBId}`) |
| 125 | .then(function (res) { | 125 | .then(function (res) { |
| 126 | if (res.data == "success") { | 126 | if (res.data == "success") { |
| 127 | that.$message({ | 127 | that.$message({ |
| @@ -155,7 +155,7 @@ export default { | @@ -155,7 +155,7 @@ export default { | ||
| 155 | getPlatformList: function() { | 155 | getPlatformList: function() { |
| 156 | let that = this; | 156 | let that = this; |
| 157 | 157 | ||
| 158 | - this.$axios.get(`/api/platforms/${that.count}/${that.currentPage}`) | 158 | + this.$axios.get(`/api/platform/query/${that.count}/${that.currentPage}`) |
| 159 | .then(function (res) { | 159 | .then(function (res) { |
| 160 | that.total = res.data.total; | 160 | that.total = res.data.total; |
| 161 | that.platformList = res.data.list; | 161 | that.platformList = res.data.list; |
web_src/src/components/devicePosition.vue
| @@ -171,7 +171,7 @@ export default { | @@ -171,7 +171,7 @@ export default { | ||
| 171 | this.endTime = null; | 171 | this.endTime = null; |
| 172 | } | 172 | } |
| 173 | let self = this; | 173 | let self = this; |
| 174 | - this.$axios.get(`/api/positions/${this.deviceId}/history`, { | 174 | + this.$axios.get(`/api/position/history/${this.deviceId}`, { |
| 175 | params: { | 175 | params: { |
| 176 | start: self.startTime, | 176 | start: self.startTime, |
| 177 | end: self.endTime, | 177 | end: self.endTime, |
| @@ -202,7 +202,7 @@ export default { | @@ -202,7 +202,7 @@ export default { | ||
| 202 | this.mapPointList = []; | 202 | this.mapPointList = []; |
| 203 | this.mobilePositionList = []; | 203 | this.mobilePositionList = []; |
| 204 | let self = this; | 204 | let self = this; |
| 205 | - this.$axios.get(`/api/positions/${this.deviceId}/latest`) | 205 | + this.$axios.get(`/api/position/latest/${this.deviceId}`) |
| 206 | .then(function (res) { | 206 | .then(function (res) { |
| 207 | console.log(res.data); | 207 | console.log(res.data); |
| 208 | self.total = res.data.length; | 208 | self.total = res.data.length; |
| @@ -226,7 +226,7 @@ export default { | @@ -226,7 +226,7 @@ export default { | ||
| 226 | }, | 226 | }, |
| 227 | subscribeMobilePosition: function() { | 227 | subscribeMobilePosition: function() { |
| 228 | let self = this; | 228 | let self = this; |
| 229 | - this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, { | 229 | + this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { |
| 230 | params: { | 230 | params: { |
| 231 | expires: self.expired, | 231 | expires: self.expired, |
| 232 | interval: self.interval, | 232 | interval: self.interval, |
| @@ -241,7 +241,7 @@ export default { | @@ -241,7 +241,7 @@ export default { | ||
| 241 | }, | 241 | }, |
| 242 | unSubscribeMobilePosition: function() { | 242 | unSubscribeMobilePosition: function() { |
| 243 | let self = this; | 243 | let self = this; |
| 244 | - this.$axios.get(`/api/positions/${this.deviceId}/subscribe`, { | 244 | + this.$axios.get(`/api/position/subscribe/${this.deviceId}`, { |
| 245 | params: { | 245 | params: { |
| 246 | expires: 0, | 246 | expires: 0, |
| 247 | interval: self.interval, | 247 | interval: self.interval, |
web_src/src/components/dialog/StreamProxyEdit.vue
| @@ -176,7 +176,7 @@ export default { | @@ -176,7 +176,7 @@ export default { | ||
| 176 | var result = false; | 176 | var result = false; |
| 177 | var that = this; | 177 | var that = this; |
| 178 | await that.$axios | 178 | await that.$axios |
| 179 | - .post(`/api/platforms/exit/${deviceGbId}`) | 179 | + .post(`/api/platform/exit/${deviceGbId}`) |
| 180 | .then(function (res) { | 180 | .then(function (res) { |
| 181 | result = res.data; | 181 | result = res.data; |
| 182 | }) | 182 | }) |
web_src/src/components/dialog/addStreamTOGB.vue
| @@ -119,7 +119,7 @@ export default { | @@ -119,7 +119,7 @@ export default { | ||
| 119 | var result = false; | 119 | var result = false; |
| 120 | var that = this; | 120 | var that = this; |
| 121 | await that.$axios | 121 | await that.$axios |
| 122 | - .post(`/api/platforms/exit/${deviceGbId}`) | 122 | + .post(`/api/platform/exit/${deviceGbId}`) |
| 123 | .then(function (res) { | 123 | .then(function (res) { |
| 124 | result = res.data; | 124 | result = res.data; |
| 125 | }) | 125 | }) |
web_src/src/components/dialog/chooseChannel.vue
| @@ -72,7 +72,7 @@ export default { | @@ -72,7 +72,7 @@ export default { | ||
| 72 | 72 | ||
| 73 | this.$axios({ | 73 | this.$axios({ |
| 74 | method:"post", | 74 | method:"post", |
| 75 | - url:"/api/platforms/updateChannelForGB", | 75 | + url:"/api/platform/update_channel_for_gb", |
| 76 | data:{ | 76 | data:{ |
| 77 | platformId: that.platformId, | 77 | platformId: that.platformId, |
| 78 | channelReduces: that.chooseData | 78 | channelReduces: that.chooseData |
web_src/src/components/dialog/chooseChannelForGb.vue
| @@ -149,7 +149,7 @@ export default { | @@ -149,7 +149,7 @@ export default { | ||
| 149 | if (Object.keys(addData).length >0) { | 149 | if (Object.keys(addData).length >0) { |
| 150 | that.$axios({ | 150 | that.$axios({ |
| 151 | method:"post", | 151 | method:"post", |
| 152 | - url:"/api/platforms/updateChannelForGB", | 152 | + url:"/api/platform/update_channel_for_gb", |
| 153 | data:{ | 153 | data:{ |
| 154 | platformId: that.platformId, | 154 | platformId: that.platformId, |
| 155 | channelReduces: addData | 155 | channelReduces: addData |
| @@ -162,8 +162,8 @@ export default { | @@ -162,8 +162,8 @@ export default { | ||
| 162 | } | 162 | } |
| 163 | if (Object.keys(delData).length >0) { | 163 | if (Object.keys(delData).length >0) { |
| 164 | that.$axios({ | 164 | that.$axios({ |
| 165 | - method:"post", | ||
| 166 | - url:"/api/platforms/delChannelForGB", | 165 | + method:"delete", |
| 166 | + url:"/api/platform/del_channel_for_gb", | ||
| 167 | data:{ | 167 | data:{ |
| 168 | platformId: that.platformId, | 168 | platformId: that.platformId, |
| 169 | channelReduces: delData | 169 | channelReduces: delData |
| @@ -182,7 +182,7 @@ export default { | @@ -182,7 +182,7 @@ export default { | ||
| 182 | getChannelList: function () { | 182 | getChannelList: function () { |
| 183 | let that = this; | 183 | let that = this; |
| 184 | 184 | ||
| 185 | - this.$axios.get(`/api/platforms/channelList`, { | 185 | + this.$axios.get(`/api/platform/channel_list`, { |
| 186 | params: { | 186 | params: { |
| 187 | page: that.currentPage, | 187 | page: that.currentPage, |
| 188 | count: that.count, | 188 | count: that.count, |
web_src/src/components/dialog/chooseChannelForStream.vue
| @@ -142,7 +142,7 @@ export default { | @@ -142,7 +142,7 @@ export default { | ||
| 142 | if (Object.keys(delData).length >0) { | 142 | if (Object.keys(delData).length >0) { |
| 143 | console.log(delData) | 143 | console.log(delData) |
| 144 | that.$axios({ | 144 | that.$axios({ |
| 145 | - method:"post", | 145 | + method:"delete", |
| 146 | url:"/api/gbStream/del", | 146 | url:"/api/gbStream/del", |
| 147 | data:{ | 147 | data:{ |
| 148 | gbStreams: delData, | 148 | gbStreams: delData, |
| @@ -152,6 +152,7 @@ export default { | @@ -152,6 +152,7 @@ export default { | ||
| 152 | }).catch(function (error) { | 152 | }).catch(function (error) { |
| 153 | console.log(error); | 153 | console.log(error); |
| 154 | }); | 154 | }); |
| 155 | + | ||
| 155 | } | 156 | } |
| 156 | 157 | ||
| 157 | }, | 158 | }, |
web_src/src/components/dialog/platformEdit.vue
| @@ -164,7 +164,7 @@ export default { | @@ -164,7 +164,7 @@ export default { | ||
| 164 | openDialog: function (platform, callback) { | 164 | openDialog: function (platform, callback) { |
| 165 | var that = this; | 165 | var that = this; |
| 166 | this.$axios | 166 | this.$axios |
| 167 | - .get(`/api/platforms/serverconfig`) | 167 | + .get(`/api/platform/server_config`) |
| 168 | .then(function (res) { | 168 | .then(function (res) { |
| 169 | console.log(res); | 169 | console.log(res); |
| 170 | that.platform.deviceGBId = res.data.username; | 170 | that.platform.deviceGBId = res.data.username; |
| @@ -189,7 +189,7 @@ export default { | @@ -189,7 +189,7 @@ export default { | ||
| 189 | console.log("onSubmit"); | 189 | console.log("onSubmit"); |
| 190 | var that = this; | 190 | var that = this; |
| 191 | that.$axios | 191 | that.$axios |
| 192 | - .post(`/api/platforms/save`, that.platform) | 192 | + .post(`/api/platform/save`, that.platform) |
| 193 | .then(function (res) { | 193 | .then(function (res) { |
| 194 | console.log(res); | 194 | console.log(res); |
| 195 | console.log(res.data == "success"); | 195 | console.log(res.data == "success"); |
| @@ -219,7 +219,7 @@ export default { | @@ -219,7 +219,7 @@ export default { | ||
| 219 | var result = false; | 219 | var result = false; |
| 220 | var that = this; | 220 | var that = this; |
| 221 | await that.$axios | 221 | await that.$axios |
| 222 | - .post(`/api/platforms/exit/${deviceGbId}`) | 222 | + .post(`/api/platform/exit/${deviceGbId}`) |
| 223 | .then(function (res) { | 223 | .then(function (res) { |
| 224 | result = res.data; | 224 | result = res.data; |
| 225 | }) | 225 | }) |