-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from cardano-foundation/demo
feat: connect wallet list popup
- Loading branch information
Showing
76 changed files
with
3,170 additions
and
1,009 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ting-admin-app/src/main/java/org/cardano/foundation/voting/shell/CFVotingAppCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.cardano.foundation.voting.shell; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.shell.standard.ShellComponent; | ||
import org.springframework.shell.standard.ShellMethod; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.http.HttpClient; | ||
import java.net.http.HttpRequest; | ||
import java.net.http.HttpResponse; | ||
|
||
@ShellComponent | ||
@Slf4j | ||
public class CFVotingAppCommands { | ||
|
||
@Autowired | ||
private HttpClient httpClient; | ||
|
||
@Value("${voting.app.base.url:http://localhost:8080}") | ||
private String votingAppBaseUrl; | ||
|
||
@ShellMethod(key = "full-metadata-scan", value = "Invokes full metadata scan on voting-app") | ||
public String votingAppFullMetadataScan() throws IOException, InterruptedException { | ||
log.info("Invoking full metadata scan on voting-app..."); | ||
|
||
var metadataScanRequest = HttpRequest.newBuilder() | ||
.uri(URI.create(votingAppBaseUrl + "/api/admin/full-metadata-scan") ) | ||
.POST(HttpRequest.BodyPublishers.noBody()) | ||
.header("Content-Type", "application/json") | ||
.build(); | ||
|
||
var response = httpClient.send(metadataScanRequest, HttpResponse.BodyHandlers.discarding()); | ||
|
||
if (response.statusCode() >= 200 && response.statusCode() < 300) { | ||
return "Successfully en-queued metadata scan request."; | ||
} | ||
|
||
return "Error en-queuing metadata scan request: " + response.statusCode() + " " + response.body(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.