Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nutritech
nutritechAPI
Commits
2c7fe008
Commit
2c7fe008
authored
6 years ago
by
Stefani Kopp
Browse files
Options
Download
Email Patches
Plain Diff
Ajuste de duplicidade de Cadastro
parent
559efc03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/br/com/gastronomia/bo/GrupoReceitasBO.java
+6
-3
src/br/com/gastronomia/bo/GrupoReceitasBO.java
src/br/com/gastronomia/controllers/GrupoController.java
+2
-1
src/br/com/gastronomia/controllers/GrupoController.java
with
8 additions
and
4 deletions
+8
-4
src/br/com/gastronomia/bo/GrupoReceitasBO.java
View file @
2c7fe008
...
...
@@ -26,10 +26,13 @@ public class GrupoReceitasBO {
public
boolean
createGroup
(
GrupoReceitas
grupo
)
throws
ValidationException
,
NoSuchAlgorithmException
{
if
(
grupo
!=
null
)
{
grupoReceitasDAO
.
save
(
grupo
);
return
true
;
try
{
grupoReceitasDAO
.
save
(
grupo
);
return
true
;
}
catch
(
Exception
e
)
{
throw
new
ValidationException
(
"Grupo já existente."
);
}
}
throw
new
ValidationException
(
"invalido"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/br/com/gastronomia/controllers/GrupoController.java
View file @
2c7fe008
...
...
@@ -60,12 +60,13 @@ public class GrupoController {
grupoReceitasBO
.
createGroup
(
grupoReceitas
);
}
catch
(
Exception
e
)
{
return
Response
.
ok
().
status
(
Response
.
Status
.
BAD_REQUEST
).
build
();
return
Response
.
ok
().
entity
(
new
StandardResponseDTO
(
true
,
e
.
getMessage
())).
status
(
Response
.
Status
.
BAD_REQUEST
).
build
();
}
return
Response
.
ok
().
entity
(
new
StandardResponseDTO
(
true
,
"Grupo de Receita "
+
grupoReceitas
.
getNome
()+
" criado com sucesso!"
)).
status
(
Response
.
Status
.
ACCEPTED
).
build
();
}
@DELETE
@Path
(
"/{id}"
)
@Produces
(
"application/json; charset=UTF-8"
)
...
...
This diff is collapsed.
Click to expand it.
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