|
@@ -1,8 +1,8 @@
|
|
|
package com.sig.comm.server.controller;
|
|
|
|
|
|
-import com.sig.comm.server.dto.NET;
|
|
|
import com.sig.comm.server.dto.RegionCenter;
|
|
|
import com.sig.comm.server.repository.ApplicationRepository;
|
|
|
+import com.sig.common.dto.NET;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -21,23 +21,23 @@ public class SigCommServerController {
|
|
|
|
|
|
@GetMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
|
public String info() {
|
|
|
- String sep = System.getProperty("line.separator");
|
|
|
+ String sep = System.lineSeparator();
|
|
|
String heading = "---------------------------------------------------------------------------------------------------------";
|
|
|
|
|
|
RegionCenter center = ApplicationRepository.center;
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- sb.append(heading + sep);
|
|
|
- sb.append("UTIC Local Signal Communication Server" + sep);
|
|
|
- sb.append(heading + sep);
|
|
|
+ sb.append(heading).append(sep);
|
|
|
+ sb.append("UTIC Local Signal Communication Server").append(sep);
|
|
|
+ sb.append(heading).append(sep);
|
|
|
sb.append(String.format("%s, %s",
|
|
|
- center.getRegionCd(), center.getIpAddress() + sep));
|
|
|
- sb.append(heading + sep);
|
|
|
+ center.getRegionCd(), center.getIpAddress())).append(sep);
|
|
|
+ sb.append(heading).append(sep);
|
|
|
sb.append(String.format("%s %-15.15s %-8.8s %-20.20s %-20.20s %-20.20s %s",
|
|
|
"---", "IP Address", "Network",
|
|
|
"Connect Time", "Disconnect Time",
|
|
|
- "Last Comm Time", "Center Name") + sep);
|
|
|
- sb.append(heading + sep);
|
|
|
+ "Last Comm Time", "Center Name")).append(sep);
|
|
|
+ sb.append(heading).append(sep);
|
|
|
int total = 0;
|
|
|
int onLine = 0;
|
|
|
List<String> keySet = new ArrayList<>(this.repo.getCenterMap().keySet());
|
|
@@ -57,12 +57,12 @@ public class SigCommServerController {
|
|
|
region.getRegionCd(), region.getIpAddress(), commStatus,
|
|
|
region.getNetState().getConnectTimeString(), region.getNetState().getDisconnectTimeString(),
|
|
|
region.getNetState().getLastCommTimeString(),
|
|
|
- region.getRegionNm()) + sep);
|
|
|
+ region.getRegionNm())).append(sep);
|
|
|
|
|
|
}
|
|
|
- sb.append(heading + sep);
|
|
|
- sb.append(String.format("Total : %d, OnLine(Connect): %d", total, onLine) + sep);
|
|
|
- sb.append(heading + sep);
|
|
|
+ sb.append(heading).append(sep);
|
|
|
+ sb.append(String.format("Total : %d, OnLine(Connect): %d", total, onLine)).append(sep);
|
|
|
+ sb.append(heading).append(sep);
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|