Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
209 changes: 167 additions & 42 deletions SSProject/pom.xml
Original file line number Diff line number Diff line change
@@ -1,68 +1,193 @@
<?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>
<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>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.7.3
</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>spring-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot</name>
<description>Demo project for Spring Boot</description>
<groupId>
com.example
</groupId>
<artifactId>
spring-boot
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<name>
spring-boot
</name>
<description>
Demo project for Spring Boot
</description>
<properties>
<java.version>17</java.version>
<java.version>
17
</java.version>
</properties>
<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<scope>
runtime
</scope>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<exclusions>
<exclusion>
<groupId>
org.junit.vintage
</groupId>
<artifactId>
junit-vintage-engine
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<groupId>
org.springframework.security
</groupId>
<artifactId>
spring-security-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>9.0.65</version>
<groupId>
org.webjars
</groupId>
<artifactId>
jquery
</artifactId>
<version>
3.4.1
</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<groupId>
org.webjars
</groupId>
<artifactId>
bootstrap
</artifactId>
<version>
4.3.1
</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.7-1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>
org.webjars
</groupId>
<artifactId>
webjars-locator-core
</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<groupId>
org.apache.tomcat
</groupId>
<artifactId>
tomcat-jasper
</artifactId>
<version>
9.0.65
</version>
</dependency>
</dependencies>


</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>

</project>
3 changes: 2 additions & 1 deletion SSProject/src/main/java/com/catalyst/funds/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ public static void main(String[] args) {
}


}
}
//same
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package com.catalyst.funds.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.Ordered;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
Expand All @@ -12,13 +19,50 @@
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import com.catalyst.funds.entity.UserEntity;
import com.catalyst.funds.repositry.UserAuthRepositry;
import com.catalyst.funds.repositry.UserRepositry;


@Controller
@EnableWebMvc
public class WebController extends WebMvcConfigurerAdapter {


@Autowired
private UserRepositry userRepo;

@GetMapping("")
public String viewHomePage() {
return "index";
}

@GetMapping("/register")
public String showRegistrationForm(Model model) {
model.addAttribute("user", new UserEntity());

return "signup_form";
}

@PostMapping("/process_register")
public String processRegister(UserEntity user) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
String encodedPassword = passwordEncoder.encode(user.getPassword());
user.setPassword(encodedPassword);

userRepo.save(user);

return "register_success";
}

@RequestMapping("/")
@GetMapping("/users")
public String listUsers(Model model) {
Iterable<UserEntity> listUsers = userRepo.findAll();
model.addAttribute("listUsers", listUsers);

return "users";
}

@RequestMapping("/userhome")
public String index(){
return "webpage.html";
}
Expand All @@ -34,7 +78,7 @@ public String loignerror() {
public String signup() {
return "signup.html";
}
@RequestMapping("/addteam")
@RequestMapping("/createteam")
public String addteam() {
return "teamadd.html";
}
Expand All @@ -50,7 +94,10 @@ public String admin() {
public String modifyteam() {
return "modifyteam.html";
}

@RequestMapping("/about")
public String about() {
return "about.html";
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
Expand All @@ -18,13 +19,13 @@ public class UserEntity {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer userId;

@Column(nullable = false, unique = true, length = 45)
private String userName;

@Column(nullable = false, length = 45)
private String email;

@Column(nullable = false, length = 10)
private Long phoneNo;

@Column(nullable = false, length = 64)
private String password;

private String role;
Expand Down Expand Up @@ -103,4 +104,6 @@ public void setPassword(String password) {
}


}
}

//same
Loading