//package org.egl_cepgl.pm.controller;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiResponse;
//import io.swagger.annotations.ApiResponses;
//import lombok.extern.slf4j.Slf4j;
//import org.egl_cepgl.pm.dto.InboxUsersDto;
//import org.egl_cepgl.pm.model.ChatContact;
//import org.egl_cepgl.pm.model.ChatInbox;
//import org.egl_cepgl.pm.service.ChatService;
//import org.springframework.http.MediaType;
//import org.springframework.http.ResponseEntity;
//import org.springframework.security.core.Authentication;
//import org.springframework.security.core.annotation.AuthenticationPrincipal;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.security.oauth2.jwt.Jwt;
//import org.springframework.web.bind.annotation.*;
//import reactor.core.publisher.Flux;
//import reactor.core.publisher.Mono;
//
//@Slf4j
//@Api("api/chat/contacts")
//@RestController
//@RequestMapping("api/chat/contacts")
//public class ChatRestController
//{
//    private final ChatService chatService;
//
//    public ChatRestController(ChatService chatService) {
//        this.chatService = chatService;
//    }
//
//    @GetMapping(value = "/all",produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value="List ..", notes="Cette méthode permet..", responseContainer = "List<Contact>")
//    @ApiResponses(value= { @ApiResponse(code= 200, message = "Une liste des ..") })
//    public ResponseEntity<Flux<ChatContact>> contacts()
//    {
//        return ResponseEntity.ok(chatService.findAllContacts());
//    }
//
//    @PostMapping(value = "/addChatInbox",consumes= MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value="Add ..", notes="Cette méthode permet de..", response = InboxUsersDto.class)
//    @ApiResponses(value= { @ApiResponse(code= 200, message = "créé/modifié"), @ApiResponse(code= 400, message = "Non valide") })
//    public ResponseEntity<Mono<ChatInbox>> addInboxIfNotExists(@AuthenticationPrincipal Jwt jwt, @RequestBody InboxUsersDto obj)
//    {
//        return ResponseEntity.ok(this.chatService.addInboxIfNotExists(jwt.getClaimAsString("email"), obj));
//    }
//
//}
