Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
VincentRamiere | d69fb2a5c2 | |
Your Name | 254517f379 |
|
@ -1 +1 @@
|
|||
rootProject.name = 'simpleat'
|
||||
rootProject.name = 'simpleat-back'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat;
|
||||
package fr.vincentRamiere.simpleatBack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -8,10 +8,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
||||
import fr.cardon.simpleat.exception.ExistingUsernameException;
|
||||
import fr.cardon.simpleat.model.EnumRole;
|
||||
import fr.cardon.simpleat.model.Personne;
|
||||
import fr.cardon.simpleat.service.PersonneService;
|
||||
import fr.vincentRamiere.simpleatBack.exception.ExistingUsernameException;
|
||||
import fr.vincentRamiere.simpleatBack.model.EnumRole;
|
||||
import fr.vincentRamiere.simpleatBack.model.Personne;
|
||||
import fr.vincentRamiere.simpleatBack.service.PersonneService;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SimpleatApplication {
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.controller;
|
||||
package fr.vincentRamiere.simpleatBack.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
@ -17,12 +17,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import fr.cardon.simpleat.dto.JsonWebToken;
|
||||
import fr.cardon.simpleat.exception.ExistingUsernameException;
|
||||
import fr.cardon.simpleat.exception.InvalidCredentialsException;
|
||||
import fr.cardon.simpleat.model.Personne;
|
||||
import fr.cardon.simpleat.repository.PersonneRepository;
|
||||
import fr.cardon.simpleat.service.PersonneService;
|
||||
import fr.vincentRamiere.simpleatBack.dto.JsonWebToken;
|
||||
import fr.vincentRamiere.simpleatBack.exception.ExistingUsernameException;
|
||||
import fr.vincentRamiere.simpleatBack.exception.InvalidCredentialsException;
|
||||
import fr.vincentRamiere.simpleatBack.model.Personne;
|
||||
import fr.vincentRamiere.simpleatBack.repository.PersonneRepository;
|
||||
import fr.vincentRamiere.simpleatBack.service.PersonneService;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin("http://localhost:4200")
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.controller;
|
||||
package fr.vincentRamiere.simpleatBack.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
|
@ -15,11 +15,11 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import fr.cardon.simpleat.model.Preference;
|
||||
import fr.cardon.simpleat.model.PreferencePK;
|
||||
import fr.cardon.simpleat.repository.PersonneRepository;
|
||||
import fr.cardon.simpleat.repository.PreferenceRepository;
|
||||
import fr.cardon.simpleat.repository.RestaurantRepository;
|
||||
import fr.vincentRamiere.simpleatBack.model.Preference;
|
||||
import fr.vincentRamiere.simpleatBack.model.PreferencePK;
|
||||
import fr.vincentRamiere.simpleatBack.repository.PersonneRepository;
|
||||
import fr.vincentRamiere.simpleatBack.repository.PreferenceRepository;
|
||||
import fr.vincentRamiere.simpleatBack.repository.RestaurantRepository;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin("*")
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.controller;
|
||||
package fr.vincentRamiere.simpleatBack.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
@ -15,8 +15,8 @@ import org.springframework.web.bind.annotation.PutMapping;
|
|||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import fr.cardon.simpleat.model.Restaurant;
|
||||
import fr.cardon.simpleat.repository.RestaurantRepository;
|
||||
import fr.vincentRamiere.simpleatBack.model.Restaurant;
|
||||
import fr.vincentRamiere.simpleatBack.repository.RestaurantRepository;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin("*")
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.controller;
|
||||
package fr.vincentRamiere.simpleatBack.controller;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -17,9 +17,9 @@ import org.springframework.web.bind.annotation.PutMapping;
|
|||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import fr.cardon.simpleat.model.Restaurant;
|
||||
import fr.cardon.simpleat.model.TypeRestau;
|
||||
import fr.cardon.simpleat.repository.TypeRestauRepository;
|
||||
import fr.vincentRamiere.simpleatBack.model.Restaurant;
|
||||
import fr.vincentRamiere.simpleatBack.model.TypeRestau;
|
||||
import fr.vincentRamiere.simpleatBack.repository.TypeRestauRepository;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin("*")
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.dto;
|
||||
package fr.vincentRamiere.simpleatBack.dto;
|
||||
|
||||
/**
|
||||
* Classe spécifique DTO (Data Transfer Object) qui retourne un Jeton au format JSON (REST response)
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.dto;
|
||||
package fr.vincentRamiere.simpleatBack.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.exception;
|
||||
package fr.vincentRamiere.simpleatBack.exception;
|
||||
|
||||
/**
|
||||
* Classe personnalisée pour gérer un message si l'utilisateur (User) existe en Base de données
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.exception;
|
||||
package fr.vincentRamiere.simpleatBack.exception;
|
||||
|
||||
/**
|
||||
* Specific exception that should be thrown when user credentials are not valid.
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.exception;
|
||||
package fr.vincentRamiere.simpleatBack.exception;
|
||||
|
||||
/**
|
||||
* Specific exception that should be thrown when a JWT has an invalid format.
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.EmbeddedId;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.EmbeddedId;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.model;
|
||||
package fr.vincentRamiere.simpleatBack.model;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package fr.cardon.simpleat.repository;
|
||||
package fr.vincentRamiere.simpleatBack.repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import fr.cardon.simpleat.model.Personne;
|
||||
import fr.vincentRamiere.simpleatBack.model.Personne;
|
||||
|
||||
@Repository
|
||||
public interface PersonneRepository extends JpaRepository<Personne, Integer> {
|
|
@ -1,10 +1,10 @@
|
|||
package fr.cardon.simpleat.repository;
|
||||
package fr.vincentRamiere.simpleatBack.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import fr.cardon.simpleat.model.Preference;
|
||||
import fr.cardon.simpleat.model.PreferencePK;
|
||||
import fr.vincentRamiere.simpleatBack.model.Preference;
|
||||
import fr.vincentRamiere.simpleatBack.model.PreferencePK;
|
||||
|
||||
@Repository
|
||||
public interface PreferenceRepository extends JpaRepository<Preference, PreferencePK> {
|
|
@ -1,10 +1,10 @@
|
|||
package fr.cardon.simpleat.repository;
|
||||
package fr.vincentRamiere.simpleatBack.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import fr.cardon.simpleat.model.Reservation;
|
||||
import fr.cardon.simpleat.model.ReservationPK;
|
||||
import fr.vincentRamiere.simpleatBack.model.Reservation;
|
||||
import fr.vincentRamiere.simpleatBack.model.ReservationPK;
|
||||
|
||||
@Repository
|
||||
public interface ReservationRepository extends JpaRepository<Reservation, ReservationPK> {
|
|
@ -1,9 +1,9 @@
|
|||
package fr.cardon.simpleat.repository;
|
||||
package fr.vincentRamiere.simpleatBack.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import fr.cardon.simpleat.model.Restaurant;
|
||||
import fr.vincentRamiere.simpleatBack.model.Restaurant;
|
||||
|
||||
@Repository
|
||||
public interface RestaurantRepository extends JpaRepository<Restaurant, Integer> {
|
|
@ -1,9 +1,9 @@
|
|||
package fr.cardon.simpleat.repository;
|
||||
package fr.vincentRamiere.simpleatBack.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import fr.cardon.simpleat.model.TypeRestau;
|
||||
import fr.vincentRamiere.simpleatBack.model.TypeRestau;
|
||||
|
||||
@Repository
|
||||
public interface TypeRestauRepository extends JpaRepository<TypeRestau, Integer> {
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.security;
|
||||
package fr.vincentRamiere.simpleatBack.security;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.security.core.Authentication;
|
|||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import fr.cardon.simpleat.exception.InvalidJWTException;
|
||||
import fr.vincentRamiere.simpleatBack.exception.InvalidJWTException;
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.security;
|
||||
package fr.vincentRamiere.simpleatBack.security;
|
||||
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
|
@ -20,9 +20,9 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
||||
import fr.cardon.simpleat.exception.InvalidJWTException;
|
||||
import fr.cardon.simpleat.model.EnumRole;
|
||||
import fr.cardon.simpleat.repository.PersonneRepository;
|
||||
import fr.vincentRamiere.simpleatBack.exception.InvalidJWTException;
|
||||
import fr.vincentRamiere.simpleatBack.model.EnumRole;
|
||||
import fr.vincentRamiere.simpleatBack.repository.PersonneRepository;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.JwtException;
|
||||
import io.jsonwebtoken.Jwts;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.security;
|
||||
package fr.vincentRamiere.simpleatBack.security;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
|
@ -1,13 +1,13 @@
|
|||
package fr.cardon.simpleat.service;
|
||||
package fr.vincentRamiere.simpleatBack.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import fr.cardon.simpleat.exception.ExistingUsernameException;
|
||||
import fr.cardon.simpleat.exception.InvalidCredentialsException;
|
||||
import fr.cardon.simpleat.model.Personne;
|
||||
import fr.vincentRamiere.simpleatBack.exception.ExistingUsernameException;
|
||||
import fr.vincentRamiere.simpleatBack.exception.InvalidCredentialsException;
|
||||
import fr.vincentRamiere.simpleatBack.model.Personne;
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.service;
|
||||
package fr.vincentRamiere.simpleatBack.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -11,13 +11,11 @@ import org.springframework.security.core.AuthenticationException;
|
|||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
|
||||
import fr.cardon.simpleat.exception.ExistingUsernameException;
|
||||
import fr.cardon.simpleat.exception.InvalidCredentialsException;
|
||||
import fr.cardon.simpleat.model.Personne;
|
||||
import fr.cardon.simpleat.repository.PersonneRepository;
|
||||
import fr.cardon.simpleat.security.JwtTokenProvider;
|
||||
import fr.vincentRamiere.simpleatBack.exception.ExistingUsernameException;
|
||||
import fr.vincentRamiere.simpleatBack.exception.InvalidCredentialsException;
|
||||
import fr.vincentRamiere.simpleatBack.model.Personne;
|
||||
import fr.vincentRamiere.simpleatBack.repository.PersonneRepository;
|
||||
import fr.vincentRamiere.simpleatBack.security.JwtTokenProvider;
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.cardon.simpleat.service;
|
||||
package fr.vincentRamiere.simpleatBack.service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -10,9 +10,8 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
|||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import fr.cardon.simpleat.model.Personne;
|
||||
|
||||
import fr.cardon.simpleat.repository.PersonneRepository;
|
||||
import fr.vincentRamiere.simpleatBack.model.Personne;
|
||||
import fr.vincentRamiere.simpleatBack.repository.PersonneRepository;
|
||||
|
||||
|
||||
@Service
|
|
@ -6,9 +6,9 @@ spring.main.allow-circular-references=true
|
|||
# ===============================
|
||||
# base de données MySQL
|
||||
# ===============================
|
||||
spring.datasource.url=jdbc:mysql://localhost:3308/simpleat?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=CET
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/simpleat?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=CET
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
spring.datasource.password=bbLouis1+Noe2
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
# log
|
||||
#logging.level.root=INFO
|
||||
|
@ -19,10 +19,11 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
|||
# ===============================
|
||||
spring.jpa.show-sql=true
|
||||
##spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.hibernate.ddl-auto=create-drop
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
# ===============================
|
||||
# Permet d'exécuter le data.sql
|
||||
# ===============================
|
||||
spring.sql.init.mode=always
|
||||
# spring.sql.init.mode=always
|
||||
spring.jpa.defer-datasource-initialization=true
|
||||
server.port=8081
|
Loading…
Reference in New Issue