Shawn Hernandez has worked in the creative field since 2013. Shawn began their career at Keepitcity as a Creative. In 2019, they joined Aerial Canvas | Real Estate Marketing Solutions, where they have held the roles of Creative Director, Creative Strategist, Creative Specialist Manager, and Creative Specialist.
package com.example.demo.controller;
import com.example.demo.model.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@GetMapping("/")
public List<User> getAllUsers(){
return userService.getAllUsers();
}
@GetMapping("/{id}")
public User getUserById(@PathVariable Long id){
return userService.getUserById(id);
}
@PostMapping("/")
public ResponseEntity<?> createUser(@RequestBody User user){
userService.createUser(user);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping("/{id}")
public ResponseEntity<?> updateUser(@PathVariable Long id, @RequestBody User user){
userService.updateUser(id, user);
return new ResponseEntity<>(HttpStatus.OK);
}
@DeleteMapping("/{id}")
public ResponseEntity<?> deleteUser(@PathVariable Long id){
userService.deleteUser(id);
return new ResponseEntity<>(HttpStatus.OK);
}
}
Links
Sign up to view 11 direct reports
Get started