* BAEL-2988 Move the code from spring-rest-simple to spring-mvc-simple-2, based on the review feedback. * BAEL-2988 revert previous changes in the spring-rest-simple
24 lines
712 B
Java
24 lines
712 B
Java
package com.baeldung.spring.enums;
|
|
|
|
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;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import com.baeldung.spring.model.Modes;
|
|
|
|
@RestController
|
|
@RequestMapping("/enums")
|
|
public class EnumController {
|
|
|
|
@GetMapping("/mode2str")
|
|
public String getStringToMode(@RequestParam("mode") Modes mode) {
|
|
return "good";
|
|
}
|
|
|
|
@GetMapping("/findbymode/{mode}")
|
|
public String findByEnum(@PathVariable Modes mode) {
|
|
return "good";
|
|
}
|
|
} |