make x default in compact form, remove unused endpoint from legacy controller, add compact forms to channel details

This commit is contained in:
Carsten Otto
2021-11-22 17:33:03 +01:00
parent 76628d0ce4
commit e03ecddf48
7 changed files with 35 additions and 36 deletions

View File

@@ -61,14 +61,6 @@ public class LegacyController {
.collect(Collectors.joining(NEWLINE));
}
@GetMapping("/open-channels/compact")
public String getOpenChannelIdsCompact() {
mark("getOpenChannelIdsCompact");
return getOpenChannelIdsSorted()
.map(ChannelId::getCompactForm)
.collect(Collectors.joining(NEWLINE));
}
@GetMapping("/open-channels/pretty")
public String getOpenChannelIdsPretty() {
mark("getOpenChannelIdsPretty");

View File

@@ -6,8 +6,20 @@ import de.cotto.lndmanagej.model.Pubkey;
public record ChannelDetailsDto(
ChannelId channelId,
String channelIdCompact,
String channelIdCompactLnd,
Pubkey remotePubkey,
String remoteAlias,
@JsonProperty("private") boolean privateChannel
) {
public ChannelDetailsDto(ChannelId channelId, Pubkey remotePubkey, String remoteAlias, boolean privateChannel) {
this(
channelId,
channelId.getCompactForm(),
channelId.getCompactFormLnd(),
remotePubkey,
remoteAlias,
privateChannel
);
}
}