From 13c59b8ab3f1b713ce5ae3e345b24851654527c8 Mon Sep 17 00:00:00 2001 From: Giuli1297 Date: Mon, 15 Nov 2021 14:15:27 -0300 Subject: [PATCH] Algunas mejoras a la GUI --- curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java | 12 ++++++++---- curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java | 7 ++++--- curriculumsearch/src/main/webapp/jsp/edit-user-data.jsp | 1 + curriculumsearch/src/main/webapp/jsp/header.jsp | 27 +++++++++++++++++++++++++-- curriculumsearch/src/main/webapp/jsp/register_success.jsp | 15 --------------- 5 files changed, 38 insertions(+), 24 deletions(-) delete mode 100644 curriculumsearch/src/main/webapp/jsp/register_success.jsp diff --git a/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java b/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java index 0ad17b3..585d47f 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java @@ -67,17 +67,21 @@ public class RRHHUserController { } @PostMapping("/process_register") - public String processRegister(HttpServletRequest request, RRHHUser user) { + public RedirectView processRegister(HttpServletRequest request, RRHHUser user, RedirectAttributes redirectAttributes) { + RedirectView redirectView = new RedirectView("/register",true); + redirectAttributes.addFlashAttribute("success", "Datos actualizados"); if(Long.parseLong(request.getParameter("registrationCode")) != REGISTER_CODE){ - return "redirect:/register"; + redirectAttributes.addFlashAttribute("error", "Codigo Incorrecto"); + return redirectView; } BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); String encodedPassword = passwordEncoder.encode(user.getPassword()); user.setPassword(encodedPassword); rrhhUserRepository.save(user); - - return "register_success"; + redirectView.setUrl("/login"); + redirectAttributes.addFlashAttribute("success", "Registro Correcto"); + return redirectView; } @GetMapping("/edit-user-data") diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java b/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java index 92b61cd..9265e5b 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java @@ -67,7 +67,8 @@ public class Postulante { private Long nivelIngles; @Column(name = "curriculum") - private String curriculum; + @Lob + private byte[] curriculum; @Column(name="estado_civil") @NotNull @@ -192,11 +193,11 @@ public class Postulante { this.nivelIngles = nivelIngles; } - public String getCurriculum() { + public byte[] getCurriculum() { return curriculum; } - public void setCurriculum(String curriculum) { + public void setCurriculum(byte[] curriculum) { this.curriculum = curriculum; } diff --git a/curriculumsearch/src/main/webapp/jsp/edit-user-data.jsp b/curriculumsearch/src/main/webapp/jsp/edit-user-data.jsp index abdb26d..38b2f2b 100644 --- a/curriculumsearch/src/main/webapp/jsp/edit-user-data.jsp +++ b/curriculumsearch/src/main/webapp/jsp/edit-user-data.jsp @@ -53,6 +53,7 @@ + Volver diff --git a/curriculumsearch/src/main/webapp/jsp/header.jsp b/curriculumsearch/src/main/webapp/jsp/header.jsp index 5a842fb..d47e825 100644 --- a/curriculumsearch/src/main/webapp/jsp/header.jsp +++ b/curriculumsearch/src/main/webapp/jsp/header.jsp @@ -1,6 +1,9 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> + + +
@@ -49,11 +52,31 @@ Editar mis datos -
\ No newline at end of file + + + \ No newline at end of file diff --git a/curriculumsearch/src/main/webapp/jsp/register_success.jsp b/curriculumsearch/src/main/webapp/jsp/register_success.jsp deleted file mode 100644 index 7c28633..0000000 --- a/curriculumsearch/src/main/webapp/jsp/register_success.jsp +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Registration Success - - - -
-

You have signed up successfully!

-

Click here to Login

-
- - - \ No newline at end of file -- libgit2 0.26.0