-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add endpoint returning all project keys with disabled languages (…
- Loading branch information
Showing
10 changed files
with
148 additions
and
2 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
6 changes: 6 additions & 0 deletions
6
...d/api/src/main/kotlin/io/tolgee/hateoas/key/disabledLanguages/KeyDisabledLanguageModel.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,6 @@ | ||
package io.tolgee.hateoas.key.disabledLanguages | ||
|
||
class KeyDisabledLanguageModel( | ||
val id: Long, | ||
val tag: String, | ||
) |
19 changes: 19 additions & 0 deletions
19
.../api/src/main/kotlin/io/tolgee/hateoas/key/disabledLanguages/KeyDisabledLanguagesModel.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,19 @@ | ||
package io.tolgee.hateoas.key.disabledLanguages | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
import org.springframework.hateoas.RepresentationModel | ||
import org.springframework.hateoas.server.core.Relation | ||
import java.io.Serializable | ||
|
||
@Suppress("unused") | ||
@Relation(collectionRelation = "keys", itemRelation = "key") | ||
open class KeyDisabledLanguagesModel( | ||
@Schema(description = "Id of key record") | ||
val id: Long, | ||
@Schema(description = "Name of key", example = "this_is_super_key") | ||
val name: String, | ||
@Schema(description = "Namespace of key", example = "homepage") | ||
val namespace: String?, | ||
@Schema(description = "Disabled languages") | ||
val disabledLanguages: List<KeyDisabledLanguageModel>, | ||
) : RepresentationModel<KeyDisabledLanguagesModel>(), Serializable |
24 changes: 24 additions & 0 deletions
24
...main/kotlin/io/tolgee/hateoas/key/disabledLanguages/KeyDisabledLanguagesModelAssembler.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,24 @@ | ||
package io.tolgee.hateoas.key.disabledLanguages | ||
|
||
import io.tolgee.dtos.queryResults.keyDisabledLanguages.KeyDisabledLanguagesView | ||
import org.springframework.hateoas.server.RepresentationModelAssembler | ||
import org.springframework.stereotype.Component | ||
|
||
@Component | ||
class KeyDisabledLanguagesModelAssembler : | ||
RepresentationModelAssembler<KeyDisabledLanguagesView, KeyDisabledLanguagesModel> { | ||
override fun toModel(view: KeyDisabledLanguagesView): KeyDisabledLanguagesModel { | ||
return KeyDisabledLanguagesModel( | ||
id = view.id, | ||
name = view.name, | ||
namespace = view.namespace, | ||
disabledLanguages = | ||
view.disabledLanguages.map { | ||
KeyDisabledLanguageModel( | ||
id = it.id, | ||
tag = it.tag, | ||
) | ||
}, | ||
) | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
...n/io/tolgee/dtos/queryResults/keyDisabledLanguages/KeyDisabledLanguagesQueryResultView.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 io.tolgee.dtos.queryResults.keyDisabledLanguages | ||
|
||
class KeyDisabledLanguagesQueryResultView( | ||
val id: Long, | ||
val name: String, | ||
val namespace: String?, | ||
val languageId: Long, | ||
val languageTag: String, | ||
) |
13 changes: 13 additions & 0 deletions
13
.../main/kotlin/io/tolgee/dtos/queryResults/keyDisabledLanguages/KeyDisabledLanguagesView.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,13 @@ | ||
package io.tolgee.dtos.queryResults.keyDisabledLanguages | ||
|
||
class KeyDisabledLanguagesView( | ||
val id: Long, | ||
val name: String, | ||
val namespace: String?, | ||
val disabledLanguages: List<KeyDisabledLanguageModel>, | ||
) { | ||
class KeyDisabledLanguageModel( | ||
val id: Long, | ||
val tag: String, | ||
) | ||
} |
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