-
Notifications
You must be signed in to change notification settings - Fork 0
Backend/controllers added controllers for basic navigation #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5514942
94fc4e6
0422f88
1d98a12
5673775
279f8d8
dbd0689
b07d5dd
7041268
4a97c2c
70024a8
b0573ba
b216e28
892f386
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,77 +1,85 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-parent</artifactId> | ||
| <version>4.0.4</version> | ||
| <relativePath/> <!-- lookup parent from repository --> | ||
| </parent> | ||
| <groupId>team4you</groupId> | ||
| <artifactId>team4you</artifactId> | ||
| <version>0.0.1-SNAPSHOT</version> | ||
| <name>team4you</name> | ||
| <description>team4you</description> | ||
| <url/> | ||
| <licenses> | ||
| <license/> | ||
| </licenses> | ||
| <developers> | ||
| <developer/> | ||
| </developers> | ||
| <scm> | ||
| <connection/> | ||
| <developerConnection/> | ||
| <tag/> | ||
| <url/> | ||
| </scm> | ||
| <properties> | ||
| <java.version>25</java.version> | ||
| </properties> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-webmvc</artifactId> | ||
| </dependency> | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-parent</artifactId> | ||
| <version>4.0.3</version> | ||
| <relativePath/> <!-- lookup parent from repository --> | ||
| </parent> | ||
| <groupId>team4you</groupId> | ||
| <artifactId>team4you</artifactId> | ||
| <version>0.0.1-SNAPSHOT</version> | ||
| <name>team4you</name> | ||
| <description>team4you</description> | ||
| <url/> | ||
| <licenses> | ||
| <license/> | ||
| </licenses> | ||
| <developers> | ||
| <developer/> | ||
| </developers> | ||
| <scm> | ||
| <connection/> | ||
| <developerConnection/> | ||
| <tag/> | ||
| <url/> | ||
| </scm> | ||
| <properties> | ||
| <java.version>25</java.version> | ||
| </properties> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-webmvc</artifactId> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-docker-compose</artifactId> | ||
| <scope>runtime</scope> | ||
| <optional>true</optional> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.postgresql</groupId> | ||
| <artifactId>postgresql</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-webmvc-test</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-flyway</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.flywaydb</groupId> | ||
| <artifactId>flyway-database-postgresql</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-data-jpa</artifactId> | ||
| </dependency> | ||
| </dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-docker-compose</artifactId> | ||
| <scope>runtime</scope> | ||
| <optional>true</optional> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.postgresql</groupId> | ||
| <artifactId>postgresql</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-webmvc-test</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-flyway</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.flywaydb</groupId> | ||
| <artifactId>flyway-database-postgresql</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-data-jpa</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-thymeleaf</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>nz.net.ultraq.thymeleaf</groupId> | ||
| <artifactId>thymeleaf-layout-dialect</artifactId> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-maven-plugin</artifactId> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-maven-plugin</artifactId> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| </project> | ||
| </project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package backendlab.team4you.user; | ||
|
|
||
|
|
||
| import org.springframework.stereotype.Controller; | ||
| import org.springframework.ui.Model; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.List; | ||
|
|
||
| @Controller | ||
| public class UserController { | ||
|
|
||
|
|
||
|
|
||
| @GetMapping("/") | ||
| public String homepage(){ | ||
| return "home"; | ||
| } | ||
|
|
||
|
|
||
| @GetMapping("/booking") | ||
| public String booking(){ | ||
| return "booking"; | ||
| } | ||
|
|
||
| @GetMapping("/application") | ||
| public String application(Model model){ | ||
| List<String> application = Arrays.asList("Ärende #1 - Pågående", "Ärende #15 - Väntar på beslut"); | ||
| model.addAttribute("application", application); | ||
| model.addAttribute("userName", "Test user"); | ||
|
|
||
| return "application"; | ||
| } | ||
|
|
||
| @GetMapping("/profile") | ||
| public String profile(){ | ||
| return "profile"; | ||
| } | ||
|
|
||
| @GetMapping("/admin") | ||
| public String admin(){ | ||
| return "admin"; | ||
| } | ||
|
Comment on lines
+41
to
+44
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify whether /admin is protected globally or by method security.
rg -n -C3 --type=java '@EnableWebSecurity|SecurityFilterChain|HttpSecurity|authorizeHttpRequests|requestMatchers|/admin|@EnableMethodSecurity|@PreAuthorize|@Secured'Repository: ithsjava25/project-backend-team4you Length of output: 628 🏁 Script executed: #!/bin/bash
# Search for security configuration class
fd -name '*SecurityConfig*' -o -name '*Security*Config*' -o -name '*Config*' | grep -i security
# Search for `@PreAuthorize` and `@Secured` annotations in the entire codebase
rg -n --type=java '@PreAuthorize|@Secured|@RoleRequired'
# Check for application configuration files
fd -name 'application*.yml' -o -name 'application*.properties'
# Check the complete UserController class for all annotations
rg -B 20 -A 30 '@GetMapping\("/admin"\)' src/main/java/backendlab/team4you/user/UserController.javaRepository: ithsjava25/project-backend-team4you Length of output: 1242 🏁 Script executed: #!/bin/bash
# Search for security config files with proper syntax
find . -name '*SecurityConfig*' -o -name '*Security*' -o -name '*Config*' 2>/dev/null | head -20
# Search for `@Configuration` and `@EnableWebSecurity` annotations
rg '@Configuration|@EnableWebSecurity' --type=java
# Look for application configuration files
find . -path ./target -prune -o -name 'application*.yml' -o -name 'application*.properties' -print 2>/dev/null
# Check for Spring Security in dependencies
find . -name 'pom.xml' -o -name 'build.gradle' 2>/dev/null | head -5Repository: ithsjava25/project-backend-team4you Length of output: 132 🏁 Script executed: #!/bin/bash
# Check pom.xml for Spring Security dependency
grep -i 'spring-security\|security' pom.xml
# Read application.properties for security config
cat src/main/resources/application.properties
# Search for any `@Configuration` classes
rg '@Configuration' --type=java -A 5
# List all Java files in main source to understand project structure
find src/main/java -name '*.java' -type fRepository: ithsjava25/project-backend-team4you Length of output: 596 🏁 Script executed: #!/bin/bash
# Read the complete pom.xml to verify Spring Security is not included
cat pom.xml
# Search for any custom filters, interceptors, or servlet security mechanisms
rg 'Filter|Interceptor|Authentication|Authorization' --type=java -lRepository: ithsjava25/project-backend-team4you Length of output: 2936 The Spring Security is not configured in this project (no dependency in pom.xml, no 🤖 Prompt for AI Agents |
||
| @GetMapping("/contact") | ||
| public String contact(){ | ||
| return "contact"; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| *{ | ||
| margin:0; | ||
| padding:0; | ||
| box-sizing: border-box; | ||
| font-family: Poppins, sans-serif; | ||
| } | ||
|
|
||
| .container{ | ||
| width:250px; | ||
| height: 100%; | ||
| position:absolute; | ||
| background: #f3f3f3; | ||
| z-index: 1; | ||
| transition: 0.5s; | ||
| } | ||
|
|
||
| .home{ | ||
| padding: 10px; | ||
| } | ||
|
|
||
| .application{ | ||
| padding: 10px; | ||
| } | ||
|
|
||
| .profile{ | ||
| padding: 10px; | ||
| } | ||
| .contact{ | ||
| padding: 10px; | ||
| } | ||
| .logout{ | ||
| padding: 10px; | ||
| } | ||
|
|
||
| .booking{ | ||
| padding: 10px; | ||
| } | ||
|
|
||
| li:hover{ | ||
| color: #6017a8; | ||
| text-decoration: none; | ||
| font-size: 1.2rem; | ||
| font-weight: 500; | ||
| cursor: pointer; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| * { | ||
| box-sizing: border-box; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| body { | ||
|
|
||
| background-color: #f0f2f5; | ||
| font-family: Poppins, sans-serif; | ||
|
Comment on lines
+7
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix Stylelint violation in There is an unexpected empty line before 🧰 Tools🪛 Stylelint (17.5.0)[error] 9-9: Unexpected empty line before declaration (declaration-empty-line-before) (declaration-empty-line-before) 🤖 Prompt for AI Agents |
||
| color: #333; | ||
| line-height: 1.6; | ||
| } | ||
|
|
||
| .container { | ||
| max-width: 800px; | ||
| margin: 40px auto; | ||
| padding: 0 20px; | ||
| } | ||
|
|
||
| .apply-container, | ||
| .waiting-decision, | ||
| .decided-application { | ||
| background-color: #ffffff; | ||
| border: 1px solid #ddd; | ||
| border-radius: 8px; | ||
| padding: 25px; | ||
| margin-bottom: 25px; | ||
| box-shadow: 0 2px 5px rgba(0,0,0,0.05); | ||
| text-align: left; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 1.4rem; | ||
| margin-bottom: 15px; | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 10px; | ||
| color: #1a2b3c; | ||
| } | ||
|
|
||
| .list-unstyled { | ||
| list-style: none; | ||
| } | ||
|
|
||
| .forth-container, .decision-container { | ||
| border: 1px solid #eee; | ||
| padding: 15px; | ||
| border-radius: 6px; | ||
| transition: transform 0.2s; | ||
| margin-top: 10px; | ||
| } | ||
|
|
||
| .forth-container:hover, .decision-container:hover { | ||
| border-color: #38bdf8; | ||
| background-color: #f8fafc; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| .container { | ||
| max-width: 800px; | ||
| margin: 40px auto; | ||
| padding: 0 20px; | ||
| } | ||
|
|
||
| .card { | ||
| background-color: #ffffff; | ||
| border: 1px solid #ddd; | ||
| border-radius: 8px; | ||
| padding: 30px; | ||
| box-shadow: 0 2px 10px rgba(0,0,0,0.1); | ||
| } | ||
|
|
||
|
|
||
| .section-booking, .section-calling { | ||
| margin-top: 20px; | ||
| padding: 20px; | ||
| border-bottom: 1px solid #eee; | ||
| } | ||
|
|
||
| .section-calling { | ||
| border: 1px solid purple; | ||
| } | ||
|
|
||
| .section-booking { | ||
| border: 1px solid purple; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ithsjava25/project-backend-team4you
Length of output: 86
Update Spring Boot version to a valid release.
Spring Boot 4.0.4 does not exist. Maven Central shows the latest version is 3.5.3. Update the parent version in pom.xml to use a valid Spring Boot release (e.g.,
3.5.3or another supported 3.x version) to prevent dependency resolution failures.🤖 Prompt for AI Agents