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
e80c3cc8
Commit
e80c3cc8
authored
Jun 25, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se corrigen warnings en convoca
parent
3684bd1b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
+23
-18
UzyTavConvocaMapper.java
...ilidadWS/Mapper/Components_Class/UzyTavConvocaMapper.java
+8
-1
ModelUzyTavConvoca.java
.../espe/movilidad/MovilidadWS/Model/ModelUzyTavConvoca.java
+5
-3
IServiceUzyTavConvoca.java
...ilidadWS/Service/UzyTavConvoca/IServiceUzyTavConvoca.java
+7
-7
ServiceUzyTavConvoca.java
...vilidadWS/Service/UzyTavConvoca/ServiceUzyTavConvoca.java
+3
-7
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Mapper/Components_Class/UzyTavConvocaMapper.java
View file @
e80c3cc8
...
...
@@ -6,6 +6,9 @@ import org.modelmapper.ModelMapper;
import
org.modelmapper.PropertyMap
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Component
public
class
UzyTavConvocaMapper
{
private
final
ModelMapper
modelMapper
;
...
...
@@ -22,7 +25,11 @@ public class UzyTavConvocaMapper {
public
ModelUzyTavConvoca
dtoToEntity
(
DtoUzyTavConvoca
dto
)
{
return
modelMapper
.
map
(
dto
,
ModelUzyTavConvoca
.
class
);
}
public
List
<
DtoUzyTavConvoca
>
entitiesToDtos
(
List
<
ModelUzyTavConvoca
>
entities
)
{
return
entities
.
stream
()
.
map
(
this
::
entityToDto
)
.
collect
(
Collectors
.
toList
());
}
private
void
configureMappings
()
{
modelMapper
.
addMappings
(
new
PropertyMap
<
ModelUzyTavConvoca
,
DtoUzyTavConvoca
>()
{
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Model/ModelUzyTavConvoca.java
View file @
e80c3cc8
package
ec
.
edu
.
espe
.
movilidad
.
MovilidadWS
.
Model
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
org.springframework.web.multipart.MultipartFile
;
import
lombok.Getter
;
import
lombok.Setter
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
...
...
@@ -10,7 +11,8 @@ import javax.persistence.*;
import
java.util.Date
;
import
java.util.Set
;
@Data
@Getter
@Setter
@Entity
@Table
(
name
=
"uzytavconvoca"
,
schema
=
"UTIC1"
)
public
class
ModelUzyTavConvoca
{
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Service/UzyTavConvoca/IServiceUzyTavConvoca.java
View file @
e80c3cc8
...
...
@@ -7,17 +7,17 @@ import java.util.List;
public
interface
IServiceUzyTavConvoca
{
public
DtoUzyTavConvoca
ListarPorID
(
Long
id
);
DtoUzyTavConvoca
ListarPorID
(
Long
id
);
public
List
<
DtoUzyTavConvoca
>
ListarRegistros
();
List
<
DtoUzyTavConvoca
>
ListarRegistros
();
public
DtoUzyTavConvoca
save
(
DtoUzyTavConvoca
convocatoriaDTO
)
throws
IOException
;
DtoUzyTavConvoca
save
(
DtoUzyTavConvoca
convocatoriaDTO
)
throws
IOException
;
public
DtoUzyTavConvoca
edit
(
Long
uzytavconvocaId
,
DtoUzyTavConvoca
convocatoriaDTO
)
throws
IOException
;
DtoUzyTavConvoca
edit
(
Long
uzytavconvocaId
,
DtoUzyTavConvoca
convocatoriaDTO
)
throws
IOException
;
void
eliminar
(
Long
id
);
public
byte
[]
obtenerContenidoPDF
(
Long
convocaId
);
public
String
obtenerUrlPDF
(
Long
uzytavconvocaId
);
public
String
obtenerNombrePDF
(
Long
convocaId
);
byte
[]
obtenerContenidoPDF
(
Long
convocaId
);
String
obtenerUrlPDF
(
Long
uzytavconvocaId
);
String
obtenerNombrePDF
(
Long
convocaId
);
void
eliminarConPDF
(
Long
uzytavconvoca_id
);
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Service/UzyTavConvoca/ServiceUzyTavConvoca.java
View file @
e80c3cc8
...
...
@@ -12,7 +12,6 @@ import org.springframework.web.multipart.MultipartFile;
import
java.io.IOException
;
import
java.nio.file.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
public
class
ServiceUzyTavConvoca
implements
IServiceUzyTavConvoca
{
...
...
@@ -44,9 +43,7 @@ public class ServiceUzyTavConvoca implements IServiceUzyTavConvoca{
@Override
public
List
<
DtoUzyTavConvoca
>
ListarRegistros
()
{
List
<
ModelUzyTavConvoca
>
entities
=
daoUzyTavConvoca
.
findAll
();
return
entities
.
stream
()
.
map
(
modelMapper:
:
entityToDto
)
.
collect
(
Collectors
.
toList
());
return
modelMapper
.
entitiesToDtos
(
entities
);
}
@Override
...
...
@@ -101,7 +98,7 @@ public class ServiceUzyTavConvoca implements IServiceUzyTavConvoca{
Path
previousFilePath
=
rootFolder
.
resolve
(
previousFileName
);
Files
.
deleteIfExists
(
previousFilePath
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"Fa
iled to delete previous file:
"
+
previousFileName
,
e
);
throw
new
RuntimeException
(
"Fa
lló la eliminacion del archivo
"
+
previousFileName
,
e
);
}
}
...
...
@@ -162,8 +159,7 @@ public class ServiceUzyTavConvoca implements IServiceUzyTavConvoca{
ModelUzyTavConvoca
uzyTavConvoca
=
optionalUzyTavConvoca
.
get
();
String
fileName
=
uzyTavConvoca
.
getUzytavconvoca_digital_nombre
();
if
(
fileName
!=
null
&&
!
fileName
.
isEmpty
())
{
String
fileUrl
=
rootFolder
.
resolve
(
fileName
).
toString
();
return
fileUrl
;
return
rootFolder
.
resolve
(
fileName
).
toString
();
}
}
return
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