remove legacy endpoint

This commit is contained in:
Carsten Otto
2021-11-27 17:39:13 +01:00
parent e61cfa6ee2
commit 05892ab376
3 changed files with 1 additions and 53 deletions

View File

@@ -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));
}
}