-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support retrievement of changed files for commits. (#38)
- Loading branch information
1 parent
87c38ed
commit f6d5486
Showing
26 changed files
with
414 additions
and
144 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
common/src/main/kotlin/org/octopusden/octopus/vcsfacade/client/common/dto/CommitWithFiles.kt
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,8 @@ | ||
package org.octopusden.octopus.vcsfacade.client.common.dto | ||
|
||
data class CommitWithFiles( | ||
val commit: Commit, | ||
val files: List<FileChange> | ||
) : VcsFacadeResponse, Comparable<CommitWithFiles> { | ||
override fun compareTo(other: CommitWithFiles) = commit compareTo other.commit | ||
} |
3 changes: 3 additions & 0 deletions
3
common/src/main/kotlin/org/octopusden/octopus/vcsfacade/client/common/dto/FileChange.kt
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,3 @@ | ||
package org.octopusden.octopus.vcsfacade.client.common.dto | ||
|
||
data class FileChange(val type: FileChangeType, val path: String, val link: String) |
5 changes: 5 additions & 0 deletions
5
common/src/main/kotlin/org/octopusden/octopus/vcsfacade/client/common/dto/FileChangeType.kt
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,5 @@ | ||
package org.octopusden.octopus.vcsfacade.client.common.dto | ||
|
||
enum class FileChangeType { | ||
ADD, MODIFY, DELETE | ||
} |
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
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
11 changes: 11 additions & 0 deletions
11
server/src/main/kotlin/org/octopusden/octopus/vcsfacade/document/FileChangeDocument.kt
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,11 @@ | ||
package org.octopusden.octopus.vcsfacade.document | ||
|
||
import org.octopusden.octopus.vcsfacade.client.common.dto.FileChangeType | ||
import org.springframework.data.elasticsearch.annotations.Field | ||
import org.springframework.data.elasticsearch.annotations.FieldType | ||
|
||
data class FileChangeDocument( | ||
@Field(type = FieldType.Keyword) val type: FileChangeType, | ||
@Field(type = FieldType.Text, analyzer = "classic") val path: String, | ||
@Field(type = FieldType.Keyword) val link: String | ||
) |
20 changes: 20 additions & 0 deletions
20
server/src/main/kotlin/org/octopusden/octopus/vcsfacade/dto/HashOrRefOrDate.kt
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,20 @@ | ||
package org.octopusden.octopus.vcsfacade.dto | ||
|
||
import java.util.Date | ||
import org.octopusden.octopus.vcsfacade.client.common.exception.ArgumentsNotCompatibleException | ||
|
||
sealed class HashOrRefOrDate<out String, out Date> { | ||
class HashOrRefValue(val value: String) : HashOrRefOrDate<String, Nothing>() | ||
class DateValue(val value: Date) : HashOrRefOrDate<Nothing, Date>() | ||
|
||
companion object { | ||
fun create(hashOrRef: String?, date: Date?) = if (hashOrRef != null) { | ||
if (date != null) { | ||
throw ArgumentsNotCompatibleException("'hashOrRef' and 'date' can not be used together") | ||
} | ||
HashOrRefValue(hashOrRef) | ||
} else if (date != null) { | ||
DateValue(date) | ||
} else null | ||
} | ||
} |
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
Oops, something went wrong.