File tree Expand file tree Collapse file tree
spring-rest/src/main/java/com/baeldung/web/log/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import org .slf4j .LoggerFactory ;
77import org .springframework .beans .factory .annotation .Autowired ;
88import org .springframework .stereotype .Controller ;
9+ import org .springframework .web .bind .annotation .GetMapping ;
10+ import org .springframework .web .bind .annotation .PostMapping ;
911import org .springframework .web .bind .annotation .RequestBody ;
10- import org .springframework .web .bind .annotation .RequestMapping ;
11- import org .springframework .web .bind .annotation .RequestMethod ;
1212import org .springframework .web .bind .annotation .ResponseBody ;
1313
1414import com .baeldung .web .log .data .RateCard ;
@@ -23,14 +23,14 @@ public class TaxiFareController {
2323
2424 private static final Logger LOGGER = LoggerFactory .getLogger (TaxiFareController .class );
2525
26- @ RequestMapping ( method = RequestMethod . GET , value = "/taxifare/get/" )
26+ @ GetMapping ( value = "/taxifare/get/" )
2727 @ ResponseBody
2828 public RateCard getTaxiFare () {
2929 LOGGER .debug ("getTaxiFare() - START" );
3030 return new RateCard ();
3131 }
3232
33- @ RequestMapping ( method = RequestMethod . POST , value = "/taxifare/calculate/" )
33+ @ PostMapping ( value = "/taxifare/calculate/" )
3434 @ ResponseBody
3535 public String calculateTaxiFare (@ RequestBody @ Valid TaxiRide taxiRide ) {
3636 LOGGER .debug ("calculateTaxiFare() - START" );
You can’t perform that action at this time.
0 commit comments