Merge pull request #1401 from rijusougata13

* pr/1401:
  Polish "Replace @Controller with @RestController"
  Replace @Controller with @RestController

Closes gh-1401
This commit is contained in:
Stephane Nicoll
2023-04-06 13:18:51 +02:00
3 changed files with 10 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,17 +29,17 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.ResponseEntity.BodyBuilder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* {@link Controller} that handles assistance for CLI support using a
* {@link RestController} that handles assistance for CLI support using a
* {@link CommandLineHelpGenerator}.
*
* @author Stephane Nicoll
*/
@Controller
@RestController
public class CommandLineMetadataController extends AbstractMetadataController {
private final CommandLineHelpGenerator commandLineHelpGenerator;

View File

@@ -51,21 +51,21 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* Base {@link Controller} that provides endpoints for project generation.
* Base {@link RestController} that provides endpoints for project generation.
*
* @param <R> the {@link ProjectRequest} type to use to bind request parameters
* @author Stephane Nicoll
*/
@Controller
@RestController
public abstract class ProjectGenerationController<R extends ProjectRequest> {
private static final Log logger = LogFactory.getLog(ProjectGenerationController.class);

View File

@@ -39,18 +39,17 @@ import org.springframework.http.CacheControl;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* {@link Controller} that exposes metadata and service configuration.
* {@link RestController} that exposes metadata and service configuration.
*
* @author Stephane Nicoll
*/
@Controller
@RestController
public class ProjectMetadataController extends AbstractMetadataController {
/**
@@ -67,7 +66,6 @@ public class ProjectMetadataController extends AbstractMetadataController {
}
@RequestMapping(path = "/metadata/config", produces = "application/json")
@ResponseBody
public InitializrMetadata config() {
return this.metadataProvider.get();
}