260728_01_ENH: SID String으로 교체
This commit is contained in:
@@ -44,10 +44,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
public class MessageResultService {
|
||||
|
||||
private final NotiHubApiClient notiHubApiClient;
|
||||
public Map<Integer, ListSendResultDto> findSendResultMap(
|
||||
public Map<String, ListSendResultDto> findSendResultMap(
|
||||
ChannelType channelTy,
|
||||
String prjctCd,
|
||||
List<Integer> sids
|
||||
List<String> sids
|
||||
) {
|
||||
if (sids == null || sids.isEmpty()) {
|
||||
return Collections.emptyMap();
|
||||
@@ -64,20 +64,10 @@ public class MessageResultService {
|
||||
return notiHubApiClient.getLastSendResults(channelTy, REQUEST_SERVICE, prjctCd, sidValues)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
dto -> parseSid(dto.getSid()),
|
||||
dto -> dto.getSid(),
|
||||
ListSendResultDto::from,
|
||||
(left, right) -> left,
|
||||
LinkedHashMap::new
|
||||
));
|
||||
}
|
||||
private Integer parseSid(String sid) {
|
||||
if (sid == null || sid.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.valueOf(sid);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user