[Vuejs]-Spring boot push notification restTemplate

0👍

You need to layer your code first.

Create a service and inject in your controller class. All the logic that you will write, should be in service layer. Not in your controller. Then you need the inject your repository layer in your service class. Thats the layering.

You created an endpoint in your Controller class..

@PostMapping("/plate")
public ResponseEntity<Plate> createPositionOc(@RequestParam String plate) {
    return ResponseEntity.ok(service.createPosition(plate));
}

in your service layer you can easily add a row to database…

For your frontend ; you need the gave it something to use. You should return what you are gonna use in the front. Return them a model to use.

Resttemplate is for communicate the services. I cant ask a question , not quite understand phyton part.

Leave a comment