[MODIFY] EdgeSWUploadService에 sw_type 분기 switch문으로 변경 및 json 로그 추가

main
bjkim 7 months ago
parent f852365805
commit 4accb71545

@ -106,13 +106,13 @@ public class EdgeSWUploadService {
jsonBody.put("creation_datetime", edgeSWVO.getCreation_datetime()); jsonBody.put("creation_datetime", edgeSWVO.getCreation_datetime());
jsonBody.put("download_location", edgeSWVO.getDownload_location()); jsonBody.put("download_location", edgeSWVO.getDownload_location());
if (sw_type == 0){ switch (sw_type) {
jsonBody.put("ed_pkg_serial", edgeSWVO.getPkg_serial()); case 0 -> jsonBody.put("ad_pkg_serial", edgeSWVO.getPkg_serial());
} case 1 -> jsonBody.put("ed_pkg_serial", edgeSWVO.getPkg_serial());
else if (sw_type == 1) { default -> throw new IllegalArgumentException("Invalid sw_type: " + sw_type);
jsonBody.put("ad_pkg_serial", edgeSWVO.getPkg_serial());
} }
jsonBody.put("sw_id", edgeSWVO.getSw_id()); jsonBody.put("sw_id", edgeSWVO.getSw_id());
jsonBody.put("sw_version", edgeSWVO.getSw_version()); jsonBody.put("sw_version", edgeSWVO.getSw_version());
jsonBody.put("sw_name", edgeSWVO.getSw_name()); jsonBody.put("sw_name", edgeSWVO.getSw_name());
@ -128,6 +128,7 @@ public class EdgeSWUploadService {
jsonBody.put("file_type", edgeSWVO.getFile_type()); jsonBody.put("file_type", edgeSWVO.getFile_type());
jsonBody.put("file_size", edgeSWVO.getFile_size()); jsonBody.put("file_size", edgeSWVO.getFile_size());
log.info(jsonBody.toString());
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON); headers.setContentType(MediaType.APPLICATION_JSON);

Loading…
Cancel
Save