add private status to channel details

This commit is contained in:
Carsten Otto
2021-11-19 18:18:52 +01:00
parent e938c2d8a0
commit 256c1cc42a
13 changed files with 126 additions and 35 deletions

View File

@@ -34,6 +34,7 @@ public class ChannelDetailsController {
}
Pubkey remotePubkey = localChannel.getRemotePubkey();
String remoteAlias = nodeService.getAlias(remotePubkey);
return new ChannelDetailsDto(localChannel.getId(), remotePubkey, remoteAlias);
boolean privateChannel = localChannel.isPrivateChannel();
return new ChannelDetailsDto(localChannel.getId(), remotePubkey, remoteAlias, privateChannel);
}
}

View File

@@ -1,5 +1,6 @@
package de.cotto.lndmanagej.controller;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import de.cotto.lndmanagej.model.ChannelId;
@@ -8,6 +9,7 @@ import de.cotto.lndmanagej.model.Pubkey;
public record ChannelDetailsDto(
@JsonSerialize(using = ToStringSerializer.class) ChannelId channelId,
@JsonSerialize(using = ToStringSerializer.class) Pubkey remotePubkey,
String remoteAlias
String remoteAlias,
@JsonProperty("private") boolean privateChannel
) {
}