BAEL-2988 Make the code consistent with the article. (#7870)
* BAEL-2988 Make the code consistent with the article. * BAEL-2988 Use @GetMapping annotation based on the feedback.
This commit is contained in:
parent
9ad7ed0e2f
commit
cc23ac598a
|
@ -1,6 +1,7 @@
|
|||
package com.baeldung.cors;
|
||||
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
@ -13,12 +14,12 @@ import com.baeldung.model.Modes;
|
|||
@RequestMapping("/enums")
|
||||
public class EnumController {
|
||||
|
||||
@RequestMapping("/mode2str")
|
||||
@GetMapping("/mode2str")
|
||||
public String getStringToMode(@RequestParam("mode") Modes mode) {
|
||||
return "good";
|
||||
}
|
||||
|
||||
@RequestMapping("/findbymode/{mode}")
|
||||
@GetMapping("/findbymode/{mode}")
|
||||
public String findByEnum(@PathVariable Modes mode) {
|
||||
return "good";
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package com.baeldung.model;
|
||||
|
||||
public enum Modes {
|
||||
ALPHA, DELTA
|
||||
ALPHA, BETA;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue