Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.springframework.http.ResponseEntity;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.keethings.server.application.dto.ConversationDTO;
- import io.swagger.v3.oas.annotations.Operation;
- import io.swagger.v3.oas.annotations.media.Content;
- import io.swagger.v3.oas.annotations.media.ExampleObject;
- @RestController
- @RequestMapping("/api/my/problem")
- public class MyProblemResource {
- @PostMapping(value = "/")
- @Operation(summary = "Create person")
- @io.swagger.v3.oas.annotations.parameters.RequestBody(
- description = "the person you want to create, in json format",
- content = @Content(examples = @ExampleObject( value = "foobar"))
- )
- public ResponseEntity<ConversationDTO> readConversation(
- @RequestBody PersonDTO person){
- return ResponseEntity.ok().build();
- }
- }
- class PersonDTO{
- String firstName;
- String lastName;
- public PersonDTO() {}
- public String getFirstName() {
- return firstName;
- }
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
- public String getLastName() {
- return lastName;
- }
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
- }
Add Comment
Please, Sign In to add comment