-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: audit is now dynamic to gtw-config
- Loading branch information
Showing
17 changed files
with
258 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/it/finanze/sanita/fse2/ms/gtw/dispatcher/client/routes/ConfigClientRoutes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
* | ||
* Copyright (C) 2023 Ministero della Salute | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package it.finanze.sanita.fse2.ms.gtw.dispatcher.client.routes; | ||
|
||
import it.finanze.sanita.fse2.ms.gtw.dispatcher.enums.ConfigItemTypeEnum; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.util.UriComponentsBuilder; | ||
|
||
import static it.finanze.sanita.fse2.ms.gtw.dispatcher.client.routes.base.ClientRoutes.Config.*; | ||
|
||
|
||
@Component | ||
public final class ConfigClientRoutes { | ||
|
||
@Value("${ms.url.gtw-config}") | ||
private String host; | ||
|
||
public UriComponentsBuilder base() { | ||
return UriComponentsBuilder.fromHttpUrl(host); | ||
} | ||
|
||
public String identifier() { | ||
return IDENTIFIER; | ||
} | ||
|
||
public String microservice() { | ||
return IDENTIFIER_MS; | ||
} | ||
|
||
public String status() { | ||
return base() | ||
.pathSegment(API_STATUS) | ||
.build() | ||
.toUriString(); | ||
} | ||
|
||
public String whois() { | ||
return base() | ||
.pathSegment(API_WHOIS) | ||
.build() | ||
.toUriString(); | ||
} | ||
|
||
public String getConfigItem(ConfigItemTypeEnum type, String props) { | ||
return base() | ||
.pathSegment(API_VERSION, API_CONFIG_ITEMS, API_PROPS) | ||
.queryParam(QP_TYPE, type.name()) | ||
.queryParam(QP_PROPS, props) | ||
.build() | ||
.toUriString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.