16 lines
693 B
C#
16 lines
693 B
C#
using System.Collections.Generic;
|
|
using System.Net.Http;
|
|
using System.Threading.Tasks;
|
|
using Website.Models.Git;
|
|
|
|
namespace Website.Data {
|
|
public class GitApi : ApiClient, IGitApi {
|
|
|
|
public GitApi(HttpClient client) : base(client) {
|
|
}
|
|
|
|
public async Task<IEnumerable<Repository>> GetRepositories(string user) => await Get<IEnumerable<Repository>>("repositories", new { user });
|
|
public async Task<IEnumerable<Branch>> GetBranches(string user, string repository) => await Get<IEnumerable<Branch>>("branches", new {user, repository});
|
|
public async Task<Commit> GetCommit(string user, string repository, string hash) => await Get<Commit>("commit", new {user, repository, hash});
|
|
}
|
|
}
|