fix: 카카오 sendBulks, statusBulks 반영

dev
gitea-관리자 1 year ago
parent 443ad51680
commit e29ba6a657

@ -76,11 +76,11 @@ public class CmmEnsFileService extends EgovAbstractServiceImpl implements ICmmEn
@Override @Override
public String fmcExcelUpload(FmcExcelUpload fileReq) { public String fmcExcelUpload(FmcExcelUpload fileReq) {
final Set<ConstraintViolation<FmcExcelUpload>> errors = validator.validate(fileReq); final Set<ConstraintViolation<FmcExcelUpload>> errors = validator.validate(fileReq);
if (errors.size() > 0) { if (!errors.isEmpty()) {
throw BizRuntimeException.create(errors.stream() throw BizRuntimeException.create(errors.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate())) .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
.collect(Collectors.toList()).toString()); .toList().toString());
} }

@ -254,7 +254,7 @@ public class AsyncKkopayEltrcDocService extends EgovAbstractServiceImpl implemen
errors.add(String.format("문서 식별 번호는 40자를 넘을 수 없습니다[%d번째]", idx+1)); errors.add(String.format("문서 식별 번호는 40자를 넘을 수 없습니다[%d번째]", idx+1));
} }
} }
if(errors.size() > 0) { if(!errors.isEmpty()) {
throw BizRuntimeException.create(errors.toString()); throw BizRuntimeException.create(errors.toString());
} }
@ -272,14 +272,14 @@ public class AsyncKkopayEltrcDocService extends EgovAbstractServiceImpl implemen
private static <T> List<String> validate(T t, List<String> errList) { private static <T> List<String> validate(T t, List<String> errList) {
final Set<ConstraintViolation<T>> list = validator.validate(t); final Set<ConstraintViolation<T>> list = validator.validate(t);
if (list.size() > 0) { if (!list.isEmpty()) {
List<String> errors = list.stream() List<String> errors = list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate())) .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
.collect(Collectors.toList()); .toList();
// 추가적인 유효성 검증이 필요 없는 경우 // 추가적인 유효성 검증이 필요 없는 경우
if(errList == null){ if(errList == null){
if(errors.size() > 0) throw BizRuntimeException.create(errors.toString()); if(!errors.isEmpty()) throw BizRuntimeException.create(errors.toString());
return null; return null;
} }
errList.addAll(errors); errList.addAll(errors);

@ -4,11 +4,9 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validation; import javax.validation.Validation;
import javax.validation.Validator; import javax.validation.Validator;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid; import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
@ -109,7 +107,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
if(Checks.isEmpty(receiver.getPhone_number())) Objects.requireNonNull(errors).add("receiver.phone_number=받는이 전화번호는 필수입니다."); if(Checks.isEmpty(receiver.getPhone_number())) Objects.requireNonNull(errors).add("receiver.phone_number=받는이 전화번호는 필수입니다.");
if(Checks.isEmpty(receiver.getBirthday())) Objects.requireNonNull(errors).add("receiver.birthday=받는이 생년월일은 필수입니다."); if(Checks.isEmpty(receiver.getBirthday())) Objects.requireNonNull(errors).add("receiver.birthday=받는이 생년월일은 필수입니다.");
} }
if(Objects.requireNonNull(errors).size() > 0) throw BizRuntimeException.create(errors.toString()); if(!Objects.requireNonNull(errors).isEmpty()) throw BizRuntimeException.create(errors.toString());
return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
} }
@ -189,12 +187,12 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
List<BulkSendReq> dtos = reqDTO.getDocuments(); List<BulkSendReq> dtos = reqDTO.getDocuments();
for(int idx = 0; idx < dtos.size(); idx++) { for(int idx = 0; idx < dtos.size(); idx++) {
final Set<ConstraintViolation<BulkSendReq>> list = validator.validate(dtos.get(idx)); final Set<ConstraintViolation<BulkSendReq>> list = validator.validate(dtos.get(idx));
if (list.size() > 0) { if (!list.isEmpty()) {
int finalIdx = idx; int finalIdx = idx;
errors.addAll(list.stream() errors.addAll(list.stream()
.map(row -> String.format("%s[%d]=%s", row.getPropertyPath(), finalIdx +1, row.getMessageTemplate())) .map(row -> String.format("%s[%d]=%s", row.getPropertyPath(), finalIdx +1, row.getMessageTemplate()))
.collect(Collectors.toList()) .toList()
); );
} }
} }
@ -223,7 +221,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
} }
} }
} }
if(errors.size() > 0){ if(!errors.isEmpty()){
throw BizRuntimeException.create(errors.toString()); throw BizRuntimeException.create(errors.toString());
} }
@ -254,7 +252,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
errors.add(String.format("문서 식별 번호는 40자를 넘을 수 없습니다[%d번째]", idx+1)); errors.add(String.format("문서 식별 번호는 40자를 넘을 수 없습니다[%d번째]", idx+1));
} }
} }
if(errors.size() > 0) { if(!errors.isEmpty()) {
throw BizRuntimeException.create(errors.toString()); throw BizRuntimeException.create(errors.toString());
} }
return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
@ -293,14 +291,14 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
private static <T> List<String> validate(T t, List<String> errList) { private static <T> List<String> validate(T t, List<String> errList) {
final Set<ConstraintViolation<T>> list = validator.validate(t); final Set<ConstraintViolation<T>> list = validator.validate(t);
if(list.size() > 0) { if(!list.isEmpty()) {
final List<String> errors = list.stream() final List<String> errors = list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate())) .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
.collect(Collectors.toList()); .toList();
// 추가적인 유효성 검증이 필요 없는 경우 // 추가적인 유효성 검증이 필요 없는 경우
if(errList == null){ if(errList == null){
if(errors.size() > 0) throw BizRuntimeException.create(errors.toString()); if(!errors.isEmpty()) throw BizRuntimeException.create(errors.toString());
return null; return null;
} }
errList.addAll(errors); errList.addAll(errors);

@ -150,9 +150,18 @@ public class KkopayEltrcDocController {
* -. . * -. .
* </pre> * </pre>
* @param reqDTO KkopayDocBulkDTO.BulkSendRequests * @param reqDTO KkopayDocBulkDTO.BulkSendRequests
* @return ApiResponseDTO<BulkStatusResponses.BulkSendResponses> * @return BulkStatusResponses.BulkSendResponses
*/ */
@Operation(summary = "대량 문서발송 요청", description = "카카오페이 전자문서 서버로 대량 문서발송 처리를 요청") /*
@Operation(summary = "대량 문서발송 요청 -> batch sendBulks 에서 호출", description = "카카오페이 전자문서 서버로 대량 문서발송 처리를 요청 -> batch sendBulks 에서 호출")
@PostMapping(value = "/documents/bulk", produces = MediaType.APPLICATION_JSON_VALUE)
public BulkSendResponses requestSendBulk(
@RequestBody final BulkSendRequests reqDTO
) {
return service.requestSendBulk(reqDTO);
}
*/
@Operation(summary = "대량 문서발송 요청 -> batch sendBulks 에서 호출", description = "카카오페이 전자문서 서버로 대량 문서발송 처리를 요청 -> batch sendBulks 에서 호출")
@PostMapping(value = "/documents/bulk", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/documents/bulk", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse requestSendBulk( public IApiResponse requestSendBulk(
@RequestBody final BulkSendRequests reqDTO @RequestBody final BulkSendRequests reqDTO
@ -166,9 +175,9 @@ public class KkopayEltrcDocController {
* -. . * -. .
* </pre> * </pre>
* @param reqDTO KkopayDocBulkDTO.BulkStatusRequests * @param reqDTO KkopayDocBulkDTO.BulkStatusRequests
* @return ApiResponseDTO<BulkStatusResponses.BulkStatusResponses> * @return BulkStatusResponses.BulkStatusResponses
*/ */
@Operation(summary = "대량 문서 상태 조회 요청", description = "카카오페이 전자문서 서버로 대량 문서 상태 조회 요청") @Operation(summary = "대량 문서 상태 조회 요청 -> batch statusBulks 에서 호출", description = "카카오페이 전자문서 서버로 대량 문서 상태 조회 요청 -> batch statusBulks 에서 호출")
@PostMapping(value = "/documents/bulk/status", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/documents/bulk/status", produces = MediaType.APPLICATION_JSON_VALUE)
public IApiResponse findBulkStatus( public IApiResponse findBulkStatus(
@RequestBody final BulkStatusRequests reqDTO @RequestBody final BulkStatusRequests reqDTO

@ -9,7 +9,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.Validation; import javax.validation.Validation;
import javax.validation.Validator; import javax.validation.Validator;
@ -36,6 +35,7 @@ import kr.xit.core.model.ApiResponseDTO;
import kr.xit.core.spring.util.ApiWebClientUtil; import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.Checks; import kr.xit.core.support.utils.Checks;
import kr.xit.core.support.utils.DateUtils; import kr.xit.core.support.utils.DateUtils;
import kr.xit.core.support.utils.JsonUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -348,25 +348,30 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
final List<String> docsBinderUuids = mapper.selectKakaoStatusTgts(reqDTO.getSndngProcessSttus()); final List<String> docsBinderUuids = mapper.selectKakaoStatusTgts(reqDTO.getSndngProcessSttus());
List<List<String>> partitions = ListUtils.partition(docsBinderUuids, bulkKkoMaxCnt); List<List<String>> partitions = ListUtils.partition(docsBinderUuids, bulkKkoMaxCnt);
List<ApiResponseDTO<KkopayDocBulkDTO.BulkStatusResponses>> apiResults = partitions.stream() List<ApiResponseDTO> apiResults = partitions.stream()
.map(uuids -> .map(uuids -> apiWebClient.exchange(
ApiResponseDTO.success( url,
apiWebClient.exchange(
url.toString(),
HttpMethod.POST, HttpMethod.POST,
BulkStatusRequests.builder() BulkStatusRequests.builder()
.signguCode(reqDTO.getSignguCode()) .signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode()) .ffnlgCode(reqDTO.getFfnlgCode())
.document_binder_uuids(uuids) .document_binder_uuids(uuids)
.build(), .build(),
BulkStatusResponses.class, ApiResponseDTO.class,
getHeadeMap())) getHeadeMap())
).collect(Collectors.toList()); ).toList();
List<BulkStatusResponses> resList = new ArrayList<>();
List<KkopayDocBulkDTO.BulkStatusResponses> resList = apiResults.stream() for(ApiResponseDTO apiResult : apiResults) {
.map(ApiResponseDTO::getData) if(apiResult.getData() != null) {
.collect(Collectors.toList()); BulkStatusResponses data = JsonUtils.toObjByObj(apiResult.getData(),
BulkStatusResponses.class);
resList.add(data);
}else{
throw BizRuntimeException.create(apiResult.getMessage());
}
}
// 결과 반영 // 결과 반영
resList.forEach(o -> resList.forEach(o ->
@ -486,12 +491,12 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
for (EnsDTO.sndngVali dto : list) { for (EnsDTO.sndngVali dto : list) {
Set<ConstraintViolation<EnsDTO.sndngVali>> errList = validator.validate(dto); Set<ConstraintViolation<EnsDTO.sndngVali>> errList = validator.validate(dto);
if (list.size() > 0) { if (!list.isEmpty()) {
int finalIdx = idx; int finalIdx = idx;
errors.addAll(errList.stream() errors.addAll(errList.stream()
.map(row -> String.format("%s[%d]=%s", row.getPropertyPath(), finalIdx + 1, .map(row -> String.format("%s[%d]=%s", row.getPropertyPath(), finalIdx + 1,
row.getMessageTemplate())) row.getMessageTemplate()))
.collect(Collectors.toList()) .toList()
); );
} }
@ -571,7 +576,7 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
idx++; idx++;
} }
} }
if (errors.size() > 0) { if (!errors.isEmpty()) {
throw BizRuntimeException.create(errors.toString()); throw BizRuntimeException.create(errors.toString());
} }
} }
@ -726,27 +731,33 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
List<List<BulkSendReq>> partitions = ListUtils.partition(bulkList, bulkKkoMaxCnt); List<List<BulkSendReq>> partitions = ListUtils.partition(bulkList, bulkKkoMaxCnt);
List<ApiResponseDTO> apiResults = partitions.stream()
List<ApiResponseDTO<BulkSendResponses>> apiResults = partitions.stream() .map(bulkSendList -> apiWebClient.exchange(
.map(bulkSendList -> url,
ApiResponseDTO.success(
apiWebClient.exchange(
url.toString(),
HttpMethod.POST, HttpMethod.POST,
BulkSendRequests.builder() BulkSendRequests.builder()
.signguCode(tgtDTO.getSignguCode()) .signguCode(tgtDTO.getSignguCode())
.ffnlgCode(tgtDTO.getFfnlgCode()) .ffnlgCode(tgtDTO.getFfnlgCode())
.documents(bulkSendList) .documents(bulkSendList)
.build(), .build(),
BulkSendResponses.class, ApiResponseDTO.class,
getHeadeMap())) getHeadeMap())
) )
.collect(Collectors.toList()); .toList();
List<BulkSendResponses> resList = new ArrayList<>();
// GET 결과 목록 for(ApiResponseDTO apiResult : apiResults) {
List<BulkSendResponses> resList = apiResults.stream() if(apiResult.getData() != null) {
.map(ApiResponseDTO::getData) BulkSendResponses data = JsonUtils.toObjByObj(apiResult.getData(),
.collect(Collectors.toList()); BulkSendResponses.class);
resList.add(data);
}else{
updateKkoMyDocSndngMstFailStatus(mstIdList, apiResult.getMessage());
throw BizRuntimeException.create(apiResult.getMessage());
}
}
// 카카오 문서 요청 결과 반영 // 카카오 문서 요청 결과 반영
requireNewService.saveKkoMyDocResult(mstIdList, tgtDTO.getUnitySndngMastrId(), resList); requireNewService.saveKkoMyDocResult(mstIdList, tgtDTO.getUnitySndngMastrId(), resList);
@ -829,13 +840,13 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
Set<ConstraintViolation<KkopayDocBulkDTO.BulkSendReq>> errList = validator.validate( Set<ConstraintViolation<KkopayDocBulkDTO.BulkSendReq>> errList = validator.validate(
dto); dto);
if (list.size() > 0) { if (!list.isEmpty()) {
int finalIdx = idx; int finalIdx = idx;
errors.addAll(errList.stream() errors.addAll(errList.stream()
.map(row -> String.format("%s[%d]=%s", row.getPropertyPath(), finalIdx + 1, .map(row -> String.format("%s[%d]=%s", row.getPropertyPath(), finalIdx + 1,
row.getMessageTemplate())) row.getMessageTemplate()))
.collect(Collectors.toList()) .toList()
); );
} }
@ -865,7 +876,7 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
} }
} }
if (errors.size() > 0) { if (!errors.isEmpty()) {
throw BizRuntimeException.create(errors.toString()); throw BizRuntimeException.create(errors.toString());
} }
} }
@ -942,24 +953,28 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
List<List<KtMainSendReqData>> partitions = ListUtils.partition(sendReqs, bulkKtMaxCnt); List<List<KtMainSendReqData>> partitions = ListUtils.partition(sendReqs, bulkKtMaxCnt);
List<ApiResponseDTO<KtCommonResponse>> apiResults = partitions.stream() List<ApiResponseDTO> apiResults = partitions.stream()
.map(bulkSendList -> { .map(bulkSendList -> {
infoDto.setReqs(bulkSendList); infoDto.setReqs(bulkSendList);
return ApiResponseDTO.success( return apiWebClient.exchange(
apiWebClient.exchange( url,
url.toString(),
HttpMethod.POST, HttpMethod.POST,
infoDto, infoDto,
KtCommonResponse.class, ApiResponseDTO.class,
getHeadeMap())); getHeadeMap());
} }
) )
.collect(Collectors.toList()); .toList();
// GET 결과 목록 List<KtCommonResponse> resList = new ArrayList<>();
List<KtCommonResponse> resList = apiResults.stream() for(ApiResponseDTO apiResult : apiResults) {
.map(ApiResponseDTO::getData) if(apiResult.getData() != null) {
.collect(Collectors.toList()); resList.add(JsonUtils.toObjByObj(apiResult.getData(), KtCommonResponse.class));
}else{
//updateKkoMyDocSndngMstFailStatus(mstIdList, apiResult.getMessage());
throw BizRuntimeException.create(apiResult.getMessage());
}
}
// 카카오 문서 요청 결과 반영 // 카카오 문서 요청 결과 반영
//requireNewService.saveKkoMyDocResult(mstIdList, tgtDTO.getUnitySndngMastrId(), resList); //requireNewService.saveKkoMyDocResult(mstIdList, tgtDTO.getUnitySndngMastrId(), resList);

