Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Adrian
/
EjemploDAE2020
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ada5d79e
authored
Dec 21, 2020
by
Adrian
Browse files
Options
_('Browse Files')
Download
Plain Diff
Commit merge con cambio de pc aulas
parents
99e81ed9
9936b8a3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
22 deletions
src/main/java/es/ujaen/dae/ujacoin/beans/Mapeador.java
src/main/java/es/ujaen/dae/ujacoin/beans/ServicioRestAPI.java
src/main/java/es/ujaen/dae/ujacoin/entidades/DTO/ClienteDTO.java
src/main/java/es/ujaen/dae/ujacoin/entidades/DTO/MovimientoDTO.java
src/main/java/es/ujaen/dae/ujacoin/beans/Mapeador.java
View file @
ada5d79e
...
...
@@ -11,8 +11,6 @@ import es.ujaen.dae.ujacoin.entidades.Tarjeta;
import
es.ujaen.dae.ujacoin.entidades.DTO.ClienteDTO
;
import
es.ujaen.dae.ujacoin.entidades.DTO.CuentaDTO
;
import
es.ujaen.dae.ujacoin.entidades.DTO.TarjetaDTO
;
import
java.time.LocalDate
;
import
org.springframework.hateoas.Link
;
import
org.springframework.hateoas.server.mvc.ControllerLinkBuilder
;
import
org.springframework.stereotype.Service
;
...
...
@@ -25,13 +23,13 @@ public class Mapeador {
public
ClienteDTO
aClienteDTO
(
Cliente
cliente
)
{
ClienteDTO
clienteDTO
=
new
ClienteDTO
(
cliente
.
getDni
(),
ClienteDTO
clienteDTO
=
new
ClienteDTO
(
cliente
.
getDni
(),
cliente
.
getNombre
(),
cliente
.
getFechaNacimiento
(),
cliente
.
getDireccion
(),
cliente
.
getTelefono
(),
cliente
.
getEmail
(),
cliente
.
getClave
());
cliente
.
getEmail
());
for
(
String
cuenta
:
cliente
.
getCuentasAsociadas
().
keySet
())
{
clienteDTO
.
a
ñ
adirCuenta
(
ControllerLinkBuilder
.
linkTo
(
ControllerLinkBuilder
.
methodOn
(
ServicioRestAPI
.
class
).
detalleCuenta
(
cliente
.
getDni
(),
cuenta
)).
withSelfRel
());
...
...
src/main/java/es/ujaen/dae/ujacoin/beans/ServicioRestAPI.java
View file @
ada5d79e
...
...
@@ -44,7 +44,7 @@ public class ServicioRestAPI {
return
new
ResponseEntity
<>(
entero
-
1
,
HttpStatus
.
OK
);
}
}
@GetMapping
(
"/clientes/{dni}"
)
public
ResponseEntity
<
ClienteDTO
>
loginCliente
(
@PathVariable
String
dni
)
{
...
...
@@ -69,7 +69,7 @@ public class ServicioRestAPI {
return
new
ResponseEntity
<>(
mapper
.
aClienteDTO
(
cliente
),
HttpStatus
.
OK
);
}
@GetMapping
(
"/clientes/{dni}/cuentas/{num}"
)
public
ResponseEntity
<
CuentaDTO
>
detalleCuenta
(
@PathVariable
String
dni
,
@PathVariable
String
num
)
{
...
...
src/main/java/es/ujaen/dae/ujacoin/entidades/DTO/ClienteDTO.java
View file @
ada5d79e
...
...
@@ -31,14 +31,13 @@ public class ClienteDTO {
public
ClienteDTO
()
{
}
public
ClienteDTO
(
String
dni
,
String
nombre
,
LocalDate
fechaNacimiento
,
String
direccion
,
String
telefono
,
String
email
,
String
clave
)
{
public
ClienteDTO
(
String
dni
,
String
nombre
,
LocalDate
fechaNacimiento
,
String
direccion
,
String
telefono
,
String
email
)
{
this
.
dni
=
dni
;
this
.
nombre
=
nombre
;
this
.
fechaNacimiento
=
fechaNacimiento
;
this
.
direccion
=
direccion
;
this
.
telefono
=
telefono
;
this
.
email
=
email
;
this
.
clave
=
clave
;
this
.
cuentasAsociadas
=
new
ArrayList
<>();
this
.
tarjetasAsociadas
=
new
ArrayList
<>();
}
...
...
src/main/java/es/ujaen/dae/ujacoin/entidades/DTO/MovimientoDTO.java
View file @
ada5d79e
...
...
@@ -15,7 +15,6 @@ import java.time.LocalDateTime;
*/
public
class
MovimientoDTO
{
private
int
identificador
;
private
TipoMovimiento
tipo
;
private
float
importe
;
private
LocalDateTime
fechaHora
;
...
...
@@ -24,14 +23,6 @@ public class MovimientoDTO {
public
MovimientoDTO
()
{
}
public
MovimientoDTO
(
int
identificador
,
TipoMovimiento
tipo
,
float
importe
,
LocalDateTime
fechaHora
,
String
tarjetaCuenta
)
{
this
.
identificador
=
identificador
;
this
.
tipo
=
tipo
;
this
.
importe
=
importe
;
this
.
fechaHora
=
fechaHora
;
this
.
tarjetaCuenta
=
tarjetaCuenta
;
}
public
MovimientoDTO
(
TipoMovimiento
tipo
,
float
importe
,
LocalDateTime
fechaHora
,
String
tarjetaCuenta
)
{
this
.
tipo
=
tipo
;
...
...
@@ -51,10 +42,6 @@ public class MovimientoDTO {
return
tarjetaCuenta
;
}
public
int
getIdentificador
()
{
return
identificador
;
}
public
LocalDateTime
getFechaHora
()
{
return
fechaHora
;
}
...
...
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