I am new to spring boot, and Thank you in advance. I am facing a problem: I would like to receive two types of object in the controller, using the @ResponseBody, then save them.
I have two models
public class Person {
int a;
int b;
int c;
}
public class Human {
int a;
int b;
int c
}
By doing something like this:
@PostMapping(value="/save")
public void savePerson(@RequestBody Person person, @RequestBody Human human) {
personRepo.save(person);
humanRepo.save(human);
}
I want to save person and human on the same request. How to achieve this?