init commit (#11767)
This commit is contained in:
+11
@@ -1,5 +1,6 @@
|
||||
package com.baeldung.boot.noconverterfound.controller;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -18,4 +19,14 @@ public class StudentRestController {
|
||||
return ResponseEntity.ok(new Student(id, "John", "Wiliams", "AA"));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/student/v2/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Student> getV2(@PathVariable("id") int id) {
|
||||
return ResponseEntity.ok(new Student(id, "Kevin", "Cruyff", "AA"));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/student/v3/{id}", produces = MediaType.APPLICATION_XML_VALUE)
|
||||
public ResponseEntity<Student> getV3(@PathVariable("id") int id) {
|
||||
return ResponseEntity.ok(new Student(id, "Robert", "Miller", "BB"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user