-
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.
merge backend/enhancement/annotation-service impl to develop
- Loading branch information
Showing
17 changed files
with
306 additions
and
141 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
7 changes: 3 additions & 4 deletions
7
app/annotation-service/src/main/kotlin/com/group6/annotationservice/dtos/AnnotationDto.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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
package com.group6.annotationservice.dtos | ||
|
||
import com.group6.annotationservice.entity.Motivation | ||
import java.time.LocalDateTime | ||
import java.util.UUID | ||
import java.util.* | ||
|
||
data class AnnotationDto ( | ||
val context: String = "http://www.w3.org/ns/anno.jsonld", | ||
val id: String = "" + UUID.randomUUID().toString(), //todo put our domain name here and generate a uuid | ||
val type: String = "Annotation", | ||
val motivation: List<Motivation>? = null, | ||
val motivation: List<String>? = null, | ||
val creator: String? = null, | ||
val created: LocalDateTime? = LocalDateTime.now(), // ISO-8601 datetime format | ||
val body: List<BodyDto>? = null, | ||
val target: List<TargetDto> | ||
val target: TargetDto = TargetDto() | ||
) |
9 changes: 9 additions & 0 deletions
9
...notation-service/src/main/kotlin/com/group6/annotationservice/dtos/FragmentSelectorDto.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,9 @@ | ||
package com.group6.annotationservice.dtos | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName | ||
|
||
@JsonTypeName("FragmentSelector") | ||
data class FragmentSelectorDto( | ||
override val type: String = "FragmentSelector", | ||
val value: String = "xywh=,,,", // e.g., "annotea is awesome" | ||
) : SelectorDto() |
5 changes: 5 additions & 0 deletions
5
...vice/src/main/kotlin/com/group6/annotationservice/dtos/GetAnnotationsByTargetIdRequest.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 com.group6.annotationservice.dtos | ||
|
||
data class GetAnnotationsByTargetIdRequest( | ||
val targetId: String = "" | ||
) |
24 changes: 14 additions & 10 deletions
24
app/annotation-service/src/main/kotlin/com/group6/annotationservice/dtos/SelectorDto.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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package com.group6.annotationservice.dtos | ||
|
||
import lombok.AllArgsConstructor | ||
import lombok.Data | ||
import lombok.NoArgsConstructor | ||
import com.fasterxml.jackson.annotation.JsonSubTypes | ||
import com.fasterxml.jackson.annotation.JsonTypeInfo | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
data class SelectorDto ( | ||
val type: String = "TextPositionSelector", | ||
val startIndex: Int, // Starting character position | ||
val endIndex: Int // Ending character position | ||
@JsonTypeInfo( | ||
use = JsonTypeInfo.Id.NAME, | ||
include = JsonTypeInfo.As.EXISTING_PROPERTY, | ||
property = "type", | ||
visible = true | ||
) | ||
@JsonSubTypes( | ||
JsonSubTypes.Type(value = TextPositionSelectorDto::class, name = "TextPositionSelector"), | ||
JsonSubTypes.Type(value = FragmentSelectorDto::class, name = "FragmentSelector") | ||
) | ||
abstract class SelectorDto( | ||
open val type: String = "" | ||
) |
5 changes: 2 additions & 3 deletions
5
app/annotation-service/src/main/kotlin/com/group6/annotationservice/dtos/TargetDto.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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
package com.group6.annotationservice.dtos | ||
|
||
import com.group6.annotationservice.entity.Selector | ||
import java.util.UUID | ||
import java.util.* | ||
|
||
class TargetDto ( | ||
val id: String = "" + UUID.randomUUID().toString(), //todo put our domain name here and generate a uuid | ||
val format: String? = null, | ||
val language: String? = null, | ||
val selectors: List<SelectorDto>? = null | ||
var selector: SelectorDto? = null | ||
) |
11 changes: 11 additions & 0 deletions
11
...tion-service/src/main/kotlin/com/group6/annotationservice/dtos/TextPositionSelectorDto.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 com.group6.annotationservice.dtos | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName | ||
|
||
@JsonTypeName("TextPositionSelector") | ||
data class TextPositionSelectorDto( | ||
override val type: String = "TextPositionSelector", | ||
val start: Int = 0, // e.g., 0 | ||
val end: Int = 0, // e.g., 10 | ||
|
||
) : SelectorDto() |
Oops, something went wrong.