From 42b5fecbaa9a6dd74cb36bf82d3ffdadde2dbfbd Mon Sep 17 00:00:00 2001 From: mlabusch Date: Fri, 19 May 2017 11:12:17 +0200 Subject: [PATCH] [Task]: Add to documentation --- changes_to_monolith/HomepageController.java | 10 +++--- changes_to_monolith/product.html | 2 +- changes_to_monolith/stockadmin.html | 32 ------------------- .../microservice_stock/chapter/Struktur.tex | 28 ++++++++++------ 4 files changed, 23 insertions(+), 49 deletions(-) delete mode 100644 changes_to_monolith/stockadmin.html diff --git a/changes_to_monolith/HomepageController.java b/changes_to_monolith/HomepageController.java index c3b231c..19d0aea 100644 --- a/changes_to_monolith/HomepageController.java +++ b/changes_to_monolith/HomepageController.java @@ -17,20 +17,18 @@ public class HomepageController { @Autowired private ShopService shopService; - private final String STOCKADMINFRONTENDTEMPLATE = "admin"; - - + private final String STOCKADMINFRONTENDTEMPLATE = "https://stock.pub.warehost.de/index.html"; /** * Redirect * * @param model Template model - * @return The constant template name fpr the stock admin frontend. + * @return The constant template name for the stock admin frontend. */ @RequestMapping(value = "/stockadmin", method = RequestMethod.GET) - public String redirect(Model model) { - return this.STOCKADMINFRONTENDTEMPLATE; + public String redirect(Model model) {return "redirect:"+ this.STOCKADMINFRONTENDTEMPLATE; } + /** * Homepage * diff --git a/changes_to_monolith/product.html b/changes_to_monolith/product.html index 39523b2..82cbed1 100644 --- a/changes_to_monolith/product.html +++ b/changes_to_monolith/product.html @@ -31,7 +31,7 @@

Product Name

- +

0,00 Euro

Description.

diff --git a/changes_to_monolith/stockadmin.html b/changes_to_monolith/stockadmin.html deleted file mode 100644 index f80b4b6..0000000 --- a/changes_to_monolith/stockadmin.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - -
-
- -
-
- - - - - - \ No newline at end of file diff --git a/documentation/microservice_stock/chapter/Struktur.tex b/documentation/microservice_stock/chapter/Struktur.tex index 95c6c2d..82aae5c 100644 --- a/documentation/microservice_stock/chapter/Struktur.tex +++ b/documentation/microservice_stock/chapter/Struktur.tex @@ -145,19 +145,27 @@ Neben bisherigen Packages, die bereits Whitebox-Tests umfassen, ist in dem Packa \label{subsec: Anpassung des Monolithen} Damit der Microservice Warenwirtschaft durch den bestehenden Monolithen des Webshops Mosh genutzt werden kann, wurden hier dir nachfolgend aufgeführten Änderungen vorgenommen. Zunächst wurde für den Aufruf des Admin-Frontends über die URL des Monolithen \texttt{/stockadmin} das nachfolgende Mapping in der Java-Datei \texttt{HomepageController.java} ergänzt. -\begin{lstlisting}[caption=Datenabfrage von der Bestellung (Waren wurden bestellt), language=Java] +\begin{lstlisting}[caption=Anpassung in HomepageController.java, language=Java] +private final String STOCKADMINFRONTENDTEMPLATE = "https://stock.pub.warehost.de/index.html"; + @RequestMapping(value = "/stockadmin", method = RequestMethod.GET) -public String redirect(Model model) { - return this.STOCKADMINFRONTENDTEMPLATE; + public String redirect(Model model) {return "redirect:"+ this.STOCKADMINFRONTENDTEMPLATE; +} } \end{lstlisting} -Weiter wurde eine HTML-Datei \texttt{stockadmin.html} zu den statischen Webseiteninhalten des Monolithen hinzugefügt. Diese leitet, wie nachfolgend dargestellt, durch einen Meta-Eintrag direkt auf die Webseite des Microservice Warenwirtschaft weiter. Für den Fall, dass die Umleitung durch den verwendeten Browser nicht unterstützt wird, wurde zudem ein Link auf die Webseite des Microservice integriert. +Weiter wurde die Ampeldarstellung der Verfügbarkeit unter \texttt{products.html} eingefügt. Hierfür wurde das \texttt{ProductDTO.java} um die Rückgabe der Produkt-ID erweitert. + +\begin{lstlisting}[caption=Anpassung products.html, language=HTML] + -\begin{lstlisting}[caption=Datenabfrage von der Bestellung (Waren wurden bestellt), language=HTML] - - - - [...] - \end{lstlisting} + + + +\begin{lstlisting}[caption=Anpassung ProductDTO.java, language=Java] + + +\end{lstlisting} + +