From 52fabc0336301c7128dc13080205324141e6d8b4 Mon Sep 17 00:00:00 2001 From: Connor <brockcc1@cardiff.ac.uk> Date: Thu, 14 Dec 2023 02:33:03 +0000 Subject: [PATCH] Added database schema integeration with Dragon Tale landmarks to store & access neccessary data associated with all landmarks page. --- .../Team5/SmartTowns/dragonstale/DragonsTale.java | 6 ++++++ src/main/resources/schema.sql | 15 +++++++++++---- src/main/resources/static/css/allTrails.css | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/Team5/SmartTowns/dragonstale/DragonsTale.java b/src/main/java/Team5/SmartTowns/dragonstale/DragonsTale.java index c83257f6..d5eece1e 100644 --- a/src/main/java/Team5/SmartTowns/dragonstale/DragonsTale.java +++ b/src/main/java/Team5/SmartTowns/dragonstale/DragonsTale.java @@ -1,14 +1,20 @@ package Team5.SmartTowns.dragonstale; import Team5.SmartTowns.landmarks.Landmarks; +import lombok.Data; import java.util.List; + +@Data public class DragonsTale { Landmarks landmarks = new Landmarks(); + + //As there were already landmark fields created, I used composition to import them into the class to be used within the file. private int landmarkID = landmarks.getLandmarkID(); private String landmarkName = landmarks.getLandmarkName(); private String landmarkDescription = landmarks.getLandmarkDescription(); + private String getImgPath; 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") diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index 6a2f0ee3..3341d0af 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -14,8 +14,7 @@ DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS stickers; DROP TABLE IF EXISTS packs; DROP TABLE IF EXISTS stickerProgress; - - +DROP TABLE IF EXISTS dragonstale; /****************************************************************/ @@ -40,7 +39,6 @@ create table if not exists locations locationApproved boolean ) engine=InnoDB; - CREATE TABLE IF NOT EXISTS users ( username varchar(30) primary key NOT NULL, id bigint auto_increment unique, /*DEPRECATED COLUMN, LEFT IN WHILE SOME OTHER FUNCTIONS STILL USE IT*/ @@ -72,6 +70,7 @@ CREATE TABLE IF NOT EXISTS stickers ( description text NOT NULL, rarity tinyint ); + CREATE TABLE IF NOT EXISTS stickerProgress ( id bigint auto_increment primary key, username varchar(30) NOT NULL, @@ -101,7 +100,6 @@ create table if not exists locationCoordinates )engine=InnoDB; - drop table if exists townsWithTrails; create table if not exists townsWithTrails ( @@ -116,3 +114,12 @@ create table if not exists townsWithTrails )engine=InnoDB; +CREATE TABLE IF NOT EXISTS dragonstale +( + landmarkID bigint auto_increment primary key, + landmarkName varchar(255), + landmarkDescription varchar(2000), + imgPath varchar(255) + +)engine=InnoDB; + diff --git a/src/main/resources/static/css/allTrails.css b/src/main/resources/static/css/allTrails.css index ab706c5b..9ba8cfac 100644 --- a/src/main/resources/static/css/allTrails.css +++ b/src/main/resources/static/css/allTrails.css @@ -119,6 +119,7 @@ main { } } + #trailFragContent { margin: 0; padding: 0; -- GitLab