Commit 8a82a71ded7459549e0c3448944fef97239e8fcb
1 parent
87ce22e0
增加本平台配置查询接口,方便上级级联参数填写
Showing
1 changed file
with
16 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
| 1 | 1 | package com.genersoft.iot.vmp.vmanager.platform; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson.JSONObject; | |
| 3 | 4 | import com.genersoft.iot.vmp.common.PageResult; |
| 4 | 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 5 | 6 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| ... | ... | @@ -15,6 +16,8 @@ import org.springframework.http.ResponseEntity; |
| 15 | 16 | import org.springframework.stereotype.Controller; |
| 16 | 17 | import org.springframework.util.StringUtils; |
| 17 | 18 | import org.springframework.web.bind.annotation.*; |
| 19 | +import com.genersoft.iot.vmp.conf.SipConfig; | |
| 20 | + | |
| 18 | 21 | |
| 19 | 22 | @CrossOrigin |
| 20 | 23 | @RestController |
| ... | ... | @@ -29,6 +32,19 @@ public class PlatformController { |
| 29 | 32 | @Autowired |
| 30 | 33 | private ISIPCommanderForPlatform commanderForPlatform; |
| 31 | 34 | |
| 35 | + @Autowired | |
| 36 | + private SipConfig sipConfig; | |
| 37 | + | |
| 38 | + @GetMapping("/platforms/serverconfig") | |
| 39 | + public ResponseEntity<JSONObject> serverConfig() { | |
| 40 | + JSONObject result = new JSONObject(); | |
| 41 | + result.put("deviceIp", sipConfig.getSipIp()); | |
| 42 | + result.put("devicePort", sipConfig.getSipPort()); | |
| 43 | + result.put("username", sipConfig.getSipId()); | |
| 44 | + result.put("password", sipConfig.getSipPassword()); | |
| 45 | + return new ResponseEntity<>(result, HttpStatus.OK); | |
| 46 | + } | |
| 47 | + | |
| 32 | 48 | @GetMapping("/platforms/{count}/{page}") |
| 33 | 49 | public PageResult<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ |
| 34 | 50 | ... | ... |