From 13923367eee24d3b78bb690f55f63e891a8bb60f Mon Sep 17 00:00:00 2001 From: Avgustin Marinov Date: Sun, 17 Nov 2024 19:09:06 +0200 Subject: [PATCH] DDI resource - remove dupplicated annotations (MgmtTenantManagementRestResource) (#2066) Signed-off-by: Avgustin Marinov --- .../mgmt/rest/api/MgmtTenantManagementRestApi.java | 6 ++++-- .../rest/resource/MgmtTenantManagementResource.java | 11 ++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hawkbit-mgmt/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTenantManagementRestApi.java b/hawkbit-mgmt/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTenantManagementRestApi.java index 0b54061d4..49ba53ee6 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTenantManagementRestApi.java +++ b/hawkbit-mgmt/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTenantManagementRestApi.java @@ -131,7 +131,8 @@ public interface MgmtTenantManagementRestApi { }) @GetMapping(value = MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getTenantConfigurationValue(@PathVariable("keyName") String keyName); + ResponseEntity getTenantConfigurationValue( + @PathVariable("keyName") String keyName); /** * Handles the PUT request for updating a tenant specific configuration value. @@ -174,7 +175,8 @@ public interface MgmtTenantManagementRestApi { consumes = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE }) ResponseEntity updateTenantConfigurationValue( - @PathVariable("keyName") String keyName, MgmtSystemTenantConfigurationValueRequest configurationValueRest); + @PathVariable("keyName") String keyName, + @RequestBody MgmtSystemTenantConfigurationValueRequest configurationValueRest); /** * Handles the PUT request for updating a batch of tenant specific configurations diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResource.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResource.java index 12fd2f227..9e566268b 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResource.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResource.java @@ -27,8 +27,6 @@ import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; /** @@ -74,7 +72,7 @@ public class MgmtTenantManagementResource implements MgmtTenantManagementRestApi } @Override - public ResponseEntity deleteTenantConfigurationValue(@PathVariable("keyName") final String keyName) { + public ResponseEntity deleteTenantConfigurationValue(final String keyName) { //Default DistributionSet Type cannot be deleted as is part of TenantMetadata if (isDefaultDistributionSetTypeKey(keyName)) { return ResponseEntity.badRequest().build(); @@ -87,15 +85,14 @@ public class MgmtTenantManagementResource implements MgmtTenantManagementRestApi } @Override - public ResponseEntity getTenantConfigurationValue( - @PathVariable("keyName") final String keyName) { + public ResponseEntity getTenantConfigurationValue(final String keyName) { return ResponseEntity.ok(loadTenantConfigurationValueBy(keyName)); } @Override public ResponseEntity updateTenantConfigurationValue( - @PathVariable("keyName") final String keyName, - @RequestBody final MgmtSystemTenantConfigurationValueRequest configurationValueRest) { + final String keyName, + final MgmtSystemTenantConfigurationValueRequest configurationValueRest) { Serializable configurationValue = configurationValueRest.getValue(); final MgmtSystemTenantConfigurationValue responseUpdatedValue; if (isDefaultDistributionSetTypeKey(keyName)) {