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;
|
package com.baeldung.cors;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
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.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@ -13,12 +14,12 @@ import com.baeldung.model.Modes;
|
|||||||
@RequestMapping("/enums")
|
@RequestMapping("/enums")
|
||||||
public class EnumController {
|
public class EnumController {
|
||||||
|
|
||||||
@RequestMapping("/mode2str")
|
@GetMapping("/mode2str")
|
||||||
public String getStringToMode(@RequestParam("mode") Modes mode) {
|
public String getStringToMode(@RequestParam("mode") Modes mode) {
|
||||||
return "good";
|
return "good";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/findbymode/{mode}")
|
@GetMapping("/findbymode/{mode}")
|
||||||
public String findByEnum(@PathVariable Modes mode) {
|
public String findByEnum(@PathVariable Modes mode) {
|
||||||
return "good";
|
return "good";
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package com.baeldung.model;
|
package com.baeldung.model;
|
||||||
|
|
||||||
public enum Modes {
|
public enum Modes {
|
||||||
ALPHA, DELTA
|
ALPHA, BETA;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user