Files
spring-boot-rest/spring-mvc-simple-2/src/main/java/com/baeldung/spring/enums/EnumController.java
wugangca a0cbfa3b06 BAEL-2988 Move the code from spring-rest-simple to spring-mvc-simple-… (#7914)
* 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
2019-10-04 07:30:54 -05:00

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";
}
}