@ -140,7 +140,7 @@ public class EnsCctvFileService extends EgovAbstractServiceImpl implements IEnsC
public void acceptEnsNtnccntcSndng() { public void acceptEnsNtnccntcSndng() {
List<EnsNtncCntcSndngTgt> tgtList = mapper.selectEnsNtncCntcSndngs(); List<EnsNtncCntcSndngTgt> tgtList = mapper.selectEnsNtncCntcSndngs();
if(tgtList.size() == 0) return; if(tgtList.isEmpty()) return;
// search 전자 고지 연계발송 데이타 생성 대상 // search 전자 고지 연계발송 데이타 생성 대상
Optional<EnsNtncCntcSndngTgt> first = tgtList.stream() Optional<EnsNtncCntcSndngTgt> first = tgtList.stream()

@ -138,7 +138,7 @@ public class PniCctvFileService extends EgovAbstractServiceImpl implements IPniC
public void acceptPniNtnccntcSndng() { public void acceptPniNtnccntcSndng() {
List<PniDTO.PniNtncCntcSndngTgts> tgtList = mapper.selectPniNtncCntcSndngs(); List<PniDTO.PniNtncCntcSndngTgts> tgtList = mapper.selectPniNtncCntcSndngs();
if(tgtList.size() == 0) return; if(tgtList.isEmpty()) return;
// search 사전알림 연계발송 SMS 데이타 생성 대상 // search 사전알림 연계발송 SMS 데이타 생성 대상
Optional<PniDTO.PniNtncCntcSndngTgts> sms = tgtList.stream() Optional<PniDTO.PniNtncCntcSndngTgts> sms = tgtList.stream()

@ -68,7 +68,7 @@ public class CachingConfig {
log.info("Key {} was evicted ({}): {}", key, cause, value)) log.info("Key {} was evicted ({}): {}", key, cause, value))
.build() .build()
)) ))
.collect(Collectors.toList()); .toList();
final SimpleCacheManager cacheManager = new SimpleCacheManager(); final SimpleCacheManager cacheManager = new SimpleCacheManager();
cacheManager.setCaches(caffeineCaches); cacheManager.setCaches(caffeineCaches);

