mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-23 16:04:30 +01:00
cleanup
This commit is contained in:
@@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/node/{pubkey}")
|
||||
@@ -113,6 +112,6 @@ public class NodeController {
|
||||
return channels.stream()
|
||||
.map(Channel::getId)
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/status/")
|
||||
@@ -49,7 +48,7 @@ public class StatusController {
|
||||
.map(LocalOpenChannel::getId)
|
||||
.sorted()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
return new ChannelsDto(channelIds);
|
||||
}
|
||||
|
||||
@@ -60,7 +59,7 @@ public class StatusController {
|
||||
.map(LocalOpenChannel::getRemotePubkey)
|
||||
.sorted()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
return new PubkeysDto(pubkeys);
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ public class StatusController {
|
||||
.map(LocalChannel::getId)
|
||||
.sorted()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
return new ChannelsDto(channelIds);
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ public class StatusController {
|
||||
.map(LocalChannel::getRemotePubkey)
|
||||
.sorted()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
return new PubkeysDto(pubkeys);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@ import de.cotto.lndmanagej.model.Pubkey;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public record PubkeysDto(List<String> pubkeys) {
|
||||
public PubkeysDto(Collection<Pubkey> pubkeys) {
|
||||
this(pubkeys.stream().map(Pubkey::toString).collect(Collectors.toList()));
|
||||
this(pubkeys.stream().map(Pubkey::toString).toList());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user