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
74c5342c
Commit
74c5342c
authored
Jul 27, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se corrigen las excepciones de ServiceUzyTPerfilMenu
parent
6cb1d979
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
ServiceUzyTPerfilMenu.java
...lidadWS/Service/UzyTPerfilMenu/ServiceUzyTPerfilMenu.java
+4
-14
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Service/UzyTPerfilMenu/ServiceUzyTPerfilMenu.java
View file @
74c5342c
...
@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
...
@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
@Service
@Service
public
class
ServiceUzyTPerfilMenu
implements
IServiceUzyTPerfilMenu
{
public
class
ServiceUzyTPerfilMenu
implements
IServiceUzyTPerfilMenu
{
...
@@ -44,27 +43,18 @@ public class ServiceUzyTPerfilMenu implements IServiceUzyTPerfilMenu {
...
@@ -44,27 +43,18 @@ public class ServiceUzyTPerfilMenu implements IServiceUzyTPerfilMenu {
List
<
ModelUzyTPerfilMenu
>
entities
=
daoUzyTPerfilMenu
.
findAll
();
List
<
ModelUzyTPerfilMenu
>
entities
=
daoUzyTPerfilMenu
.
findAll
();
return
mapper
.
entitiesToDtos
(
entities
);
return
mapper
.
entitiesToDtos
(
entities
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
throw
new
RuntimeException
(
"Error al listar registros
de usuarios:
"
+
ex
.
getMessage
());
throw
new
RuntimeException
(
"Error al listar registros"
+
ex
.
getMessage
());
}
}
}
}
@Override
@Override
public
DtoUzyTPerfilMenu
guardar
(
DtoUzyTPerfilMenu
dtoUzyTPerfilMenu
)
{
public
DtoUzyTPerfilMenu
guardar
(
DtoUzyTPerfilMenu
dtoUzyTPerfilMenu
)
{
if
(
Objects
.
isNull
(
dtoUzyTPerfilMenu
.
getUzytmedu_id
()))
{
throw
new
IllegalArgumentException
(
"El ID del menú no puede ser nulo."
);
}
if
(
Objects
.
isNull
(
dtoUzyTPerfilMenu
.
getUzytperfil_id
()))
{
throw
new
IllegalArgumentException
(
"El ID del perfil no puede ser nulo."
);
}
if
(
Objects
.
isNull
(
dtoUzyTPerfilMenu
.
getUzytlinea_operativa_id
()))
{
throw
new
IllegalArgumentException
(
"El ID de la línea operativa no puede ser nulo."
);
}
try
{
try
{
ModelUzyTPerfilMenu
entity
=
mapper
.
dtoToEntity
(
dtoUzyTPerfilMenu
);
ModelUzyTPerfilMenu
entity
=
mapper
.
dtoToEntity
(
dtoUzyTPerfilMenu
);
ModelUzyTPerfilMenu
nuevoEntity
=
daoUzyTPerfilMenu
.
save
(
entity
);
ModelUzyTPerfilMenu
nuevoEntity
=
daoUzyTPerfilMenu
.
save
(
entity
);
return
mapper
.
entityToDto
(
nuevoEntity
);
return
mapper
.
entityToDto
(
nuevoEntity
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
throw
new
RuntimeException
(
"Error al guardar el
usuari
o: "
+
ex
.
getMessage
());
throw
new
RuntimeException
(
"Error al guardar el
registr
o: "
+
ex
.
getMessage
());
}
}
}
}
...
@@ -81,7 +71,7 @@ public class ServiceUzyTPerfilMenu implements IServiceUzyTPerfilMenu {
...
@@ -81,7 +71,7 @@ public class ServiceUzyTPerfilMenu implements IServiceUzyTPerfilMenu {
}
catch
(
ResourceNotFoundException
ex
)
{
}
catch
(
ResourceNotFoundException
ex
)
{
throw
ex
;
throw
ex
;
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
throw
new
RuntimeException
(
"Error al editar el
usuari
o -> "
+
ex
.
getMessage
());
throw
new
RuntimeException
(
"Error al editar el
registr
o -> "
+
ex
.
getMessage
());
}
}
}
}
...
@@ -101,7 +91,7 @@ public class ServiceUzyTPerfilMenu implements IServiceUzyTPerfilMenu {
...
@@ -101,7 +91,7 @@ public class ServiceUzyTPerfilMenu implements IServiceUzyTPerfilMenu {
}
catch
(
ResourceNotFoundException
ex
)
{
}
catch
(
ResourceNotFoundException
ex
)
{
throw
ex
;
throw
ex
;
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
throw
new
RuntimeException
(
"Error al eliminar el
usuari
o: "
+
ex
.
getMessage
());
throw
new
RuntimeException
(
"Error al eliminar el
registr
o: "
+
ex
.
getMessage
());
}
}
}
}
}
}
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