Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AGES-Adocoes
Adocoes
Commits
1cfeeb1f
Commit
1cfeeb1f
authored
7 years ago
by
Mateus Haas
Browse files
Options
Download
Email Patches
Plain Diff
#73 Modificar nomenclaturas para anonymous.
parent
e658b5ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/src/Menor/Entity.js
+3
-3
api/src/Menor/Entity.js
api/src/Menor/Interactor.js
+2
-2
api/src/Menor/Interactor.js
api/src/Menor/Translator.js
+1
-1
api/src/Menor/Translator.js
with
6 additions
and
6 deletions
+6
-6
api/src/Menor/Entity.js
View file @
1cfeeb1f
...
...
@@ -18,14 +18,14 @@ export default class Entity {
return
adapter
.
fetchAll
();
}
fetchAll
Reduced
()
{
fetchAll
Anonymous
()
{
const
adapter
=
new
this
.
Adapter
();
return
new
Promise
((
resolve
,
rjct
)
=>
{
//Retorna entidades do banco de dados
let
body
=
adapter
.
fetchAll
().
then
(
body
=>
{
//Para cada entidade, reduzir a quantidade das informações
return
body
.
map
(
this
.
_createNew
Reduced
DTO
);
return
body
.
map
(
this
.
_createNew
Anonymous
DTO
);
});
return
resolve
(
body
);
...
...
@@ -33,7 +33,7 @@ export default class Entity {
}
//Cria "DTO" com valores reduzidos
_createNew
Reduced
DTO
(
entity
)
{
_createNew
Anonymous
DTO
(
entity
)
{
//Transforma nome em somente iniciais
entity
.
nome
=
StringHelper
.
getOnlyNameInitials
(
entity
.
nome
);
...
...
This diff is collapsed.
Click to expand it.
api/src/Menor/Interactor.js
View file @
1cfeeb1f
...
...
@@ -17,9 +17,9 @@ export default class Interactor {
return
entity
.
fetchAll
();
}
fetchAll
Reduced
()
{
fetchAll
Anonymous
()
{
const
entity
=
new
this
.
Entity
();
return
entity
.
fetchAll
Reduced
();
return
entity
.
fetchAll
Anonymous
();
}
fetchById
(
id
)
{
...
...
This diff is collapsed.
Click to expand it.
api/src/Menor/Translator.js
View file @
1cfeeb1f
...
...
@@ -32,7 +32,7 @@ export default class Translator {
//Validar se a requisição atual possui escopo Anônimo
if
(
request
.
authInfo
.
scope
===
Roles
.
ANONYMOUS
)
interactorResult
=
interactor
.
fetchAll
Reduced
();
interactorResult
=
interactor
.
fetchAll
Anonymous
();
//Ou se possui escopo de Usuário/Admin
else
...
...
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
Menu
Projects
Groups
Snippets
Help