diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java index 074cf444d..6ea27d9ce 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java @@ -29,6 +29,7 @@ import org.springframework.cache.CacheManager; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** @@ -54,7 +55,7 @@ public class SystemManagementResource implements SystemManagementRestApi { * @return HttpStatus.OK */ @Override - public ResponseEntity deleteTenant(final String tenant) { + public ResponseEntity deleteTenant(@PathVariable("tenant") final String tenant) { systemManagement.deleteTenant(tenant); return new ResponseEntity<>(HttpStatus.OK); } diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java index ca9b84df4..4333cfefb 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java @@ -25,6 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.ResourceSupport; 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; /** @@ -68,7 +70,7 @@ public class SystemResource implements SystemRestApi { * the response. */ @Override - public ResponseEntity deleteConfigurationValue(final String keyName) { + public ResponseEntity deleteConfigurationValue(@PathVariable("keyName") final String keyName) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); @@ -89,7 +91,8 @@ public class SystemResource implements SystemRestApi { * response. */ @Override - public ResponseEntity getConfigurationValue(final String keyName) { + public ResponseEntity getConfigurationValue( + @PathVariable("keyName") final String keyName) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); @@ -111,8 +114,9 @@ public class SystemResource implements SystemRestApi { * response. */ @Override - public ResponseEntity updateConfigurationValue(final String keyName, - final SystemTenantConfigurationValueRequest configurationValueRest) { + public ResponseEntity updateConfigurationValue( + @PathVariable("keyName") final String keyName, + @RequestBody final SystemTenantConfigurationValueRequest configurationValueRest) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName);