Skip to content

Commit

Permalink
Since Spring now only registers controllers with @controller and rela…
Browse files Browse the repository at this point in the history
…ted annotations adding @RestController annotations on controllers and fixing ordering, for details see: spring-projects/spring-framework#22154
  • Loading branch information
agrancaric committed Jan 31, 2023
1 parent bd44036 commit a6b628a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion nrich-encrypt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ endpoints (one for retrieving and one for updating account data) that looks like
```java

@RequiredArgsConstructor
@RestController
@RequestMapping("account")
@RestController
public class AccountController {

private final AccountService accountService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,23 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import jakarta.validation.Valid;
import java.util.List;

@RequiredArgsConstructor
@RequestMapping("${nrich.form-configuration.endpoint-path:nrich/form/configuration}")
@RestController
public class FormConfigurationController {

private final FormConfigurationService formConfigurationService;

@ResponseBody
@PostMapping("fetch-all")
public List<FormConfiguration> fetchAll() {
return formConfigurationService.fetchFormConfigurationList();
}

@ResponseBody
@PostMapping("fetch")
public List<FormConfiguration> fetch(@RequestBody @Valid FetchFormConfigurationRequest request) {
return formConfigurationService.fetchFormConfigurationList(request.getFormIdList());
Expand Down
4 changes: 2 additions & 2 deletions nrich-notification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ Example of manual providing:

```java
@RequiredArgsConstructor
@RestController
@RequestMapping("notification-example")
@RestController
public class ExampleController {

private final NotificationResponseService notificationResponseService;
Expand Down Expand Up @@ -369,8 +369,8 @@ Example of automatic resolving:

```java
@RequiredArgsConstructor
@RestController
@RequestMapping("notification-example")
@RestController
public class ExampleController {

private final NotificationResponseService notificationResponseService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import net.croz.nrich.registry.api.configuration.service.RegistryConfigurationService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequiredArgsConstructor
@RequestMapping("${nrich.registry.configuration.endpoint-path:nrich/registry/configuration}")
@ResponseBody
@RestController
public class RegistryConfigurationController {

private final RegistryConfigurationService registryConfigurationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import jakarta.validation.Valid;
import java.util.Map;

@RequiredArgsConstructor
@RequestMapping("${nrich.registry.data.endpoint-path:nrich/registry/data}")
@ResponseBody
@RestController
public class RegistryDataController {

private final RegistryDataService registryDataService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import jakarta.validation.Valid;

@RequiredArgsConstructor
@RequestMapping("${nrich.registry.history.endpoint-path:nrich/registry/history}")
@ResponseBody
@RestController
public class RegistryHistoryController {

private final RegistryHistoryService registryHistoryService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import net.croz.nrich.security.csrf.core.constants.CsrfConstants;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
Expand All @@ -28,12 +28,12 @@
* Used by client for csrf ping url
*/
@RequestMapping
@RestController
public class CsrfPingController {

private static final String SUCCESS_KEY = "success";

@RequestMapping("${nrich.security.csrf.endpoint-path:" + CsrfConstants.CSRF_DEFAULT_PING_URI + "}")
@ResponseBody
public Map<String, Boolean> ping() {
Map<String, Boolean> result = new HashMap<>();

Expand Down

0 comments on commit a6b628a

Please sign in to comment.