我希望您能根据大小和关键词参数搜索Github仓库。以下是我编写的Java代码:
但是我得到的输出为空:
我查看了GitHub Java API的javadoc,但是没有找到解决方案。
谢谢!
package searchTest;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.egit.github.core.SearchRepository;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.RepositoryService;
public class GithubSearch {
private static Map<String, String> searchQuery = new HashMap<String, String>();
public static void main(String[] args) throws IOException {
GitHubClient client = new GitHubClient();
client.setCredentials("username", "password");
RepositoryService service = new RepositoryService(client);
searchQuery.put("keyword","microsoft");
searchQuery.put("size","304");
List<SearchRepository> searchRes = service.searchRepositories(searchQuery);
System.out.println("Search result "+searchRes.toString());
}
}
但是我得到的输出为空:
Search result []
我查看了GitHub Java API的javadoc,但是没有找到解决方案。
谢谢!