Use new API for blog
This commit is contained in:
parent
e389b2404a
commit
25c320bf6b
17 changed files with 356 additions and 314 deletions
|
@ -6,16 +6,16 @@ using System.Linq;
|
|||
|
||||
namespace Website.Controllers {
|
||||
public class HomeController : Controller {
|
||||
private readonly BlogRepository _blogRepo;
|
||||
private readonly IBlogApi _blogApi;
|
||||
private readonly GitServerApi _api;
|
||||
|
||||
public HomeController(BlogRepository blogRepo, GitServerApi api) {
|
||||
public HomeController(IBlogApi blogApi, GitServerApi api) {
|
||||
_api = api;
|
||||
_blogRepo = blogRepo;
|
||||
_blogApi = blogApi;
|
||||
}
|
||||
|
||||
public async Task<IActionResult> Index() {
|
||||
var post = await _blogRepo.GetLatestPostAsync();
|
||||
var post = await _blogApi.GetLatestPostAsync();
|
||||
var repo = (await _api.GetRepositories()).First();
|
||||
var branch = (await _api.GetBranches(repo.Name)).First();
|
||||
var commit = await _api.GetCommit(repo.Name, branch.Commit.Id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue