Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BackEnd-V2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joel Andres Molina Velez
BackEnd-V2
Commits
5b7c242c
Commit
5b7c242c
authored
Jun 01, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se realizan correciones al método guardar de valorpar
parent
d026777e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
UzyTaValorParController.java
...lidad/MovilidadWS/controller/UzyTaValorParController.java
+4
-2
IServiceUzyTaValorPar.java
...ilidadWS/service/UzyTaValorPar/IServiceUzyTaValorPar.java
+1
-1
ServiceUzyTaValorPar.java
...vilidadWS/service/UzyTaValorPar/ServiceUzyTaValorPar.java
+10
-1
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/controller/UzyTaValorParController.java
View file @
5b7c242c
...
...
@@ -44,9 +44,11 @@ public class UzyTaValorParController {
}
@PostMapping
(
"/guardar"
)
public
ResponseEntity
<
ModelUzyTaValorPar
>
guardar
(
@RequestBody
ModelUzyTaValorPar
modelUzyTaValorPar
)
{
return
new
ResponseEntity
<>(
serviceUzyTaValorPar
.
guardar
(
modelUzyTaValorPar
),
HttpStatus
.
OK
);
public
ResponseEntity
<
ModelUzyTaValorPar
>
guardar
(
@RequestParam
(
"uzytavparaeva_id"
)
Long
uzytavparaeva_id
,
@RequestBody
ModelUzyTaValorPar
modelUzyTaValorPar
)
{
ModelUzyTaValorPar
creado
=
serviceUzyTaValorPar
.
guardar
(
uzytavparaeva_id
,
modelUzyTaValorPar
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
creado
);
}
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTaValorPar/IServiceUzyTaValorPar.java
View file @
5b7c242c
...
...
@@ -18,7 +18,7 @@ public interface IServiceUzyTaValorPar {
public
List
<
Object
[]>
getAllDatosRelacionadosParaEva
();
public
ModelUzyTaValorPar
guardar
(
ModelUzyTaValorPar
modelUzyTaValorPar
);
public
ModelUzyTaValorPar
guardar
(
Long
uzytavconparaeva_id
,
ModelUzyTaValorPar
modelUzyTaValorPar
);
public
ModelUzyTaValorPar
editar
(
Long
id
,
ModelUzyTaValorPar
modelUzyTaValorPar
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTaValorPar/ServiceUzyTaValorPar.java
View file @
5b7c242c
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
service
.
UzyTaValorPar
;
import
ec.edu.espe.movilidad.MovilidadWS.dao.DaoUzyTaValorPar
;
import
ec.edu.espe.movilidad.MovilidadWS.dao.DaoUzyTavParaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTaValorPar
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTavParaEva
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
javax.persistence.EntityNotFoundException
;
import
java.util.List
;
@Service
...
...
@@ -14,6 +17,9 @@ public class ServiceUzyTaValorPar implements IServiceUzyTaValorPar {
@Autowired
DaoUzyTaValorPar
daoUzyTaValorPar
;
@Autowired
DaoUzyTavParaEva
daoUzyTavParaEva
;
@Override
public
ModelUzyTaValorPar
ListarPorID
(
@PathVariable
Long
id
)
{
return
daoUzyTaValorPar
.
findById
(
id
).
get
();
...
...
@@ -34,7 +40,10 @@ public class ServiceUzyTaValorPar implements IServiceUzyTaValorPar {
}
@Override
public
ModelUzyTaValorPar
guardar
(
ModelUzyTaValorPar
modelUzyTaValorPar
)
{
public
ModelUzyTaValorPar
guardar
(
@PathVariable
Long
uzytavparaeva_id
,
ModelUzyTaValorPar
modelUzyTaValorPar
)
{
ModelUzyTavParaEva
modelUzyTavParaEva
=
daoUzyTavParaEva
.
findById
(
uzytavparaeva_id
)
.
orElseThrow
(()
->
new
EntityNotFoundException
(
"No se encontró la entidad ModelUzyTaParaEva con el ID proporcionado"
));
modelUzyTaValorPar
.
setUzyTavParaEva
(
modelUzyTavParaEva
);
return
daoUzyTaValorPar
.
save
(
modelUzyTaValorPar
);
}
...
...
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