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
d026777e
Commit
d026777e
authored
May 31, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se corrigen errores de post
parent
2f679203
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
UzyTavParaEvaController.java
...lidad/MovilidadWS/controller/UzyTavParaEvaController.java
+4
-2
IServiceUzyTavParaEva.java
...ilidadWS/service/UzyTavParaEva/IServiceUzyTavParaEva.java
+1
-1
ServiceUzyTavParaEva.java
...vilidadWS/service/UzyTavParaEva/ServiceUzyTavParaEva.java
+13
-1
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/controller/UzyTavParaEvaController.java
View file @
d026777e
...
...
@@ -49,8 +49,10 @@ public class UzyTavParaEvaController {
@PostMapping
(
"/guardar"
)
public
ResponseEntity
<
ModelUzyTavParaEva
>
guardar
(
@RequestBody
ModelUzyTavParaEva
modelUzyTavParaEva
)
{
return
new
ResponseEntity
<>(
serviceUzyTavParaEva
.
guardar
(
modelUzyTavParaEva
),
HttpStatus
.
OK
);
public
ResponseEntity
<
ModelUzyTavParaEva
>
guardar
(
@RequestBody
ModelUzyTavParaEva
modelUzyTavParaEva
,
@RequestParam
(
"uzytavconparaeva_id"
)
Long
uzytavconparaeva_id
)
{
ModelUzyTavParaEva
creado
=
serviceUzyTavParaEva
.
guardar
(
uzytavconparaeva_id
,
modelUzyTavParaEva
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
creado
);
}
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTavParaEva/IServiceUzyTavParaEva.java
View file @
d026777e
...
...
@@ -21,7 +21,7 @@ public interface IServiceUzyTavParaEva {
public
List
<
ModelUzyTavParaEva
>
ListarRegistros
();
public
ModelUzyTavParaEva
guardar
(
ModelUzyTavParaEva
modelUzyTavParaEva
);
public
ModelUzyTavParaEva
guardar
(
Long
uzytavconparaeva_id
,
ModelUzyTavParaEva
modelUzyTavParaEva
);
public
ModelUzyTavParaEva
editar
(
Long
id
,
ModelUzyTavParaEva
modelUzyTavParaEva
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTavParaEva/ServiceUzyTavParaEva.java
View file @
d026777e
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
service
.
UzyTavParaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.dao.DaoUzyTavConparaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.dao.DaoUzyTavParaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTaConparaEva
;
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
javax.transaction.Transactional
;
import
java.util.List
;
@Service
@Transactional
public
class
ServiceUzyTavParaEva
implements
IServiceUzyTavParaEva
{
@Autowired
DaoUzyTavParaEva
daoUzyTavParaEva
;
@Autowired
DaoUzyTavConparaEva
daoUzyTavConparaEva
;
@Override
public
ModelUzyTavParaEva
ListarPorID
(
@PathVariable
Long
id
)
{
return
daoUzyTavParaEva
.
findById
(
id
).
get
();
...
...
@@ -37,7 +45,11 @@ public class ServiceUzyTavParaEva implements IServiceUzyTavParaEva {
}
@Override
public
ModelUzyTavParaEva
guardar
(
ModelUzyTavParaEva
modelUzyTavParaEva
)
{
public
ModelUzyTavParaEva
guardar
(
Long
uzytavconparaeva_id
,
ModelUzyTavParaEva
modelUzyTavParaEva
)
{
ModelUzyTaConparaEva
uzyTaConparaEva
=
daoUzyTavConparaEva
.
findById
(
uzytavconparaeva_id
)
.
orElseThrow
(()
->
new
EntityNotFoundException
(
"No se encontró la entidad ModelUzyTaConparaEva con el ID proporcionado"
));
modelUzyTavParaEva
.
setUzytavconparaeva
(
uzyTaConparaEva
);
return
daoUzyTavParaEva
.
save
(
modelUzyTavParaEva
);
}
...
...
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