Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BackEnd-V1
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-V1
Commits
59e45287
Commit
59e45287
authored
May 24, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agregado los servicios de la tabla SZDTAVPRESUP
parent
308d7658
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
2 deletions
+115
-2
TavPresupController.java
...movilidad/MovilidadWS/controller/TavPresupController.java
+55
-0
ModelTavClassPre.java
...du/espe/movilidad/MovilidadWS/model/ModelTavClassPre.java
+1
-1
ModelTavPresup.java
.../edu/espe/movilidad/MovilidadWS/model/ModelTavPresup.java
+1
-1
ISerciveTavPresup.java
...espe/movilidad/MovilidadWS/service/ISerciveTavPresup.java
+13
-0
ServiceTavPresup.java
.../espe/movilidad/MovilidadWS/service/ServiceTavPresup.java
+45
-0
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/controller/TavPresupController.java
0 → 100644
View file @
59e45287
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
controller
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelTavClassPre
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelTavPresup
;
import
ec.edu.espe.movilidad.MovilidadWS.service.ISerciveTavPresup
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
static
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
Constant
.
GlobalConstants
.
V1_API_VERSION
;
@RestController
@CrossOrigin
(
origins
=
"*"
)
@RequestMapping
(
V1_API_VERSION
+
"/TavPresup"
)
public
class
TavPresupController
{
@Autowired
private
ISerciveTavPresup
serciveTavPresup
;
@GetMapping
(
"/exampleFindId/{id}"
)
public
ResponseEntity
<
ModelTavPresup
>
ListarPorID
(
@PathVariable
Long
id
)
{
return
new
ResponseEntity
<>(
serciveTavPresup
.
ListarPorID
(
id
),
HttpStatus
.
OK
);
}
@GetMapping
(
"/getAll"
)
public
ResponseEntity
<
List
<
ModelTavPresup
>>
ListarRegistros
()
{
return
new
ResponseEntity
<>(
serciveTavPresup
.
ListarRegistros
(),
HttpStatus
.
OK
);
}
@PostMapping
(
"/guardar"
)
public
ResponseEntity
<
ModelTavPresup
>
guardar
(
@RequestBody
ModelTavPresup
modelTavPresup
)
{
return
new
ResponseEntity
<>(
serciveTavPresup
.
guardar
(
modelTavPresup
),
HttpStatus
.
OK
);
}
@PutMapping
(
"/editar/{id}"
)
public
ResponseEntity
<
ModelTavPresup
>
editar
(
@PathVariable
Long
id
,
@RequestBody
ModelTavPresup
modelTavPresup
)
{
return
new
ResponseEntity
<>(
serciveTavPresup
.
editar
(
id
,
modelTavPresup
),
HttpStatus
.
OK
);
}
@DeleteMapping
(
"/eliminar/{id}"
)
public
ResponseEntity
<
Void
>
eliminar
(
@PathVariable
Long
id
)
{
serciveTavPresup
.
eliminar
(
id
);
return
ResponseEntity
.
ok
().
build
();
}
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/model/ModelTavClassPre.java
View file @
59e45287
...
...
@@ -8,7 +8,7 @@ import java.util.ArrayList;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
//Tabla padre
@Data
@Entity
@Table
(
name
=
"SZDTAVCLASPRE"
)
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/model/ModelTavPresup.java
View file @
59e45287
...
...
@@ -5,7 +5,7 @@ import lombok.Data;
import
javax.persistence.*
;
import
java.util.List
;
//Tabla Hija
@Data
@Entity
@Table
(
name
=
"SZDTAVPRESUP"
)
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/ISerciveTavPresup.java
View file @
59e45287
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
service
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelTavClassPre
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelTavPresup
;
import
java.util.List
;
public
interface
ISerciveTavPresup
{
public
ModelTavPresup
ListarPorID
(
Long
id
);
public
List
<
ModelTavPresup
>
ListarRegistros
();
public
ModelTavPresup
guardar
(
ModelTavPresup
modelTavPresup
);
public
ModelTavPresup
editar
(
Long
id
,
ModelTavPresup
modelTavPresup
);
void
eliminar
(
Long
id
);
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/ServiceTavPresup.java
0 → 100644
View file @
59e45287
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
service
;
import
ec.edu.espe.movilidad.MovilidadWS.dao.DaoTavPresup
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelTavClassPre
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelTavPresup
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.List
;
@Service
public
class
ServiceTavPresup
implements
ISerciveTavPresup
{
@Autowired
DaoTavPresup
daoTavPresup
;
@Override
public
ModelTavPresup
ListarPorID
(
@PathVariable
Long
id
)
{
return
daoTavPresup
.
findById
(
id
).
get
();
}
@Override
public
List
<
ModelTavPresup
>
ListarRegistros
()
{
return
daoTavPresup
.
findAll
();
}
@Override
public
ModelTavPresup
guardar
(
ModelTavPresup
modelTavPresup
)
{
return
daoTavPresup
.
save
(
modelTavPresup
);
}
@Override
public
ModelTavPresup
editar
(
Long
id
,
ModelTavPresup
modelTavPresup
)
{
return
null
;
}
@Override
public
void
eliminar
(
Long
id
)
{
ModelTavPresup
example
=
daoTavPresup
.
findById
(
id
).
get
();
//.orElseThrow(() -> new ControlExcepciones("No existe el registro con el ID : " + id));
daoTavPresup
.
delete
(
example
);
}
}
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