Skip to content
Snippets Groups Projects
Commit 4d792c5d authored by Rhys Evans's avatar Rhys Evans
Browse files

Further work on town mapping

parent f8c5598f
No related branches found
No related tags found
1 merge request!34Resolve "As a user, I would like a town specific page which shows all trails for that town so that I can easily see my progress"
package Team5.SmartTowns.Data;public class Town {
}
package Team5.SmartTowns.Data;public class TownRepository {
}
package Team5.SmartTowns.Data;public class TownRepositoryJDBC {
}
package Team5.SmartTowns.Towns;
import Team5.SmartTowns.Landmarks.Landmarks;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
......@@ -18,4 +19,13 @@ public class TownController {
return modelAndView;
}
// @GetMapping("/home/town")
// public ModelAndView getATownTrailsList(){
// ModelAndView modelAndView = new ModelAndView("userTrails/userTrailsTemplate");
// modelAndView.addObject("townStuff", a);
// return modelAndView;
// }
//
}
......@@ -5,6 +5,10 @@ insert into users (userID, email, name, dragonProgress) value ('2', 'nigel@gmail
delete from trails;
insert into trails ( Name) value ( 'Caerphilly Coffee Trail');
insert into trails ( Name) value ( 'Penarth Dragon Trail');
delete from towns;
insert into towns ( townName,townTrailNumber) value ( 'Caerphilly',03);
insert into towns ( townName,townTrailNumber) value ( 'Risca',01);
insert into towns ( townName,townTrailNumber) value ( 'Penarth',01);
delete from locations;
insert into locations ( locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ( 'St Cenydd','','Location description here','Caerphilly',0101);
......
......@@ -5,6 +5,15 @@ create table if not exists trails
name varchar(128)
) engine=InnoDB;
drop table if exists towns;
create table if not exists towns
(
townID bigint auto_increment primary key,
townName varchar(255),
trailNumber tinyint
) engine=InnoDB;
drop table if exists locations;
create table if not exists locations
......@@ -13,8 +22,9 @@ create table if not exists locations
locationName varchar(128),
locationEmail varchar(128),
locationDescription longtext,
locationPlace varchar(255),
locationTrailID varchar(128)
locationPlace bigint,
locationTrailID varchar(128),
foreign key (locationPlace) references towns(townID)
) engine=InnoDB;
drop table if exists users;
......@@ -57,4 +67,5 @@ create table if not exists stickerProgress
userID bigint,
stickerID bigint,
hasSticker boolean /*Has sticker or not*/
) engine=InnoDB;
\ No newline at end of file
) engine=InnoDB;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Trails</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
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