From 9d5672cdcf06054df77af702f270d15cb0f1bbef Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Tue, 21 Feb 2023 18:22:41 +0400 Subject: [PATCH] #91 -- Add markup page --- .../TimeSeriesMarkupController.java | 27 +++++++++++++++++++ src/main/resources/templates/markup.html | 24 +++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/main/java/ru/ulstu/extractor/ts/controller/TimeSeriesMarkupController.java create mode 100644 src/main/resources/templates/markup.html diff --git a/src/main/java/ru/ulstu/extractor/ts/controller/TimeSeriesMarkupController.java b/src/main/java/ru/ulstu/extractor/ts/controller/TimeSeriesMarkupController.java new file mode 100644 index 0000000..5caad5c --- /dev/null +++ b/src/main/java/ru/ulstu/extractor/ts/controller/TimeSeriesMarkupController.java @@ -0,0 +1,27 @@ +package ru.ulstu.extractor.ts.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import ru.ulstu.extractor.ts.model.TimeSeries; +import ru.ulstu.extractor.ts.service.TimeSeriesService; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; + +@Controller +@ApiIgnore +public class TimeSeriesMarkupController { + private final TimeSeriesService timeSeriesService; + + public TimeSeriesMarkupController(TimeSeriesService timeSeriesService) { + this.timeSeriesService = timeSeriesService; + } + + @GetMapping("time-series-markup") + public String markupTs(Model model) { + List ts = timeSeriesService.getAllTimeSeries(); + model.addAttribute("ts", ts); + return "markup"; + } +} diff --git a/src/main/resources/templates/markup.html b/src/main/resources/templates/markup.html new file mode 100644 index 0000000..329d010 --- /dev/null +++ b/src/main/resources/templates/markup.html @@ -0,0 +1,24 @@ + + + + Простая обработка формы на Spring MVC + + +
+ + + + + + + + + + + + +
Разметка временных рядов
+
+