Skip to content

Commit a791f13

Browse files
committed
Since Spring now only registers controllers with @controller and related annotations adding @RestController annotations on controllers and fixing ordering, for details see: spring-projects/spring-framework#22154
1 parent a6a383e commit a791f13

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

nrich-encrypt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ endpoints (one for retrieving and one for updating account data) that looks like
7676
```java
7777

7878
@RequiredArgsConstructor
79-
@RestController
8079
@RequestMapping("account")
80+
@RestController
8181
public class AccountController {
8282

8383
private final AccountService accountService;

nrich-form-configuration/src/main/java/net/croz/nrich/formconfiguration/controller/FormConfigurationController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,23 @@
2424
import org.springframework.web.bind.annotation.PostMapping;
2525
import org.springframework.web.bind.annotation.RequestBody;
2626
import org.springframework.web.bind.annotation.RequestMapping;
27-
import org.springframework.web.bind.annotation.ResponseBody;
27+
import org.springframework.web.bind.annotation.RestController;
2828

2929
import jakarta.validation.Valid;
3030
import java.util.List;
3131

3232
@RequiredArgsConstructor
3333
@RequestMapping("${nrich.form-configuration.endpoint-path:nrich/form/configuration}")
34+
@RestController
3435
public class FormConfigurationController {
3536

3637
private final FormConfigurationService formConfigurationService;
3738

38-
@ResponseBody
3939
@PostMapping("fetch-all")
4040
public List<FormConfiguration> fetchAll() {
4141
return formConfigurationService.fetchFormConfigurationList();
4242
}
4343

44-
@ResponseBody
4544
@PostMapping("fetch")
4645
public List<FormConfiguration> fetch(@RequestBody @Valid FetchFormConfigurationRequest request) {
4746
return formConfigurationService.fetchFormConfigurationList(request.getFormIdList());

nrich-notification/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ Example of manual providing:
325325

326326
```java
327327
@RequiredArgsConstructor
328-
@RestController
329328
@RequestMapping("notification-example")
329+
@RestController
330330
public class ExampleController {
331331

332332
private final NotificationResponseService notificationResponseService;
@@ -369,8 +369,8 @@ Example of automatic resolving:
369369

370370
```java
371371
@RequiredArgsConstructor
372-
@RestController
373372
@RequestMapping("notification-example")
373+
@RestController
374374
public class ExampleController {
375375

376376
private final NotificationResponseService notificationResponseService;

nrich-registry/src/main/java/net/croz/nrich/registry/configuration/controller/RegistryConfigurationController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
import net.croz.nrich.registry.api.configuration.service.RegistryConfigurationService;
2323
import org.springframework.web.bind.annotation.PostMapping;
2424
import org.springframework.web.bind.annotation.RequestMapping;
25-
import org.springframework.web.bind.annotation.ResponseBody;
25+
import org.springframework.web.bind.annotation.RestController;
2626

2727
import java.util.List;
2828

2929
@RequiredArgsConstructor
3030
@RequestMapping("${nrich.registry.configuration.endpoint-path:nrich/registry/configuration}")
31-
@ResponseBody
31+
@RestController
3232
public class RegistryConfigurationController {
3333

3434
private final RegistryConfigurationService registryConfigurationService;

nrich-registry/src/main/java/net/croz/nrich/registry/data/controller/RegistryDataController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
import org.springframework.web.bind.annotation.PostMapping;
3535
import org.springframework.web.bind.annotation.RequestBody;
3636
import org.springframework.web.bind.annotation.RequestMapping;
37-
import org.springframework.web.bind.annotation.ResponseBody;
37+
import org.springframework.web.bind.annotation.RestController;
3838

3939
import jakarta.validation.Valid;
4040
import java.util.Map;
4141

4242
@RequiredArgsConstructor
4343
@RequestMapping("${nrich.registry.data.endpoint-path:nrich/registry/data}")
44-
@ResponseBody
44+
@RestController
4545
public class RegistryDataController {
4646

4747
private final RegistryDataService registryDataService;

nrich-registry/src/main/java/net/croz/nrich/registry/history/controller/RegistryHistoryController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
import org.springframework.web.bind.annotation.PostMapping;
2626
import org.springframework.web.bind.annotation.RequestBody;
2727
import org.springframework.web.bind.annotation.RequestMapping;
28-
import org.springframework.web.bind.annotation.ResponseBody;
28+
import org.springframework.web.bind.annotation.RestController;
2929

3030
import jakarta.validation.Valid;
3131

3232
@RequiredArgsConstructor
3333
@RequestMapping("${nrich.registry.history.endpoint-path:nrich/registry/history}")
34-
@ResponseBody
34+
@RestController
3535
public class RegistryHistoryController {
3636

3737
private final RegistryHistoryService registryHistoryService;

nrich-security-csrf/src/main/java/net/croz/nrich/security/csrf/core/controller/CsrfPingController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import net.croz.nrich.security.csrf.core.constants.CsrfConstants;
2121
import org.springframework.web.bind.annotation.RequestMapping;
22-
import org.springframework.web.bind.annotation.ResponseBody;
22+
import org.springframework.web.bind.annotation.RestController;
2323

2424
import java.util.HashMap;
2525
import java.util.Map;
@@ -28,12 +28,12 @@
2828
* Used by client for csrf ping url
2929
*/
3030
@RequestMapping
31+
@RestController
3132
public class CsrfPingController {
3233

3334
private static final String SUCCESS_KEY = "success";
3435

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

0 commit comments

Comments
 (0)