diff options
Diffstat (limited to 'src/main/kotlin/dev')
| -rw-r--r-- | src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt | 6 | ||||
| -rw-r--r-- | src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt | 41 |
2 files changed, 46 insertions, 1 deletions
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt b/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt index 26de550..2a9dc5b 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/services/TransformationService.kt @@ -51,9 +51,13 @@ class TransformationService(private val objectMapper: ObjectMapper, private val return objectMapper.readValue(json, MtbFile::class.java) } + fun getTransformations(): List<Transformation> { + return this.transformations + } + } -class Transformation private constructor(internal val path: String) { +class Transformation private constructor(val path: String) { lateinit var existingValue: Any private set diff --git a/src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt b/src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt new file mode 100644 index 0000000..f811e9e --- /dev/null +++ b/src/main/kotlin/dev/dnpm/etl/processor/web/TransformationController.kt @@ -0,0 +1,41 @@ +/* + * This file is part of ETL-Processor + * + * Copyright (c) 2023 Comprehensive Cancer Center Mainfranken, Datenintegrationszentrum Philipps-Universität Marburg and Contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package dev.dnpm.etl.processor.web + +import dev.dnpm.etl.processor.services.TransformationService +import org.springframework.stereotype.Controller +import org.springframework.ui.Model +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping + +@Controller +@RequestMapping(path = ["transformations"]) +class TransformationController( + private val transformationService: TransformationService +) { + + @GetMapping + fun index(model: Model): String { + model.addAttribute("transformations", transformationService.getTransformations()) + + return "transformations" + } + +}
\ No newline at end of file |
