Skip to content
Snippets Groups Projects
Commit 3c1e9ee9 authored by Connor Brock's avatar Connor Brock
Browse files

Moved DragonsTale into its own package to as many methods used by this web...

Moved DragonsTale into its own package to as many methods used by this web section were scattered around various other classes.
parent 70891095
No related branches found
No related tags found
1 merge request!41Resolve "As a convenience enthusiast, I want a drop down menu to be able to quickly scan QR codes I find along my dragon trail so that I may continue on my adventure without disruption."
package Team5.SmartTowns.dragonstale;
import Team5.SmartTowns.landmarks.Landmarks;
import java.util.List;
public class DragonsTale {
public static List<Landmarks> landmarksDragonstrail = List.of(
new Landmarks( 1, "A scent of...Dragon", "The Dragon has been spotted near by, find the QR code to continue" , "Start your discovery, at the sweet shop."),
new Landmarks( 2, "They've been found!", "Don't let them escape, find the next QR code to continue!", "Location test")
);
public static List<Landmarks> getLandmarksDragonstrail() {
return landmarksDragonstrail;
}
}
package Team5.SmartTowns.dragonstale;
import Team5.SmartTowns.landmarks.Landmarks;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
import static Team5.SmartTowns.dragonstale.DragonsTale.landmarksDragonstrail;
public class DragonsTaleController {
@GetMapping("/dragonstale")
public ModelAndView getDragonsTale(){
List<Landmarks> landmarksList = landmarksDragonstrail;
ModelAndView modelAndView = new ModelAndView("/dragonstale/index");
modelAndView.addObject("landmarksList", landmarksList);
return modelAndView;
}
//
// @GetMapping("dragonstale/{qrCode}/{id}")
// public String qrCodeCheck(@PathVariable Optional<String> qrCode, @PathVariable Optional<Integer> id){
// if (qrCode.isPresent()){
//
// //Check if ID is present, if do this, if not dfo that.
//
// }
// }
}
......@@ -12,14 +12,6 @@ import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
public class Landmarks {
// Initialized object to getID from trail.
//Predefined Landmark for Dragons Tale.
public static List<Landmarks> landmarksDragonstrail = List.of(
new Landmarks( 1, "A scent of...Dragon", "The Dragon has been spotted near by, find the QR code to continue" , "Start your discovery, at the sweet shop."),
new Landmarks( 2, "They've been found!", "Don't let them escape, find the next QR code to continue!", "Location test")
);
private Integer trailID;
private int landmarkID;
@NotEmpty(message = "You must type in a username.")
......@@ -31,9 +23,6 @@ public class Landmarks {
private String landmarkLocation;
private String landmarkPicture;
public static List<Landmarks> getLandmarksDragonstrail() {
return landmarksDragonstrail;
}
// Constructor for List above.
public Landmarks( int landmarkID, String landmarkName, String landmarkDescription, String landmarkLocation) {
......
......@@ -11,8 +11,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import static Team5.SmartTowns.landmarks.Landmarks.landmarksDragonstrail;
//import static Team5.SmartTowns.Landmarks.Landmarks.landmarksDragonstrail;
@Controller
......@@ -38,24 +36,5 @@ public class TrailsController {
return mv;
}
@GetMapping("/dragonstale")
public ModelAndView getDragonsTale(){
List<Landmarks> landmarksList = landmarksDragonstrail;
ModelAndView modelAndView = new ModelAndView("towns/trails/dragonstale/index");
modelAndView.addObject("landmarksList", landmarksList);
return modelAndView;
}
//
// @GetMapping("dragonstale/{qrCode}/{id}")
// public String qrCodeCheck(@PathVariable Optional<String> qrCode, @PathVariable Optional<Integer> id){
// if (qrCode.isPresent()){
//
// //Check if ID is present, if do this, if not dfo that.
//
// }
// }
}
......@@ -5,7 +5,7 @@
<title>A Dragon's Tale</title>
<link rel="stylesheet" th:href="@{/css/dragonstaless.css}">
<link rel="stylesheet" th:href="@{/css/templatingstyle.css}">
<script src="./node_modules/html5-qrcode/html5-qrcode.min.js"></script>
<!-- <script defer src="../../static/scripts/DTscript.js"></script>-->
</head>
<body>
<header th:insert="fragments/Templating.html :: header"></header>
......@@ -31,6 +31,7 @@
<ul th:each="item : ${landmarksList}" id="tabBox">
<li>
<a id="tabIdCounter" href="#landmarkTabLink" th:text="${item.landmarkName}"> Landmark Tab</a>
<!-- <button id="qrcodescanner">Click here to scan a QR code for <span th:text="${item.landmarkName}">Landmark Name Here</span></button>-->
</li>
</ul>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment