Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team 5 - Smart Towns
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rhys Evans
Team 5 - Smart Towns
Merge requests
!16
Ready to merge - Database
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Ready to merge - Database
database
into
main
Overview
4
Commits
16
Pipelines
0
Changes
26
Merged
Rhys Nute
requested to merge
database
into
main
1 year ago
Overview
2
Commits
16
Pipelines
0
Changes
26
Expand
closes
#30 (closed)
Edited
1 year ago
by
Rhys Evans
0
0
Merge request reports
Compare
main
version 13
15f288c0
1 year ago
version 12
1e184fbc
1 year ago
version 11
49efe83d
1 year ago
version 10
e9129acb
1 year ago
version 9
264db9d2
1 year ago
version 8
a1bd0569
1 year ago
version 7
bacc9723
1 year ago
version 6
f9265540
1 year ago
version 5
e63d275a
1 year ago
version 4
3d96591a
1 year ago
version 3
56c33c55
1 year ago
version 2
5296b67e
1 year ago
version 1
8a04aee4
1 year ago
main (base)
and
latest version
latest version
3d3cc9dc
16 commits,
1 year ago
version 13
15f288c0
15 commits,
1 year ago
version 12
1e184fbc
14 commits,
1 year ago
version 11
49efe83d
13 commits,
1 year ago
version 10
e9129acb
12 commits,
1 year ago
version 9
264db9d2
11 commits,
1 year ago
version 8
a1bd0569
10 commits,
1 year ago
version 7
bacc9723
9 commits,
1 year ago
version 6
f9265540
8 commits,
1 year ago
version 5
e63d275a
7 commits,
1 year ago
version 4
3d96591a
6 commits,
1 year ago
version 3
56c33c55
5 commits,
1 year ago
version 2
5296b67e
4 commits,
1 year ago
version 1
8a04aee4
3 commits,
1 year ago
26 files
+
442
−
2
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
26
Search (e.g. *.vue) (Ctrl+P)
src/main/java/Team5/SmartTowns/Data/DatabaseController.java
0 → 100644
+
40
−
0
Options
package
Team5.SmartTowns.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.servlet.ModelAndView
;
import
java.util.*
;
@Controller
public
class
DatabaseController
{
@Autowired
private
UserRepository
userRepository
;
@Autowired
private
locationRepository
locationRepository
;
@Autowired
private
trailsRepository
trailsRepository
;
@GetMapping
(
"/userList"
)
public
ModelAndView
userList
()
{
ModelAndView
mav
=
new
ModelAndView
(
"towns/userData"
);
List
<
user
>
users
=
userRepository
.
getAllUsers
();
mav
.
addObject
(
"users"
,
users
);
return
mav
;
}
@GetMapping
(
"/trailList"
)
public
ModelAndView
trailList
()
{
ModelAndView
mav1
=
new
ModelAndView
(
"towns/trailsData"
);
List
<
trail
>
trail
=
trailsRepository
.
getAllTrails
();
mav1
.
addObject
(
"trails"
,
trail
);
return
mav1
;
}
@GetMapping
(
"locationList"
)
public
ModelAndView
locationList
(){
ModelAndView
mav2
=
new
ModelAndView
(
"towns/locationData"
);
List
<
location
>
locations
=
locationRepository
.
getAllLocation
();
mav2
.
addObject
(
"location"
,
locations
);
return
mav2
;
}
}
Loading