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
938d764a
Commit
938d764a
authored
Jun 01, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se agregan servicios a la tabla cabparaevaf
parent
83c76fbe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
UzyTavCabParaevafController.java
...d/MovilidadWS/controller/UzyTavCabParaevafController.java
+4
-2
IServiceUzyTavCabParaevaf.java
.../service/UzyTavCabParaevaf/IServiceUzyTavCabParaevaf.java
+1
-1
ServiceUzyTavCabParaevaf.java
...S/service/UzyTavCabParaevaf/ServiceUzyTavCabParaevaf.java
+10
-1
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/controller/UzyTavCabParaevafController.java
View file @
938d764a
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
controller
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTaConparaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTavCabParaevaf
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTavParaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.service.UzyTavCabParaevaf.IServiceUzyTavCabParaevaf
;
...
...
@@ -39,8 +40,9 @@ public class UzyTavCabParaevafController {
@PostMapping
(
"/guardar"
)
public
ResponseEntity
<
ModelUzyTavCabParaevaf
>
guardar
(
@RequestBody
ModelUzyTavCabParaevaf
modelUzyTavCabParaevaf
)
{
return
new
ResponseEntity
<>(
serviceUzyTavCabParaevaf
.
guardar
(
modelUzyTavCabParaevaf
),
HttpStatus
.
OK
);
public
ResponseEntity
<
ModelUzyTavCabParaevaf
>
guardar
(
@RequestParam
(
"uzytavconparaeva_id"
)
Long
uzytavconparaeva_id
,
@RequestBody
ModelUzyTavCabParaevaf
modelUzyTavCabParaevaf
)
{
ModelUzyTavCabParaevaf
creado
=
serviceUzyTavCabParaevaf
.
guardar
(
uzytavconparaeva_id
,
modelUzyTavCabParaevaf
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
creado
);
}
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTavCabParaevaf/IServiceUzyTavCabParaevaf.java
View file @
938d764a
...
...
@@ -12,7 +12,7 @@ public interface IServiceUzyTavCabParaevaf {
public
List
<
ModelUzyTavCabParaevaf
>
ListarRegistros
();
public
List
<
ModelUzyTavCabParaevaf
>
findByIdDatosConParaEvaTipo2
(
Long
id
);
public
ModelUzyTavCabParaevaf
guardar
(
ModelUzyTavCabParaevaf
modelUzyTavCabParaevaf
);
public
ModelUzyTavCabParaevaf
guardar
(
Long
uzytavconparaeva_id
,
ModelUzyTavCabParaevaf
modelUzyTavCabParaevaf
);
public
ModelUzyTavCabParaevaf
editar
(
Long
id
,
ModelUzyTavCabParaevaf
modelUzyTavCabParaevaf
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTavCabParaevaf/ServiceUzyTavCabParaevaf.java
View file @
938d764a
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
service
.
UzyTavCabParaevaf
;
import
ec.edu.espe.movilidad.MovilidadWS.dao.DaoUzyTavCabParaevaf
;
import
ec.edu.espe.movilidad.MovilidadWS.dao.DaoUzyTavConparaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTaConparaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTavCabParaevaf
;
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
public
class
ServiceUzyTavCabParaevaf
implements
IServiceUzyTavCabParaevaf
{
@Autowired
DaoUzyTavCabParaevaf
daoUzyTavCabParaevaf
;
@Autowired
DaoUzyTavConparaEva
daoUzyTavConparaEva
;
@Override
public
ModelUzyTavCabParaevaf
ListarPorID
(
@PathVariable
Long
id
)
{
...
...
@@ -25,7 +30,11 @@ public class ServiceUzyTavCabParaevaf implements IServiceUzyTavCabParaevaf {
}
@Override
public
ModelUzyTavCabParaevaf
guardar
(
ModelUzyTavCabParaevaf
modelUzyTavCabParaevaf
)
{
public
ModelUzyTavCabParaevaf
guardar
(
@PathVariable
Long
uzytavconparaeva_id
,
ModelUzyTavCabParaevaf
modelUzyTavCabParaevaf
)
{
ModelUzyTaConparaEva
modelUzyTaConparaEva
=
daoUzyTavConparaEva
.
findById
(
uzytavconparaeva_id
)
.
orElseThrow
(()
->
new
EntityNotFoundException
(
"No se encontró la entidad ModelUzyTaConparaEva con el ID proporcionado"
));
modelUzyTavCabParaevaf
.
setUzytavconparaeva
(
modelUzyTaConparaEva
);
return
daoUzyTavCabParaevaf
.
save
(
modelUzyTavCabParaevaf
);
}
...
...
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