mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-24 08:24:20 +01:00
default to compact form, add channel point to channel details
This commit is contained in:
@@ -2,14 +2,15 @@ package de.cotto.lndmanagej.controller.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import de.cotto.lndmanagej.model.BalanceInformation;
|
||||
import de.cotto.lndmanagej.model.ChannelId;
|
||||
import de.cotto.lndmanagej.model.ChannelPoint;
|
||||
import de.cotto.lndmanagej.model.LocalChannel;
|
||||
import de.cotto.lndmanagej.model.Pubkey;
|
||||
|
||||
public record ChannelDetailsDto(
|
||||
ChannelId channelId,
|
||||
String channelIdShort,
|
||||
String channelIdCompact,
|
||||
String channelIdCompactLnd,
|
||||
ChannelPoint channelPoint,
|
||||
Pubkey remotePubkey,
|
||||
String remoteAlias,
|
||||
@JsonProperty("private") boolean privateChannel,
|
||||
@@ -23,9 +24,10 @@ public record ChannelDetailsDto(
|
||||
OnChainCostsDto onChainCosts
|
||||
) {
|
||||
this(
|
||||
localChannel.getId(),
|
||||
String.valueOf(localChannel.getId().getShortChannelId()),
|
||||
localChannel.getId().getCompactForm(),
|
||||
localChannel.getId().getCompactFormLnd(),
|
||||
localChannel.getChannelPoint(),
|
||||
localChannel.getRemotePubkey(),
|
||||
remoteAlias,
|
||||
localChannel.isPrivateChannel(),
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import de.cotto.lndmanagej.model.ChannelId;
|
||||
import de.cotto.lndmanagej.model.ChannelPoint;
|
||||
import de.cotto.lndmanagej.model.Pubkey;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -21,6 +22,7 @@ public class ObjectMapperConfiguration {
|
||||
SimpleModule module = new SimpleModule("SimpleModule");
|
||||
module.addSerializer(Pubkey.class, new ToStringSerializer());
|
||||
module.addSerializer(ChannelId.class, new ToStringSerializer());
|
||||
module.addSerializer(ChannelPoint.class, new ToStringSerializer());
|
||||
return new ObjectMapper().registerModule(module);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user