-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from cloudogu/feature/50_file_history
Feature/50 file history
- Loading branch information
Showing
54 changed files
with
1,667 additions
and
164 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/com/cloudogu/smeagol/wiki/domain/CommitRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.cloudogu.smeagol.wiki.domain; | ||
|
||
/** | ||
* CommitRepository supplies the commits of a wiki. | ||
*/ | ||
@SuppressWarnings("squid:S1609") // ignore functional interface warning | ||
public interface CommitRepository { | ||
/** | ||
* Find the commits to a given path for a wiki. | ||
* | ||
* @param id id of wiki | ||
* @param path search path | ||
* | ||
* @return History which contains the list of commits | ||
*/ | ||
History findHistoryByWikiIdAndPath(WikiId id, Path path); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/cloudogu/smeagol/wiki/domain/History.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.cloudogu.smeagol.wiki.domain; | ||
|
||
import java.util.List; | ||
|
||
public class History { | ||
|
||
private final WikiId wikiId; | ||
private final Path path; | ||
private final List<Commit> commits; | ||
|
||
public History(WikiId wikiId, Path path, List<Commit> commits) { | ||
this.wikiId = wikiId; | ||
this.path = path; | ||
this.commits = commits; | ||
} | ||
|
||
public WikiId getWikiId() { | ||
return wikiId; | ||
} | ||
|
||
public Path getPath() { | ||
return path; | ||
} | ||
|
||
public List<Commit> getCommits() { | ||
return commits; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/com/cloudogu/smeagol/wiki/infrastructure/CommitResourceAssembler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.cloudogu.smeagol.wiki.infrastructure; | ||
|
||
import com.cloudogu.smeagol.wiki.domain.Commit; | ||
|
||
public class CommitResourceAssembler { | ||
public CommitResource toResource(Commit commit) { | ||
return new CommitResource(commit.getId().get().getValue(), | ||
new AuthorResource(commit.getAuthor().getDisplayName().toString(), | ||
commit.getAuthor().getEmail().toString()), | ||
commit.getDate().toString(), commit.getMessage().toString()); | ||
} | ||
} |
Oops, something went wrong.