Streamline parameter names
This commit is contained in:
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user