Use new projects API

This commit is contained in:
Robert Marshall 2020-04-12 11:09:04 +01:00
parent 11bca4cf53
commit 8bf483b334
24 changed files with 141 additions and 222 deletions

View file

@ -1,14 +1,6 @@
using Website.Data.States.Git;
namespace Website.Models.Git {
namespace Website.Models.Git {
public class Branch {
public Branch(BranchState state) {
Name = state.name;
Commit = new Commit(state.commit);
}
public string Name { get; }
public Commit Commit { get; private set; }
public string Name { get; set; }
public Commit Commit { get; set; }
}
}
}

View file

@ -1,24 +1,10 @@
using System;
using Website.Data.States.Git;
using System;
namespace Website.Models.Git {
public class Commit {
public Commit(CommitState commit) {
Id = commit.id;
Message = commit.message;
Timestamp = commit.timestamp;
}
public Commit(CommitDetailsState commit) {
Id = commit.sha;
Message = commit.commit.message;
Timestamp = commit.commit.author.date;
Url = commit.html_url.Replace("/commits/", "/commit/");
}
public string Id { get; }
public string Message { get; }
public DateTimeOffset Timestamp { get; }
public string Url { get; }
public string Id { get; set; }
public string Message { get; set; }
public DateTimeOffset Timestamp { get; set; }
public string Url { get; set; }
}
}
}

View file

@ -1,13 +1,6 @@
using Website.Data.States.Git;
namespace Website.Models.Git {
namespace Website.Models.Git {
public class Repository {
public Repository(RepositoryState state) {
Name = state.name;
Url = state.html_url;
}
public string Name { get; set; }
public string Url { get; set; }
}
}
}