Updated comments on the API methods
This commit is contained in:
@@ -15,6 +15,9 @@ namespace OurUmbraco.Community.Controllers
|
||||
{
|
||||
public class GitHubContributorController : SurfaceController
|
||||
{
|
||||
/// <summary>
|
||||
/// Repositories to include in the combination
|
||||
/// </summary>
|
||||
private readonly string[] Repositories =
|
||||
{
|
||||
"Umbraco-CMS",
|
||||
@@ -25,6 +28,11 @@ namespace OurUmbraco.Community.Controllers
|
||||
"Umbraco.Deploy.ValueConnectors"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets data for all GitHub contributors for all listed Umbraco repositories,
|
||||
/// excluding the GitHub IDs of the HQ contributors from the text file list
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ActionResult GitHubGetContributorsResult()
|
||||
{
|
||||
var model = new GitHubContributorsModel();
|
||||
@@ -37,7 +45,6 @@ namespace OurUmbraco.Community.Controllers
|
||||
return PartialView("~/Views/Partials/Home/GitHubContributors.cshtml", model);
|
||||
}
|
||||
|
||||
// Get the GitHub ID of each HQ contributor
|
||||
string[] login = System.IO.File.ReadAllLines(configPath).Where(x => x.Trim() != "").Distinct().ToArray();
|
||||
var contributors = ApplicationContext.ApplicationCache.RuntimeCache.GetCacheItem<List<GitHubContributorModel>>("UmbracoGitHubContributors",
|
||||
() =>
|
||||
|
||||
@@ -7,15 +7,19 @@ namespace OurUmbraco.Our.Api
|
||||
public class GitHubController
|
||||
{
|
||||
private const string RepositoryOwner = "Umbraco";
|
||||
private const string GitHubApiClient = "https://api.github.com";
|
||||
private const string UserAgent = "OurUmbraco";
|
||||
|
||||
/// <summary>
|
||||
/// Get all contributors from GitHub Umbraco repositories
|
||||
/// </summary>
|
||||
/// <param name="repo"></param>
|
||||
/// <returns></returns>
|
||||
public IRestResponse<List<GitHubContributorModel>> GetAllRepoContributors(string repo)
|
||||
{
|
||||
var client = new RestClient("https://api.github.com");
|
||||
var client = new RestClient(GitHubApiClient);
|
||||
var request = new RestRequest(string.Format("/repos/{0}/{1}/stats/contributors", RepositoryOwner, repo), Method.GET);
|
||||
client.UserAgent = "OurUmbraco";
|
||||
client.UserAgent = UserAgent;
|
||||
var response = client.Execute<List<GitHubContributorModel>>(request);
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user