Class ContactsController

java.lang.Object
restapi.controllers.ContactsController

@RestController @RequestMapping("/contacts") public class ContactsController extends Object
  • Field Details

    • userService

      @NonNull private final @NonNull UserService userService
    • contactService

      @NonNull private final @NonNull ContactService contactService
    • requestService

      @NonNull private final @NonNull RequestService requestService
    • phoneNumberService

      @NonNull private final @NonNull PhoneNumberService phoneNumberService
    • logger

      private final Logger logger
  • Constructor Details

    • ContactsController

      public ContactsController()
  • Method Details

    • getContacts

      @GetMapping("/mine") public org.springframework.http.ResponseEntity<RestResponse> getContacts(@AuthenticationPrincipal LoggedUser user)
      Returns all contacts the user has in the app. endpoint /contacts/mine
      Parameters:
      user - Authenticated LoggedUser from token
      Returns:
      Rest Message OK or Error 404
    • areContactsUsers

      @GetMapping("/exist") public org.springframework.http.ResponseEntity<RestResponse> areContactsUsers(@AuthenticationPrincipal LoggedUser user, @RequestParam List<String> phones)
      Get all users that have a phone matching in phones. Returns details for all user that have a phone that is in the list of phones passed by parameter. endpoint /contacts/exist
      Parameters:
      user - Authenticated LoggedUser from token
      phones - List of phones to search on the database
      Returns:
      Details of contact