gpt4 book ai didi

java - 列出存储库中的所有问题

转载 作者:行者123 更新时间:2023-11-30 02:43:02 26 4
gpt4 key购买 nike

我想将所有问题列出到所有组织下的所有存储库中。我尝试了这段代码:

GitHubClient client = new GitHubClient(host);
client.setCredentials(user_name, password);

RepositoryService repository = new RepositoryService(client);
IssueService issues = new IssueService(client);

OrganizationService organization = new OrganizationService(client);

List<Repository> orgRepositories = repository.getOrgRepositories("eMerchantPay");

for (int i = 0; i < orgRepositories.size(); i++) {
Repository get = orgRepositories.get(i);
String name = get.getName();
System.out.println("Repository name " + name);

Map<String, String> map = new HashMap<>();
List<Issue> issues1 = issues.getIssues(user_name, name, map);

for (int x = 0; x < issues1.size(); x++) {
Issue get1 = issues1.get(x);
String title = get1.getTitle();
System.out.println("Issue name " + title);
}

}

如何使用 org.eclipse.egit.github.core 库做到这一点?

最佳答案

您可以使用org.eclipse.egit.github.core.service.IssueService用于获取给定存储库的所有问题。

查看example in this question ,您将在其中获得问题的页面:

IssueService service = new IssueService(client);
Map<String, String> params = new HashMap<String, String>();
params.put(IssueService.FILTER_STATE, IssueService.STATE_CLOSED);
PageIterator<Issue> iterator = service.pageIssues("schacon", "showoff",
params, 1);

关于java - 列出存储库中的所有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41079009/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com