Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be77803d96 |
@@ -7,11 +7,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type HttpClient struct {
|
type HttpClient struct {
|
||||||
|
baseURL string
|
||||||
userAgent string
|
userAgent string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHttpClient() *HttpClient {
|
func NewHttpClient(apiURL string) *HttpClient {
|
||||||
return &HttpClient{userAgent: "internal-http-client"}
|
return &HttpClient{baseURL: apiURL, userAgent: "internal-http-client"}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *HttpClient) SendGet(api, url string, data, out any) error {
|
func (c *HttpClient) SendGet(api, url string, data, out any) error {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
identity "git.ego.freeddns.org/egommerce/api-entities/identity/dto"
|
identity "git.ego.freeddns.org/egommerce/api-entities/identity/dto"
|
||||||
|
cnf "git.ego.freeddns.org/egommerce/go-api-pkg/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IdentityAPI struct {
|
type IdentityAPI struct {
|
||||||
@@ -9,7 +10,7 @@ type IdentityAPI struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewIdentityAPI() *IdentityAPI {
|
func NewIdentityAPI() *IdentityAPI {
|
||||||
return &IdentityAPI{NewHttpClient()}
|
return &IdentityAPI{NewHttpClient(cnf.GetEnv("API_REST_IDENTITY", "identity-svc"))}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *IdentityAPI) CheckAccess(url, srv string) (*identity.CheckAccessResponseDTO, error) {
|
func (a *IdentityAPI) CheckAccess(url, srv string) (*identity.CheckAccessResponseDTO, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user