mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-07-09 13:27:45 +00:00
feat: devWeb - remove println and main.java
This commit is contained in:
@@ -1,67 +0,0 @@
|
|||||||
package uppa.project;
|
|
||||||
|
|
||||||
import uppa.project.database.dao.DAOException;
|
|
||||||
import uppa.project.database.pojo.Card;
|
|
||||||
import uppa.project.database.pojo.Deck;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
|
|
||||||
public static void main(String[] args) throws DAOException {
|
|
||||||
Deck deck = new Deck(3,10);
|
|
||||||
for (Card card : deck.getCards()){
|
|
||||||
System.out.println(card.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
// for (int index = 0; index < 4* 3; index++) {
|
|
||||||
// int i = index % 4;
|
|
||||||
// int j = index / 3;
|
|
||||||
//
|
|
||||||
// System.out.println("i= " + i + " j = " + j);
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// Game_JPA_DAO_Factory jpaDaoFactory = new Game_JPA_DAO_Factory();
|
|
||||||
// DAO<User> daoJpaUser = jpaDaoFactory.getDAOUser();
|
|
||||||
//// DAO<Game> daoJpaGame = jpaDaoFactory.getDAOGame();
|
|
||||||
//// DAO<Player> daoJpaPlayer = jpaDaoFactory.getDAOPlayer();
|
|
||||||
//
|
|
||||||
//// // Contenu de la BD au début
|
|
||||||
//// User[] users = daoJpaUser.findAll();
|
|
||||||
//// for (User u : users) {
|
|
||||||
//// System.out.println(u.toString());
|
|
||||||
//// }
|
|
||||||
//// System.out.println();
|
|
||||||
////
|
|
||||||
// // Ajout d'User :
|
|
||||||
// Calendar cal1 = Calendar.getInstance();
|
|
||||||
// cal1.set(1996, Calendar.FEBRUARY, 20);
|
|
||||||
// User user1 = new User("Kevin","kmitresse@gmail.com", "Mitresse", cal1.getTime(), User.Gender.MALE);
|
|
||||||
//
|
|
||||||
// Calendar cal2 = Calendar.getInstance();
|
|
||||||
// cal2.set(2002, Calendar.JUNE, 28);
|
|
||||||
// User user2 = new User("Lucàs", "lucas@gmail.com" ,"Vabre", cal2.getTime(), User.Gender.MALE);
|
|
||||||
//
|
|
||||||
// daoJpaUser.create(user1);
|
|
||||||
// daoJpaUser.create(user2);
|
|
||||||
//
|
|
||||||
//// System.out.println("test récupération user");
|
|
||||||
//// User[] users2 = daoJpaUser.findByField("username", "Kevin");
|
|
||||||
//// for (User user : users2) {
|
|
||||||
//// System.out.println(user.toString());
|
|
||||||
//// }
|
|
||||||
//// System.out.println("fin test");
|
|
||||||
// } catch (DAOException e) {
|
|
||||||
// throw new RuntimeException(e);
|
|
||||||
// }
|
|
||||||
// // Contenu de la BD après ajout
|
|
||||||
//// users = daoJpaUser.findAll();
|
|
||||||
//// for (User u : users) {
|
|
||||||
//// System.out.println(u.toString());
|
|
||||||
//// }
|
|
||||||
//// System.out.println();
|
|
||||||
////
|
|
||||||
//// EntityManagerProvider.close();
|
|
||||||
//// } catch (Exception e) {
|
|
||||||
//// e.printStackTrace();
|
|
||||||
//// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -40,7 +40,6 @@ public class LoginBean implements Serializable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (DAOException e) {
|
} catch (DAOException e) {
|
||||||
error = new HttpResponse(HttpResponseCode.INTERNAL_SERVER_ERROR,"Une erreur est survenue (DB_CONNECTION_ERROR:001)");
|
error = new HttpResponse(HttpResponseCode.INTERNAL_SERVER_ERROR,"Une erreur est survenue (DB_CONNECTION_ERROR:001)");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -416,10 +416,7 @@ public class User implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValidBirthDate(Date birthdate){
|
public boolean isValidBirthDate(Date birthdate){
|
||||||
System.out.println(birthdate.toString());
|
|
||||||
|
|
||||||
Date currentDate = new Date();
|
Date currentDate = new Date();
|
||||||
System.out.println(currentDate.toString());
|
|
||||||
return birthdate.before(currentDate) || birthdate.equals(currentDate);
|
return birthdate.before(currentDate) || birthdate.equals(currentDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ public class ForgottenPasswordServlet extends HttpServlet {
|
|||||||
String url = request.getRequestURL().toString();
|
String url = request.getRequestURL().toString();
|
||||||
//retirer le dernier segment de l'url pour avoir le contextPath
|
//retirer le dernier segment de l'url pour avoir le contextPath
|
||||||
String uri = url.substring(0, url.lastIndexOf("/"));
|
String uri = url.substring(0, url.lastIndexOf("/"));
|
||||||
System.out.println(uri);
|
|
||||||
if (forgottenPasswordBean.validate(uri)) {
|
if (forgottenPasswordBean.validate(uri)) {
|
||||||
httpResponse = new HttpResponse(HttpResponseCode.OK, "Mail sent");
|
httpResponse = new HttpResponse(HttpResponseCode.OK, "Mail sent");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user