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

Added fields into dragonstale database as a test to further integrate QR code...

Added fields into dragonstale database as a test to further integrate QR code checking against URL path. Also added some basic window.open functionality in the JS file.
parent 68051fc4
No related branches found
No related tags found
1 merge request!27Qr codes
......@@ -40,6 +40,6 @@ public class Landmarks {
this.landmarkName = landmarkName;
this.landmarkDescription = landmarkDescription;
this.landmarkLocation = landmarkLocation; }
// ? URl check
}
......@@ -4,14 +4,12 @@ package Team5.SmartTowns.trails;
import Team5.SmartTowns.Landmarks.Landmarks;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import static Team5.SmartTowns.Landmarks.Landmarks.landmarksDragonstrail;
......@@ -46,5 +44,15 @@ public class TrailsController {
return modelAndView;
}
// //
// @GetMapping("dragonstale/{qrCode}/{id}")
// public String qrCodeCheck(@PathVariable Optional<String> qrCode, @PathVariable Optional<Integer> id){
// if (qrCode.isPresent() && id.isPresent()){
// //Check if ID is present, if do this, if not dfo that.
//
// }
// }
}
......@@ -54,4 +54,7 @@ insert into badgeprogress (userID, badgeID, progress) value ('2', '2', '70');
delete from stickerprogress;
insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '1', true);
insert into stickerprogress (userID, stickerID, hasSticker) value ('1', '3', true);
insert into stickerprogress (userID, stickerID, hasSticker) value ('2', '2', true);
\ No newline at end of file
insert into stickerprogress (userID, stickerID, hasSticker) value ('2', '2', true);
insert into dragonstale (landmarkID, landmarkName, landmarkDescription) value (1, 'A scent of...Dragon', 'The Dragon has been spotted near by, find the QR code to continue');
insert into dragonstale (landmarkID, landmarkName, landmarkDescription) value (2, 'They''ve been found!', 'Don''t let them escape, find the next QR code to continue!');
\ No newline at end of file
src/main/resources/static/images/QRAllTrails.png

46.3 KiB

......@@ -14,6 +14,8 @@
</head>
<body>
<header th:insert="towns/Templating.html :: header"></header>
<div class="container">
<h1>Scan location QR code</h1>
<div class="section">
......@@ -21,5 +23,7 @@
</div>
</div>
</div>
<div th:insert="towns/Templating.html :: footer"></div>
</body>
</html>
......@@ -15,6 +15,7 @@ domReady(function (message){
function onScanSuccess(decodeText, decodeResult){
alert("You have collected: " + decodeText, decodeResult);
// Open the result, what methods are available through the HTML5 Qr scanner node package?
window.open(decodeText);
// Record the result, see above.
// Get user and tie to user account, intergrate with database, retrieving and storing under user info.
}
......
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