Compare commits

..

11 Commits

Author SHA1 Message Date
Vincent Ramiere
165965a391 Merge branch 'main' into Vincent
Merge main
2022-03-13 19:39:35 +01:00
Vincent Ramiere
5cbd384954 settings gradle 2022-03-13 19:37:45 +01:00
Vincent Ramiere
0ceae0c0bf Merge branch 'dev' into Vincent
Fin Dev
2022-03-11 14:53:40 +01:00
Vincent Ramiere
475587d541 Merge branch 'dev' into Vincent
04/03/2022
2022-03-04 15:34:13 +01:00
Vincent Ramiere
2795468f61 modif data.sql 2022-03-04 15:33:13 +01:00
Vincent Ramiere
25551e5163 modif data.sql 2022-03-04 14:35:06 +01:00
Vincent Ramiere
6477f7e4a5 maj dataSql pour personnes et restaus 2022-02-17 09:44:19 +01:00
Vincent Ramiere
d88b34c774 Merge branch 'dev' into Vincent
OK
2022-02-17 09:32:10 +01:00
Vincent Ramiere
eadca672ba Merge branch 'dev' into Vincent
valid
2022-02-14 17:40:24 +01:00
Vincent Ramiere
44af1869a7 Merge branch 'dev' into Vincent
Merge dev sur vincent
2022-01-21 15:03:21 +01:00
Vincent Ramiere
69feb6d378 maj branche Vincent 2022-01-19 15:52:18 +01:00
30 changed files with 78 additions and 76 deletions

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack;
package fr.cardon.simpleat;
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.vincentRamiere.simpleatBack.exception.ExistingUsernameException;
import fr.vincentRamiere.simpleatBack.model.EnumRole;
import fr.vincentRamiere.simpleatBack.model.Personne;
import fr.vincentRamiere.simpleatBack.service.PersonneService;
import fr.cardon.simpleat.exception.ExistingUsernameException;
import fr.cardon.simpleat.model.EnumRole;
import fr.cardon.simpleat.model.Personne;
import fr.cardon.simpleat.service.PersonneService;
@SpringBootApplication
public class SimpleatApplication {

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.controller;
package fr.cardon.simpleat.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.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;
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;
@RestController
@CrossOrigin("http://localhost:4200")

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.controller;
package fr.cardon.simpleat.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.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;
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;
@RestController
@CrossOrigin("*")

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.controller;
package fr.cardon.simpleat.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.vincentRamiere.simpleatBack.model.Restaurant;
import fr.vincentRamiere.simpleatBack.repository.RestaurantRepository;
import fr.cardon.simpleat.model.Restaurant;
import fr.cardon.simpleat.repository.RestaurantRepository;
@RestController
@CrossOrigin("*")

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.controller;
package fr.cardon.simpleat.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.vincentRamiere.simpleatBack.model.Restaurant;
import fr.vincentRamiere.simpleatBack.model.TypeRestau;
import fr.vincentRamiere.simpleatBack.repository.TypeRestauRepository;
import fr.cardon.simpleat.model.Restaurant;
import fr.cardon.simpleat.model.TypeRestau;
import fr.cardon.simpleat.repository.TypeRestauRepository;
@RestController
@CrossOrigin("*")

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.dto;
package fr.cardon.simpleat.dto;
/**
* Classe spécifique DTO (Data Transfer Object) qui retourne un Jeton au format JSON (REST response)

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.dto;
package fr.cardon.simpleat.dto;
import java.util.List;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.exception;
package fr.cardon.simpleat.exception;
/**
* Classe personnalisée pour gérer un message si l'utilisateur (User) existe en Base de données

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.exception;
package fr.cardon.simpleat.exception;
/**
* Specific exception that should be thrown when user credentials are not valid.

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.exception;
package fr.cardon.simpleat.exception;
/**
* Specific exception that should be thrown when a JWT has an invalid format.

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import org.springframework.security.core.GrantedAuthority;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import java.io.Serializable;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import java.util.ArrayList;
import java.util.Collection;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.model;
package fr.cardon.simpleat.model;
import java.util.List;

View File

@ -1,11 +1,11 @@
package fr.vincentRamiere.simpleatBack.repository;
package fr.cardon.simpleat.repository;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import fr.vincentRamiere.simpleatBack.model.Personne;
import fr.cardon.simpleat.model.Personne;
@Repository
public interface PersonneRepository extends JpaRepository<Personne, Integer> {

View File

@ -1,10 +1,10 @@
package fr.vincentRamiere.simpleatBack.repository;
package fr.cardon.simpleat.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import fr.vincentRamiere.simpleatBack.model.Preference;
import fr.vincentRamiere.simpleatBack.model.PreferencePK;
import fr.cardon.simpleat.model.Preference;
import fr.cardon.simpleat.model.PreferencePK;
@Repository
public interface PreferenceRepository extends JpaRepository<Preference, PreferencePK> {

View File

@ -1,10 +1,10 @@
package fr.vincentRamiere.simpleatBack.repository;
package fr.cardon.simpleat.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import fr.vincentRamiere.simpleatBack.model.Reservation;
import fr.vincentRamiere.simpleatBack.model.ReservationPK;
import fr.cardon.simpleat.model.Reservation;
import fr.cardon.simpleat.model.ReservationPK;
@Repository
public interface ReservationRepository extends JpaRepository<Reservation, ReservationPK> {

View File

@ -1,9 +1,9 @@
package fr.vincentRamiere.simpleatBack.repository;
package fr.cardon.simpleat.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import fr.vincentRamiere.simpleatBack.model.Restaurant;
import fr.cardon.simpleat.model.Restaurant;
@Repository
public interface RestaurantRepository extends JpaRepository<Restaurant, Integer> {

View File

@ -1,9 +1,9 @@
package fr.vincentRamiere.simpleatBack.repository;
package fr.cardon.simpleat.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import fr.vincentRamiere.simpleatBack.model.TypeRestau;
import fr.cardon.simpleat.model.TypeRestau;
@Repository
public interface TypeRestauRepository extends JpaRepository<TypeRestau, Integer> {

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.security;
package fr.cardon.simpleat.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.vincentRamiere.simpleatBack.exception.InvalidJWTException;
import fr.cardon.simpleat.exception.InvalidJWTException;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.security;
package fr.cardon.simpleat.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.vincentRamiere.simpleatBack.exception.InvalidJWTException;
import fr.vincentRamiere.simpleatBack.model.EnumRole;
import fr.vincentRamiere.simpleatBack.repository.PersonneRepository;
import fr.cardon.simpleat.exception.InvalidJWTException;
import fr.cardon.simpleat.model.EnumRole;
import fr.cardon.simpleat.repository.PersonneRepository;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtException;
import io.jsonwebtoken.Jwts;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.security;
package fr.cardon.simpleat.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

View File

@ -1,13 +1,13 @@
package fr.vincentRamiere.simpleatBack.service;
package fr.cardon.simpleat.service;
import java.util.List;
import java.util.Optional;
import org.springframework.stereotype.Service;
import fr.vincentRamiere.simpleatBack.exception.ExistingUsernameException;
import fr.vincentRamiere.simpleatBack.exception.InvalidCredentialsException;
import fr.vincentRamiere.simpleatBack.model.Personne;
import fr.cardon.simpleat.exception.ExistingUsernameException;
import fr.cardon.simpleat.exception.InvalidCredentialsException;
import fr.cardon.simpleat.model.Personne;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.service;
package fr.cardon.simpleat.service;
import java.util.List;
import java.util.Optional;
@ -11,11 +11,13 @@ import org.springframework.security.core.AuthenticationException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
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;
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;

View File

@ -1,4 +1,4 @@
package fr.vincentRamiere.simpleatBack.service;
package fr.cardon.simpleat.service;
import java.util.Optional;
@ -10,8 +10,9 @@ import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import fr.vincentRamiere.simpleatBack.model.Personne;
import fr.vincentRamiere.simpleatBack.repository.PersonneRepository;
import fr.cardon.simpleat.model.Personne;
import fr.cardon.simpleat.repository.PersonneRepository;
@Service

View File

@ -7,8 +7,8 @@ spring.main.allow-circular-references=true
# base de données MySQL
# ===============================
spring.datasource.url=jdbc:mysql://localhost:3306/simpleat?useSSL=false&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=CET
spring.datasource.username=root
spring.datasource.password=bbLouis1+Noe2
spring.datasource.username=simplon
spring.datasource.password=bbLouis1&Noe2
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# log
#logging.level.root=INFO
@ -19,11 +19,10 @@ 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=none
spring.jpa.hibernate.ddl-auto=create-drop
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