@ -117,7 +117,7 @@ public class IpMacUtils {
if(inetAddress.getAddress().length == 4) ips.add(inetAddress.getHostAddress().toString()); if(inetAddress.getAddress().length == 4) ips.add(inetAddress.getHostAddress().toString());
} }
} }
return ips.stream().distinct().collect(Collectors.toList()); return ips.stream().distinct().toList();
} catch (SocketException e) { } catch (SocketException e) {
log.error("{}", e.getLocalizedMessage()); log.error("{}", e.getLocalizedMessage());
throw BizRuntimeException.create(e.getLocalizedMessage()); throw BizRuntimeException.create(e.getLocalizedMessage());

@ -114,7 +114,7 @@ public class StreamingRow implements Row {
*/ */
@Override @Override
public short getFirstCellNum() { public short getFirstCellNum() {
if (cellMap.size() == 0) { if (cellMap.isEmpty()) {
return -1; return -1;
} }
return cellMap.firstKey().shortValue(); return cellMap.firstKey().shortValue();

@ -24,7 +24,7 @@ public class BufferedStringsTable extends SharedStringsTable implements AutoClos
throws IOException { throws IOException {
List<PackagePart> parts = pkg.getPartsByContentType( List<PackagePart> parts = pkg.getPartsByContentType(
XSSFRelation.SHARED_STRINGS.getContentType()); XSSFRelation.SHARED_STRINGS.getContentType());
return parts.size() == 0 ? null return parts.isEmpty() ? null
: new BufferedStringsTable(parts.get(0), tmp, cacheSizeBytes); : new BufferedStringsTable(parts.get(0), tmp, cacheSizeBytes);
} }

@ -152,7 +152,7 @@ public class AppInitHelper {
if(inetAddress.getAddress().length == 4) ips.add(inetAddress.getHostAddress().toString()); if(inetAddress.getAddress().length == 4) ips.add(inetAddress.getHostAddress().toString());
} }
} }
return ips.stream().distinct().collect(Collectors.toList()); return ips.stream().distinct().toList();
} catch (SocketException e) { } catch (SocketException e) {
throw e; throw e;
} }

Loading…
Cancel
Save