merge conflicts
This commit is contained in:
		
						commit
						06e48caac7
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -20,6 +20,7 @@ public class ContactController {
 | 
			
		|||
    @Autowired
 | 
			
		||||
    private ContactRepository contactRepo;
 | 
			
		||||
 | 
			
		||||
    //Récupère les infos d'un contact par son ID
 | 
			
		||||
    @GetMapping(value = "/{id}")
 | 
			
		||||
    //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')")
 | 
			
		||||
    public ResponseEntity<?> findById(@PathVariable int id){
 | 
			
		||||
| 
						 | 
				
			
			@ -34,6 +35,7 @@ public class ContactController {
 | 
			
		|||
        return ResponseEntity.status(HttpStatus.OK).body(contact);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //Récupère les infos d'un contact par la team ID
 | 
			
		||||
    @GetMapping(value = "team/{team_id}")
 | 
			
		||||
    //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')")
 | 
			
		||||
    public ResponseEntity<?> findByTeamId(@PathVariable int team_id){
 | 
			
		||||
| 
						 | 
				
			
			@ -44,10 +46,10 @@ public class ContactController {
 | 
			
		|||
        } catch (Exception e) {
 | 
			
		||||
            return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return ResponseEntity.status(HttpStatus.OK).body(contacts);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //Ajoute un nouveau contact
 | 
			
		||||
    @PostMapping(value="/add")
 | 
			
		||||
    //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')")
 | 
			
		||||
    public ResponseEntity<?> addContact(@RequestBody Contact contact){
 | 
			
		||||
| 
						 | 
				
			
			@ -61,6 +63,7 @@ public class ContactController {
 | 
			
		|||
        return ResponseEntity.status(HttpStatus.CREATED).body(resultContact);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //Mise à jour du contact par son ID
 | 
			
		||||
    @PutMapping("/update/{id}")
 | 
			
		||||
    //@PreAuthorize("hasRole('ROLE_PARENT') or hasRole('ROLE_ENFANT')")
 | 
			
		||||
    public ResponseEntity<?> updateContact(@RequestBody Contact contact, @PathVariable Integer id) throws Exception {
 | 
			
		||||
| 
						 | 
				
			
			@ -75,6 +78,7 @@ public class ContactController {
 | 
			
		|||
        return ResponseEntity.status(HttpStatus.OK).body(resultContact);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //Efface le contact par on ID
 | 
			
		||||
    @DeleteMapping(value = "/delete/{id}")
 | 
			
		||||
    //@PreAuthorize("hasRole('ROLE_PARENT')")
 | 
			
		||||
    public ResponseEntity<?> deleteContact(@PathVariable int id){
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue