Class AccountEndpoint
java.lang.Object
com.maplander.backend.controller.endpoint.ml.AccountEndpoint
Endpoint with methods about account of UserML in MapLander application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactivateSearchML
(Long id) activeEmailSubs
(Long id) cancelEmailSubs
(Long id) createUserML
(UserML userML) Create a UserMLdeleteFavorite
(Long id) deleteSearches
(Long id) deleteSuggest
(Long id) getCompleteProperty
(javax.servlet.http.HttpServletRequest request, Long id) getUserById
(Long id) listFavoriteByUser
(Long userId, Integer limit, String cursor) listProgress
(Integer maxModDate, Integer limit, String cursor) listSearchByUser
(Long userMLId, Integer limit, String cursor) listSearchByUserId
(Long userMLId, Integer limit, String cursor) listSuggest
(Long id, String cursor, Integer limit) refreshSuggestBySearchesML
(Long userSearchId, String cursor) saveSearch
(Integer limit, String cursor, SearchesML search) Save searchcom.google.api.server.spi.response.CollectionResponse
<PropertyLiteSuggest> searchFirstTime
(Integer limit, String cursor, SearchesML searchesML) sendSignInLink
(String email) Sends an email with the link to enter and change password.signIn
(String email, String password, LanguageTypeEnum language, String token, DeviceTypeEnum type) Returns UserML with correct email and password (optional).signInWithLink
(Long id, String token, DeviceTypeEnum type) Returns UserML with correct valid and active Link with id.Deletes all DeviceML with token passed as a parameter.updateAndCleanSearchesML
(SearchesML searchesML) updateSearch
(SearchesML searchesML) updateSuggest
(PropertyLiteSuggest propertyLiteSuggest) updateUserML
(UserML userML) Update a UserML
-
Constructor Details
-
AccountEndpoint
public AccountEndpoint()
-
-
Method Details
-
createUserML
Create a UserML- Parameters:
userML
- UserML to be created- Returns:
- EntityResponse with UserML created.
HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
HttpStatusCode.NOT_EXISTS
,HttpStatusCode.INTERNAL_SERVER_ERROR
-
updateUserML
Update a UserML- Parameters:
userML
- userML to be updated- Returns:
- EntityResponse with UserML updated.
HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
HttpStatusCode.NOT_EXISTS
,HttpStatusCode.INTERNAL_SERVER_ERROR
-
signIn
public EntityResponse<UserML> signIn(String email, String password, LanguageTypeEnum language, String token, DeviceTypeEnum type) Returns UserML with correct email and password (optional). In that case save a DeviceML with token and type passed as parameters.- Parameters:
email
- email of Userpassword
- password of UserML (can be null)language
- language of accounttoken
- token of Device (can be null)type
- type of Device- Returns:
- EntityResponse with User
HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
,HttpStatusCode.NOT_EXISTS
,HttpStatusCode.INCORRECT_PASS
-
signOut
Deletes all DeviceML with token passed as a parameter.- Parameters:
token
- DeviceML token to be removed- Returns:
- DefaultResponse
HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
,HttpStatusCode.NOT_EXISTS
-
sendSignInLink
Sends an email with the link to enter and change password.- Parameters:
email
- email to be sent.- Returns:
- DefaultResponse
HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
,HttpStatusCode.NOT_EXISTS
,HttpStatusCode.INTERNAL_SERVER_ERROR
-
signInWithLink
Returns UserML with correct valid and active Link with id. In that case save a Device with token and type passed as parameters.- Parameters:
id
- id of Link to be validatedtoken
- device tokentype
- device type- Returns:
- EntityResponse with Person
HttpStatusCode.OK
,HttpStatusCode.NOT_EXISTS
-
getUserById
-
getCompleteProperty
public EntityResponse<CompleteProperty> getCompleteProperty(javax.servlet.http.HttpServletRequest request, Long id) -
deleteFavorite
-
listFavoriteByUser
-
saveSearch
Save search- Parameters:
limit
- max limit of querycursor
- cursor of querysearch
- search to be save with type of property:PropertyTypeEnum
type of offering:OfferingTypeEnum
active for default is true activeEmail for default is true notification for default is true- Returns:
- EntityResponse with search save
HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
,HttpStatusCode.INTERNAL_SERVER_ERROR
-
updateSearch
-
updateAndCleanSearchesML
-
listSearchByUser
public EntityCollectionResponse<SearchesML> listSearchByUser(Long userMLId, Integer limit, String cursor) -
archiveSearchesML
-
activateSearchML
-
cancelEmailSubs
-
activeEmailSubs
-
cancelNotifications
-
activeNotification
-
deleteSearches
-
listSearchByUserId
public EntityCollectionResponse<SearchesML> listSearchByUserId(Long userMLId, Integer limit, String cursor) -
listProgress
public EntityCollectionResponse<SearchesMLDAO> listProgress(Integer maxModDate, Integer limit, String cursor) -
updateSuggest
-
searchFirstTime
public com.google.api.server.spi.response.CollectionResponse<PropertyLiteSuggest> searchFirstTime(Integer limit, String cursor, SearchesML searchesML) -
listSuggest
public EntityCollectionResponse<PropertyLiteSuggest> listSuggest(Long id, String cursor, Integer limit) -
refreshSuggestBySearchesML
public EntityCollectionResponse<PropertyLiteSuggest> refreshSuggestBySearchesML(Long userSearchId, String cursor) -
deleteSuggest
-