Commit 8a82a71ded7459549e0c3448944fef97239e8fcb

Authored by Lawrence
1 parent 87ce22e0

增加本平台配置查询接口,方便上级级联参数填写

src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
1 package com.genersoft.iot.vmp.vmanager.platform; 1 package com.genersoft.iot.vmp.vmanager.platform;
2 2
  3 +import com.alibaba.fastjson.JSONObject;
3 import com.genersoft.iot.vmp.common.PageResult; 4 import com.genersoft.iot.vmp.common.PageResult;
4 import com.genersoft.iot.vmp.gb28181.bean.Device; 5 import com.genersoft.iot.vmp.gb28181.bean.Device;
5 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; 6 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
@@ -15,6 +16,8 @@ import org.springframework.http.ResponseEntity; @@ -15,6 +16,8 @@ import org.springframework.http.ResponseEntity;
15 import org.springframework.stereotype.Controller; 16 import org.springframework.stereotype.Controller;
16 import org.springframework.util.StringUtils; 17 import org.springframework.util.StringUtils;
17 import org.springframework.web.bind.annotation.*; 18 import org.springframework.web.bind.annotation.*;
  19 +import com.genersoft.iot.vmp.conf.SipConfig;
  20 +
18 21
19 @CrossOrigin 22 @CrossOrigin
20 @RestController 23 @RestController
@@ -29,6 +32,19 @@ public class PlatformController { @@ -29,6 +32,19 @@ public class PlatformController {
29 @Autowired 32 @Autowired
30 private ISIPCommanderForPlatform commanderForPlatform; 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 @GetMapping("/platforms/{count}/{page}") 48 @GetMapping("/platforms/{count}/{page}")
33 public PageResult<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ 49 public PageResult<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){
34 50