Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aceite-tecnico-frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Renan de Jesus Montenegro da Silva
aceite-tecnico-frontend
Commits
90f0a050
Commit
90f0a050
authored
Jun 05, 2025
by
RenanMontenegro3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"feat:adição do environment.ts"
parent
33475603
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
30 deletions
+38
-30
black-list.service.ts
src/app/services/Blacklists/black-list.service.ts
+11
-12
aceite.service.ts
src/app/services/aceites/aceite.service.ts
+4
-3
bercos.service.ts
src/app/services/bercos/bercos.service.ts
+9
-8
login.service.ts
src/app/services/login.service.ts
+3
-2
navio.service.ts
src/app/services/navio.service.ts
+4
-3
user.service.ts
src/app/services/users/user.service.ts
+3
-2
environment.ts
src/environments/environment.ts
+4
-0
No files found.
src/app/services/Blacklists/black-list.service.ts
View file @
90f0a050
...
...
@@ -4,16 +4,16 @@ import { catchError, tap } from 'rxjs/operators';
import
{
AsyncValidatorFn
,
AbstractControl
,
ValidationErrors
,
Validators
}
from
'
@angular/forms
'
;
import
{
map
}
from
'
rxjs/operators
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
environment
}
from
'
../../../environments/environment
'
;
// Importa o environment
@
Injectable
({
providedIn
:
'
root
'
})
export
class
BlackListService
{
users
:
any
[]
=
[];
private
apiUrl
=
'
http://localhost:8080/api/black-list
'
;
private
apiUrl_verifica_imo
=
'
http://localhost:8080/api/vdatas
'
;
users
:
any
[]
=
[];
private
apiUrl
=
environment
.
API_URL
+
'
/api/black-list
'
;
private
apiUrl_verifica_imo
=
environment
.
API_URL
+
'
/api/vdatas
'
;
constructor
(
private
_http
:
HttpClient
)
{}
...
...
@@ -23,7 +23,7 @@ export class BlackListService {
this
.
users
=
res
;
}),
catchError
(
error
=>
{
return
throwError
(
error
);
return
throwError
(
error
);
}));
}
...
...
@@ -33,16 +33,15 @@ export class BlackListService {
this
.
users
=
res
;
}),
catchError
(
error
=>
{
return
throwError
(
error
);
return
throwError
(
error
);
}));
}
getEmployeeList
(
pageIndex
:
number
,
pageSize
:
number
):
Observable
<
any
>
{
let
params
=
new
HttpParams
()
.
set
(
'
page
'
,
pageIndex
.
toString
())
.
set
(
'
size
'
,
pageSize
.
toString
());
return
this
.
_http
.
get
<
any
>
(
this
.
apiUrl
,
{
params
}).
pipe
(
tap
((
res
:
any
)
=>
{
this
.
users
=
res
;
...
...
@@ -60,7 +59,7 @@ export class BlackListService {
this
.
users
=
res
;
}),
catchError
(
error
=>
{
return
throwError
(
error
);
return
throwError
(
error
);
})
);
}
...
...
@@ -73,7 +72,7 @@ export class BlackListService {
}),
catchError
(
error
=>
{
console
.
log
(
error
)
return
throwError
(
error
);
return
throwError
(
error
);
})
);
}
...
...
@@ -84,7 +83,7 @@ export class BlackListService {
this
.
users
=
res
;
}),
catchError
(
error
=>
{
return
throwError
(
error
);
return
throwError
(
error
);
}));
}
}
\ No newline at end of file
}
src/app/services/aceites/aceite.service.ts
View file @
90f0a050
...
...
@@ -5,19 +5,20 @@ import { AsyncValidatorFn, AbstractControl, ValidationErrors, Validators } from
import
{
map
}
from
'
rxjs/operators
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
of
}
from
'
rxjs
'
;
import
{
environment
}
from
'
../../../environments/environment
'
;
// Importa o environment
@
Injectable
({
providedIn
:
'
root
'
})
export
class
AceiteService
{
users
:
any
[]
=
[];
private
apiUrl
=
'
http://localhost:8080
/api/accepts
'
;
private
apiUrl_verifica_imo
=
'
http://localhost:8080
/api/vdatas
'
;
private
apiUrl
=
environment
.
API_URL
+
'
/api/accepts
'
;
private
apiUrl_verifica_imo
=
environment
.
API_URL
+
'
/api/vdatas
'
;
constructor
(
private
_http
:
HttpClient
)
{
}
addAceite
(
data
:
any
,
foto
:
File
|
null
):
Observable
<
any
>
{
console
.
log
(
JSON
.
stringify
(
JSON
.
stringify
(
data
)));
...
...
src/app/services/bercos/bercos.service.ts
View file @
90f0a050
...
...
@@ -5,6 +5,7 @@ import { AsyncValidatorFn, AbstractControl, ValidationErrors, Validators } from
import
{
map
}
from
'
rxjs/operators
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
of
}
from
'
rxjs
'
;
import
{
environment
}
from
'
../../../environments/environment
'
;
// Importa o environment
@
Injectable
({
providedIn
:
'
root
'
...
...
@@ -12,12 +13,12 @@ import { of } from 'rxjs';
export
class
BercosService
{
users
:
any
[]
=
[];
private
apiUrl
=
'
http://localhost:8080
/api/bercos
'
;
private
apiUrl
=
environment
.
API_URL
+
'
/api/bercos
'
;
constructor
(
private
_http
:
HttpClient
)
{}
addEmployee
(
data
:
any
):
Observable
<
any
>
{
return
this
.
_http
.
post
(
this
.
apiUrl
,
data
).
pipe
(
...
...
@@ -36,7 +37,7 @@ export class BercosService {
this
.
users
=
res
;
}),
catchError
(
error
=>
{
return
throwError
(
error
);
return
throwError
(
error
);
}));
}
...
...
@@ -62,7 +63,7 @@ export class BercosService {
this
.
users
=
res
;
}),
catchError
(
error
=>
{
return
throwError
(
error
);
return
throwError
(
error
);
})
);
}
...
...
@@ -73,7 +74,7 @@ export class BercosService {
this
.
users
=
res
;
}),
catchError
(
error
=>
{
return
throwError
(
error
);
return
throwError
(
error
);
}));
}
...
...
@@ -90,7 +91,7 @@ export class BercosService {
searchBerco
(
data
:
any
):
Observable
<
any
>
{
let
params
=
new
HttpParams
();
// Adiciona os parâmetros de forma condicional (apenas se existirem)
if
(
data
.
categoria
)
{
params
=
params
.
set
(
'
categoria
'
,
data
.
categoria
);
...
...
@@ -98,7 +99,7 @@ export class BercosService {
if
(
data
.
nome
)
{
params
=
params
.
set
(
'
nome
'
,
data
.
nome
);
}
// Faz a requisição GET com os parâmetros
return
this
.
_http
.
get
<
any
>
(
`
${
this
.
apiUrl
}
/custom`
,
{
params
}).
pipe
(
tap
((
res
:
any
)
=>
{
...
...
@@ -107,7 +108,7 @@ export class BercosService {
}),
catchError
(
error
=>
{
console
.
error
(
'
Erro ao buscar dados:
'
,
error
);
return
throwError
(
error
);
return
throwError
(
error
);
})
);
}
...
...
src/app/services/login.service.ts
View file @
90f0a050
...
...
@@ -2,12 +2,13 @@ import { HttpClient } from '@angular/common/http';
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
LoginResponse
}
from
'
../types/login-response.type
'
;
import
{
tap
}
from
'
rxjs
'
;
import
{
environment
}
from
'
../../environments/environment
'
;
// Importa o environment
@
Injectable
({
providedIn
:
'
root
'
})
export
class
LoginService
{
apiUrl
:
string
=
"
http://localhost:8080/api/auth
"
apiUrl
:
string
=
environment
.
API_URL
+
"
/api/auth
"
;
// Usa a variável do environment
constructor
(
private
httpClient
:
HttpClient
)
{
}
...
...
@@ -29,4 +30,4 @@ export class LoginService {
})
);
}
}
\ No newline at end of file
}
src/app/services/navio.service.ts
View file @
90f0a050
...
...
@@ -6,14 +6,15 @@ import {
}
from
'
@angular/common/http
'
;
import
{
Observable
,
throwError
}
from
'
rxjs
'
;
import
{
catchError
,
tap
}
from
'
rxjs/operators
'
;
import
{
environment
}
from
'
../../environments/environment
'
;
// Importa o environment
@
Injectable
({
providedIn
:
'
root
'
,
})
export
class
NavioService
{
users
:
any
[]
=
[];
private
apiUrl
=
'
http://localhost:8080
/api/vessels
'
;
private
apiUrlDash
=
'
http://localhost:8080
/statistics/all
'
;
private
apiUrl
=
environment
.
API_URL
+
'
/api/vessels
'
;
private
apiUrlDash
=
environment
.
API_URL
+
'
/statistics/all
'
;
constructor
(
private
_http
:
HttpClient
)
{}
addEmployee1
(
data
:
any
,
foto
:
File
):
Observable
<
any
>
{
...
...
@@ -172,5 +173,5 @@ export class NavioService {
);
}
}
src/app/services/users/user.service.ts
View file @
90f0a050
import
{
HttpClient
,
HttpParams
}
from
'
@angular/common/http
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
catchError
,
Observable
,
tap
,
throwError
}
from
'
rxjs
'
;
import
{
environment
}
from
'
../../../environments/environment
'
;
// Importa o environment
@
Injectable
({
providedIn
:
'
root
'
})
export
class
UserService
{
private
apiUrl
=
'
http://localhost:8080/api/users
'
;
// Certifique-se de que a URL está correta
private
apiUrl
=
environment
.
API_URL
+
'
/api/users
'
;
// Usa a variável do environment
private
users
:
any
;
// Adicione a propriedade users
constructor
(
private
_http
:
HttpClient
)
{}
...
...
@@ -30,7 +31,7 @@ export class UserService {
sendEmail
(
userId
:
number
,
sendEmail
:
boolean
):
Observable
<
any
>
{
const
url
=
`
${
this
.
apiUrl
}
/
${
userId
}
`
;
// Monta a URL para o usuário específico
const
body
=
{
sendEmail
:
sendEmail
?
1
:
0
};
// Envia 1 para true e 0 para false
return
this
.
_http
.
put
<
any
>
(
url
,
body
).
pipe
(
tap
(()
=>
{
console
.
log
(
`Email status atualizado para o usuário com ID:
${
userId
}
`
);
...
...
src/environments/environment.ts
0 → 100644
View file @
90f0a050
export
const
environment
=
{
production
:
false
,
API_URL
:
'
http://aceite-tecnico-back:9090
'
};
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