Streamline parameter names

This commit is contained in:
Tim
2025-05-24 14:07:05 +02:00
parent 022de8a3af
commit cf74672941

View File

@@ -15,8 +15,7 @@ import java.util.List;
import static de.htwsaar.webshop.config.ControllerPathConfig.IMAGE_BASE; import static de.htwsaar.webshop.config.ControllerPathConfig.IMAGE_BASE;
import static de.htwsaar.webshop.config.ControllerPathConfig.IMAGE_GET_ALL; import static de.htwsaar.webshop.config.ControllerPathConfig.IMAGE_GET_ALL;
import static de.htwsaar.webshop.config.ParameterConfig.PARAM_ARTICLE_ID; import static de.htwsaar.webshop.config.ParameterConfig.*;
import static de.htwsaar.webshop.config.ParameterConfig.PARAM_IMAGE_ID;
import static de.htwsaar.webshop.util.LoggerUtil.logRequest; import static de.htwsaar.webshop.util.LoggerUtil.logRequest;
@RestController @RestController
@@ -69,7 +68,7 @@ public class ImageController {
@RequestMapping(path = IMAGE_BASE, method = RequestMethod.PUT, produces = "application/json") @RequestMapping(path = IMAGE_BASE, method = RequestMethod.PUT, produces = "application/json")
public ResponseEntity<Boolean> update(HttpServletRequest request, public ResponseEntity<Boolean> update(HttpServletRequest request,
@RequestParam(value = PARAM_IMAGE_ID) Long imageId, @RequestParam(value = PARAM_ID) Long imageId,
@RequestBody Image image) { @RequestBody Image image) {
logRequest(request); logRequest(request);
if (imageId == null || imageService.getImageById(imageId) == null) { if (imageId == null || imageService.getImageById(imageId) == null) {
@@ -81,7 +80,7 @@ public class ImageController {
@RequestMapping(path = IMAGE_BASE, method = RequestMethod.DELETE, produces = "application/json") @RequestMapping(path = IMAGE_BASE, method = RequestMethod.DELETE, produces = "application/json")
public ResponseEntity<Boolean> delete(HttpServletRequest request, public ResponseEntity<Boolean> delete(HttpServletRequest request,
@RequestParam(value = PARAM_IMAGE_ID) Long imageId) { @RequestParam(value = PARAM_ID) Long imageId) {
logRequest(request); logRequest(request);
if (imageId == null) { if (imageId == null) {
log.warn("[{}] got invalid imageId", request.getRequestURI()); log.warn("[{}] got invalid imageId", request.getRequestURI());