Package restapi.controllers
Class ContactsController
java.lang.Object
restapi.controllers.ContactsController
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull ContactService
private final Logger
private final @NonNull PhoneNumberService
private final @NonNull RequestService
private final @NonNull UserService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<RestResponse>
areContactsUsers
(LoggedUser user, List<String> phones) Get all users that have a phone matching in phones.org.springframework.http.ResponseEntity<RestResponse>
getContacts
(LoggedUser user) Returns all contacts the user has in the app.
-
Field Details
-
userService
-
contactService
-
requestService
-
phoneNumberService
-
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 tokenphones
- List of phones to search on the database- Returns:
- Details of contact
-