mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 23:44:21 +01:00
rename controller
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package de.cotto.lndmanagej.controller;
|
||||
|
||||
import de.cotto.lndmanagej.model.ChannelId;
|
||||
import de.cotto.lndmanagej.model.Pubkey;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/node/{pubkey}/")
|
||||
public class LegacyController {
|
||||
private final NodeService nodeService;
|
||||
|
||||
public LegacyController(NodeService nodeService) {
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
@GetMapping("/alias")
|
||||
public String getAlias(@PathVariable Pubkey pubkey) {
|
||||
return nodeService.getAlias(pubkey);
|
||||
}
|
||||
|
||||
@GetMapping("/open-channels")
|
||||
public List<String> getOpenChannelIds(@PathVariable Pubkey pubkey) {
|
||||
return nodeService.getOpenChannelIds(pubkey).stream()
|
||||
.map(ChannelId::toString)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user