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
4b0e2f5d
Commit
4b0e2f5d
authored
Jul 28, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se agrega una api en ServiceUzyTavSubLinea para obtenerRegistrosPorLinea
parent
6b43f9b9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
UzyTavSubLineaController.java
...idad/MovilidadWS/Controller/UzyTavSubLineaController.java
+6
-0
DaoUzyTavSubLinea.java
...edu/espe/movilidad/MovilidadWS/Dao/DaoUzyTavSubLinea.java
+7
-0
IServiceUzyTavSubLinea.java
...idadWS/Service/UzyTavSubLinea/IServiceUzyTavSubLinea.java
+2
-1
ServiceUzyTavSubLinea.java
...lidadWS/Service/UzyTavSubLinea/ServiceUzyTavSubLinea.java
+6
-0
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Controller/UzyTavSubLineaController.java
View file @
4b0e2f5d
...
@@ -30,6 +30,12 @@ public class UzyTavSubLineaController {
...
@@ -30,6 +30,12 @@ public class UzyTavSubLineaController {
}
}
@GetMapping
(
"/obtenerRegistrosPorLinea/{lineaID}"
)
public
ResponseEntity
<
List
<
DtoUzyTavSubLinea
>>
obtenerRegistrosPorLinea
(
@PathVariable
Long
lineaID
)
{
return
new
ResponseEntity
<>(
serviceUzyTavSubLinea
.
obtenerRegistrosPorLinea
(
lineaID
),
HttpStatus
.
OK
);
}
@PostMapping
(
"/guardar"
)
@PostMapping
(
"/guardar"
)
public
ResponseEntity
<
DtoUzyTavSubLinea
>
guardar
(
@RequestBody
DtoUzyTavSubLinea
dtoUzyTavSubLinea
)
{
public
ResponseEntity
<
DtoUzyTavSubLinea
>
guardar
(
@RequestBody
DtoUzyTavSubLinea
dtoUzyTavSubLinea
)
{
return
new
ResponseEntity
<>(
serviceUzyTavSubLinea
.
guardar
(
dtoUzyTavSubLinea
),
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
serviceUzyTavSubLinea
.
guardar
(
dtoUzyTavSubLinea
),
HttpStatus
.
OK
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Dao/DaoUzyTavSubLinea.java
View file @
4b0e2f5d
...
@@ -2,8 +2,15 @@ package ec.edu.espe.movilidad.MovilidadWS.Dao;
...
@@ -2,8 +2,15 @@ package ec.edu.espe.movilidad.MovilidadWS.Dao;
import
ec.edu.espe.movilidad.MovilidadWS.Model.ModelUzyTavSubLinea
;
import
ec.edu.espe.movilidad.MovilidadWS.Model.ModelUzyTavSubLinea
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
@Repository
public
interface
DaoUzyTavSubLinea
extends
JpaRepository
<
ModelUzyTavSubLinea
,
Long
>
{
public
interface
DaoUzyTavSubLinea
extends
JpaRepository
<
ModelUzyTavSubLinea
,
Long
>
{
@Query
(
"SELECT sb FROM ModelUzyTavSubLinea sb JOIN sb.UZYTAVLINEA l WHERE l.uzytavlinea_ID = :lineaID"
)
List
<
ModelUzyTavSubLinea
>
obtenerRegistrosPorLinea
(
@Param
(
"lineaID"
)
Long
lineaID
);
}
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Service/UzyTavSubLinea/IServiceUzyTavSubLinea.java
View file @
4b0e2f5d
...
@@ -3,6 +3,7 @@ package ec.edu.espe.movilidad.MovilidadWS.Service.UzyTavSubLinea;
...
@@ -3,6 +3,7 @@ package ec.edu.espe.movilidad.MovilidadWS.Service.UzyTavSubLinea;
import
ec.edu.espe.movilidad.MovilidadWS.Dto.DtoUzyTavSubLinea
;
import
ec.edu.espe.movilidad.MovilidadWS.Dto.DtoUzyTavSubLinea
;
import
java.util.List
;
import
java.util.List
;
public
interface
IServiceUzyTavSubLinea
{
public
interface
IServiceUzyTavSubLinea
{
...
@@ -13,6 +14,6 @@ public interface IServiceUzyTavSubLinea {
...
@@ -13,6 +14,6 @@ public interface IServiceUzyTavSubLinea {
DtoUzyTavSubLinea
guardar
(
DtoUzyTavSubLinea
dtoUzyTavSubLinea
);
DtoUzyTavSubLinea
guardar
(
DtoUzyTavSubLinea
dtoUzyTavSubLinea
);
DtoUzyTavSubLinea
editar
(
Long
id
,
DtoUzyTavSubLinea
dtoUzyTavSubLinea
);
DtoUzyTavSubLinea
editar
(
Long
id
,
DtoUzyTavSubLinea
dtoUzyTavSubLinea
);
List
<
DtoUzyTavSubLinea
>
obtenerRegistrosPorLinea
(
Long
lineaID
);
boolean
eliminar
(
Long
id
);
boolean
eliminar
(
Long
id
);
}
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Service/UzyTavSubLinea/ServiceUzyTavSubLinea.java
View file @
4b0e2f5d
...
@@ -56,6 +56,12 @@ public class ServiceUzyTavSubLinea implements IServiceUzyTavSubLinea{
...
@@ -56,6 +56,12 @@ public class ServiceUzyTavSubLinea implements IServiceUzyTavSubLinea{
}
}
}
}
@Override
public
List
<
DtoUzyTavSubLinea
>
obtenerRegistrosPorLinea
(
Long
lineaID
)
{
List
<
ModelUzyTavSubLinea
>
entities
=
daoUzyTavSubLinea
.
obtenerRegistrosPorLinea
(
lineaID
);
return
mapper
.
entitiesToDtos
(
entities
);
}
@Override
@Override
public
boolean
eliminar
(
Long
id
)
{
public
boolean
eliminar
(
Long
id
)
{
ModelUzyTavSubLinea
entity
=
daoUzyTavSubLinea
.
findById
(
id
).
orElse
(
null
);
ModelUzyTavSubLinea
entity
=
daoUzyTavSubLinea
.
findById
(
id
).
orElse
(
null
);
...
...
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