I have a classic Spring Boot app, you can see the structure:

I am trying to modify it to have at the end a Layered Architecture.
The problem is that to isolate the layers we must to use APIs between layers,so I have no idea how to create API's for each Layer, maybe you can give some examples?
Here is the classic structure of Layered Arch.

And this is my structure.
Some codes from my app:
@Controller
public class UserController {
…
@PostMapping("/saveUser")
public String saveUser(@ModelAttribute("user") User theUser…){
theUser.setPassword(value);
userService.save(theUser);
}
…
}
...
@Service
@Component("userService")
public class UserServiceImpl implements Services<User> {
…
@Override
@Transactional
public void save(User theUser) {
theUser.setPassword(passwordEncoder.encode(theUser.getPassword()));
userDao.saveUser(theUser);
}
…
}
...
@RestController
@RequestMapping("/api")
public class AnnonceRestController {
@GetMapping("/announce-all")
public List<Annonce> findAll() {
return annonceService.findAll();
}
@PostMapping("/announce-create")
public Annonce addAnnonce(@RequestBody Annonce theAnnonce) {
theAnnonce.setId(0);
theAnnonce.setDate(null);
annonceService.save(theAnnonce);
return theAnnonce;
}
