Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amparo Oliver
th-app-java
Commits
20f93b5f
Commit
20f93b5f
authored
Nov 02, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'giuli_001' of
https://phoebe.roshka.com/gitlab/hshah/TalentoHumano
into joel-001
parents
a5c78d23
b17b12ec
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
4 deletions
+97
-4
curriculumsearch/pom.xml
+10
-0
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+25
-4
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+14
-0
curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java
+6
-0
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
+12
-0
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+17
-0
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+8
-0
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
+2
-0
curriculumsearch/src/main/resources/static/main.js
+3
-0
No files found.
curriculumsearch/pom.xml
View file @
20f93b5f
...
...
@@ -47,6 +47,16 @@
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-validation
</artifactId>
</dependency>
<dependency>
<groupId>
org.hibernate.validator
</groupId>
<artifactId>
hibernate-validator
</artifactId>
<version>
6.0.13.Final
</version>
</dependency>
</dependencies>
<build>
...
...
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
20f93b5f
package
com
.
roshka
.
controller
;
import
javax.validation.ConstraintViolationException
;
import
com.roshka.modelo.Postulante
;
import
com.roshka.repositorio.PostulanteRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.*
;
@Controller
@Controller
public
class
PostulanteController
{
@Autowired
PostulanteRepository
post
;
...
...
@@ -32,4 +37,20 @@ public class PostulanteController {
return
"redirect:/"
;
}
@ResponseStatus
(
HttpStatus
.
BAD_REQUEST
)
@ExceptionHandler
({
MethodArgumentNotValidException
.
class
})
public
ResponseEntity
<
String
>
handleValidationExceptions
(
MethodArgumentNotValidException
ex
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
)
.
body
(
ex
.
getMessage
());
}
@ResponseStatus
(
HttpStatus
.
BAD_REQUEST
)
@ExceptionHandler
({
ConstraintViolationException
.
class
})
public
ResponseEntity
<
String
>
handleValidationExceptions2
(
ConstraintViolationException
ex
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
)
.
body
(
ex
.
getMessage
());
}
}
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
20f93b5f
...
...
@@ -12,6 +12,9 @@ import javax.persistence.JoinColumn;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Past
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
...
...
@@ -22,17 +25,28 @@ public class Estudio {
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
@Column
(
name
=
"tipo_de_studio"
)
@NotBlank
private
String
tipoDeEstudio
;
@Column
(
name
=
"institucion"
)
@NotBlank
private
String
institucion
;
@Column
(
name
=
"fecha_desde"
)
@NotNull
@Past
private
Date
fechaDesde
;
@Column
(
name
=
"fecha_hasta"
)
private
Date
fechaHasta
;
@Column
(
name
=
"referencias"
)
private
String
referencias
;
@Column
(
name
=
"titulo"
)
@NotBlank
private
String
titulo
;
@ManyToOne
...
...
curriculumsearch/src/main/java/com/roshka/modelo/EstudioReconocimiento.java
View file @
20f93b5f
...
...
@@ -9,6 +9,7 @@ import javax.persistence.Id;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
...
...
@@ -19,10 +20,15 @@ public class EstudioReconocimiento {
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Column
(
name
=
"id"
)
private
Long
id
;
@Column
(
name
=
"nombre"
)
@NotBlank
private
String
nombre
;
@Column
(
name
=
"certificado"
)
@NotBlank
private
String
certificado
;
@JsonBackReference
@ManyToOne
@JoinColumn
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
20f93b5f
...
...
@@ -14,6 +14,9 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Past
;
@Entity
@Table
(
name
=
"experiencia"
)
...
...
@@ -21,10 +24,16 @@ public class Experiencia {
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
private
long
id
;
@Column
(
name
=
"institucion"
)
@NotBlank
private
String
institucion
;
@Column
(
name
=
"fecha_desde"
)
@Past
@NotNull
private
Date
fechaDesde
;
@Column
(
name
=
"fecha_hasta"
)
private
Date
fechaHasta
;
@Column
(
name
=
"nombre_referencia"
)
...
...
@@ -32,9 +41,12 @@ public class Experiencia {
@Column
(
name
=
"telefono_referencia"
)
private
String
telefonoReferencia
;
@Column
(
name
=
"cargo"
)
@NotBlank
private
String
cargo
;
@Column
(
name
=
"descripcion"
)
private
String
descripcion
;
@JsonBackReference
@ManyToOne
(
optional
=
false
)
@JoinColumn
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
20f93b5f
package
com
.
roshka
.
modelo
;
import
javax.persistence.*
;
import
javax.validation.constraints.*
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
...
...
@@ -20,36 +21,52 @@ public class Postulante {
private
long
id
;
@Column
(
name
=
"nombre"
)
@NotBlank
@Size
(
max
=
255
)
private
String
nombre
;
@Column
(
name
=
"apellido"
)
@NotBlank
@Size
(
max
=
255
)
private
String
apellido
;
@Column
(
name
=
"ci"
)
@NotBlank
@Size
(
max
=
120
)
private
String
ci
;
@Column
(
name
=
"correo"
)
@NotBlank
@Email
(
message
=
"Formato incorrecto de correo"
)
private
String
correo
;
@Column
(
name
=
"ciudad"
)
@NotBlank
@Size
(
max
=
120
)
private
String
ciudad
;
@Column
(
name
=
"telefono"
)
@NotBlank
private
String
telefono
;
@Column
(
name
=
"fecha_nacimiento"
)
@NotNull
@Past
private
Date
fechaNacimiento
;
@Column
(
name
=
"resumen"
)
private
String
resumen
;
@Column
(
name
=
"nivel_ingles"
)
@Min
(
value
=
1
)
@Max
(
value
=
5
)
private
long
nivelIngles
;
@Column
(
name
=
"curriculum"
)
private
String
curriculum
;
@Column
(
name
=
"modalidad"
)
@NotNull
private
String
modalidad
;
@Column
(
name
=
"disponibilidad"
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
20f93b5f
...
...
@@ -8,6 +8,9 @@ import javax.persistence.Id;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
...
...
@@ -18,11 +21,16 @@ public class PostulanteTecnologia {
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Column
(
name
=
"id"
)
private
long
id
;
@Column
(
name
=
"nivel"
)
@Min
(
value
=
1
)
@Max
(
value
=
5
)
private
Long
nivel
;
@ManyToOne
()
@JoinColumn
private
Tecnologia
tecnologia
;
@ManyToOne
()
@JoinColumn
@JsonBackReference
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
View file @
20f93b5f
...
...
@@ -6,6 +6,7 @@ import javax.persistence.GeneratedValue;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotBlank
;
@Entity
@Table
(
name
=
"tecnologia"
)
...
...
@@ -16,6 +17,7 @@ public class Tecnologia {
private
long
id
;
@Column
(
name
=
"nombre"
)
@NotBlank
private
String
nombre
;
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
20f93b5f
...
...
@@ -96,7 +96,9 @@ form.addEventListener("submit",(evt)=>{
postData
(
'postulante'
,
serializeJSON
(
form
))
.
then
(
response
=>
{
if
(
response
.
status
==
200
||
response
.
status
==
302
){
location
.
replace
(
response
.
url
);
}
});
evt
.
preventDefault
();
}
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment