mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-27 01:44:30 +01:00
remove legacy endpoint
This commit is contained in:
@@ -2,14 +2,11 @@ package de.cotto.lndmanagej.controller;
|
||||
|
||||
import com.codahale.metrics.MetricRegistry;
|
||||
import de.cotto.lndmanagej.metrics.Metrics;
|
||||
import de.cotto.lndmanagej.model.Channel;
|
||||
import de.cotto.lndmanagej.model.ChannelId;
|
||||
import de.cotto.lndmanagej.model.LocalOpenChannel;
|
||||
import de.cotto.lndmanagej.model.Pubkey;
|
||||
import de.cotto.lndmanagej.service.ChannelService;
|
||||
import de.cotto.lndmanagej.service.NodeService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -34,19 +31,9 @@ public class LegacyController {
|
||||
this.metrics = metrics;
|
||||
}
|
||||
|
||||
@GetMapping("/node/{pubkey}/all-channels")
|
||||
public String getAllChannelIdsForPubkey(@PathVariable Pubkey pubkey) {
|
||||
mark("getAllChannelIdsForPubkey");
|
||||
return channelService.getAllChannelsWith(pubkey).stream()
|
||||
.map(Channel::getId)
|
||||
.sorted()
|
||||
.map(ChannelId::toString)
|
||||
.collect(Collectors.joining(NEWLINE));
|
||||
}
|
||||
|
||||
@GetMapping("/open-channels/pretty")
|
||||
public String getOpenChannelIdsPretty() {
|
||||
mark("getOpenChannelIdsPretty");
|
||||
metrics.mark(MetricRegistry.name(getClass(), "getOpenChannelIdsPretty"));
|
||||
return channelService.getOpenChannels().stream()
|
||||
.sorted(Comparator.comparing(LocalOpenChannel::getId))
|
||||
.map(localOpenChannel -> {
|
||||
@@ -58,8 +45,4 @@ public class LegacyController {
|
||||
})
|
||||
.collect(Collectors.joining(NEWLINE));
|
||||
}
|
||||
|
||||
private void mark(String name) {
|
||||
metrics.mark(MetricRegistry.name(getClass(), name));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user