|
|
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
+import java.nio.file.FileSystems;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Path;
|
|
|
import java.nio.file.Paths;
|
|
|
@@ -65,8 +66,8 @@ public class TscSsipAppController {
|
|
|
@GetMapping(value = {NAVI_NODE_STATUS}, produces = {"application/json; charset=utf8"})
|
|
|
public ResponseEntity<AbstractTscSsipApiResult> getNodeStatus(@PathVariable("deviceId") String deviceId, HttpServletRequest request) {
|
|
|
|
|
|
- String apiId = NAVI_NODE_STATUS;
|
|
|
- String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
+ final String apiId = NAVI_NODE_STATUS;
|
|
|
+ final String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
log.info("{}, {}, {}", apiId, remoteIP, deviceId);
|
|
|
|
|
|
ApiInvokeVo apiInvokeVo = ApiInvokeVo.builder()
|
|
|
@@ -108,8 +109,8 @@ public class TscSsipAppController {
|
|
|
@GetMapping(value = {NAVI_DEVICE_AUTH}, produces = {"application/json; charset=utf8"})
|
|
|
public ResponseEntity<AbstractTscSsipApiResult> getDeviceAuthInfo(@PathVariable("deviceId") String deviceId, HttpServletRequest request) {
|
|
|
|
|
|
- String apiId = NAVI_DEVICE_AUTH;
|
|
|
- String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
+ final String apiId = NAVI_DEVICE_AUTH;
|
|
|
+ final String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
log.info("{}, {}, {}", apiId, remoteIP, deviceId);
|
|
|
|
|
|
ApiInvokeVo apiInvokeVo = ApiInvokeVo.builder()
|
|
|
@@ -148,14 +149,14 @@ public class TscSsipAppController {
|
|
|
|
|
|
// 이력저장
|
|
|
this.tscNaviApiService.insertInvokeHs(apiInvokeVo);
|
|
|
- log.info("Auth: {}, {}", deviceId, result.toString());
|
|
|
+ log.info("Auth: {}, {}", deviceId, result);
|
|
|
return new ResponseEntity<>(result, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = {NAVI_DEVICE_REGISTER}, produces = {"application/json; charset=utf8"})
|
|
|
public ResponseEntity<AbstractTscSsipApiResult> registerDevice(@RequestBody DeviceInfo deviceInfo, HttpServletRequest request){
|
|
|
- String apiId = NAVI_DEVICE_REGISTER;
|
|
|
- String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
+ final String apiId = NAVI_DEVICE_REGISTER;
|
|
|
+ final String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
log.info("{}, {}, {}", apiId, remoteIP, deviceInfo.toString());
|
|
|
|
|
|
try {
|
|
|
@@ -173,12 +174,13 @@ public class TscSsipAppController {
|
|
|
|
|
|
@GetMapping(value = {NAVI_DOWNLOADS})
|
|
|
public ResponseEntity<Resource> download(@PathVariable("fileName") String fileName, HttpServletRequest request) {
|
|
|
- String apiId = NAVI_DOWNLOADS;
|
|
|
- String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
+ final String apiId = NAVI_DOWNLOADS;
|
|
|
+ final String remoteIP = ApiUtils.getRemoteIP(request);
|
|
|
log.info("{}, {}, {}", apiId, remoteIP, fileName);
|
|
|
|
|
|
try {
|
|
|
- String separator = System.getProperty("file.separator");
|
|
|
+// String separator = System.getProperty("file.separator");
|
|
|
+ String separator = FileSystems.getDefault().getSeparator();
|
|
|
String fileFullName = System.getProperty("user.dir")+separator+"download"+separator+fileName;
|
|
|
Path path = Paths.get(fileFullName);
|
|
|
File file2Upload = path.toFile();
|