Class NotificationController
java.lang.Object
es.kukenan.smartfi.microservice.communication.controller.NotificationController
NotificationController controller.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAuthority (role) required in order to be able to invoke greeting API.static final StringAuthority (role) required in order to be able to invoke greeting API.static final StringAuthority (role) required in order to be able to invoke change application status.static final StringREST API base path.static final StringChannels path.static final StringPush path.static final StringOn Demand notification path.static final StringUser changes channel path.private NotificationServiceOn Demand Notification service.private NotificationSettingServicePushNotification service.private UserManagementServiceLocal user management service. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>getNotificationsChannels(es.kukenan.smartfi.common.security.WalletAuthentication authentication) Get notifications channels.org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationActivatedResponseDto>getPushNotificationActivated(es.kukenan.smartfi.common.security.WalletAuthentication authentication) Get user push activated or deactivated.org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.communications.api.smsbyemail.SmsByEmailResponseDto>getSmsByEmail(es.kukenan.smartfi.common.security.WalletAuthentication authentication, String userId) Get user sms by email activated or deactivated.org.springframework.http.ResponseEntity<Void>onDemandNotification(es.kukenan.smartfi.common.security.WalletAuthentication authentication, es.kukenan.smartfi.microservice.communications.api.ondemand.OnDemandNotificationRequestDto requestDto) Send on demand notification for user.org.springframework.http.ResponseEntity<Void>pushNotification(es.kukenan.smartfi.common.security.WalletAuthentication authentication, es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationRequestDto settings) Activated or deactivated push notification for user.org.springframework.http.ResponseEntity<Void>updateUserSmsByEmail(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication, es.kukenan.smartfi.microservice.communications.api.smsbyemail.SmsByEmailRequestDto smsByEmailRequest, String userId) User updated sms by email.
-
Field Details
-
API_PATH
REST API base path.- See Also:
-
API_PATH_PUSH
Push path.- See Also:
-
API_PATH_CHANNEL
Channels path.- See Also:
-
API_PATH_SEND
On Demand notification path.- See Also:
-
API_PATH_USER
User changes channel path.- See Also:
-
API_AUTHORITIES
Authority (role) required in order to be able to invoke greeting API.- See Also:
-
API_AUTHORITIES_AGENT
Authority (role) required in order to be able to invoke greeting API.- See Also:
-
API_BACKOFFICE_AUTHORITIES
Authority (role) required in order to be able to invoke change application status.- See Also:
-
settingsService
PushNotification service. -
notificationService
On Demand Notification service. -
usersService
Local user management service.
-
-
Constructor Details
-
NotificationController
public NotificationController()
-
-
Method Details
-
pushNotification
@PostMapping(path="/api/v1/notifications/push", consumes="application/json", produces="application/json") @PreAuthorize("(hasRole(\'ROLE_ACCESS_USER\') or hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") public org.springframework.http.ResponseEntity<Void> pushNotification(es.kukenan.smartfi.common.security.WalletAuthentication authentication, @RequestBody es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationRequestDto settings) Activated or deactivated push notification for user.- Parameters:
authentication- user credentialssettings- settings info- Returns:
- Void response.
-
getPushNotificationActivated
@GetMapping(value="/api/v1/notifications/push", produces="application/json") @PreAuthorize("(hasRole(\'ROLE_ACCESS_USER\') or hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationActivatedResponseDto> getPushNotificationActivated(es.kukenan.smartfi.common.security.WalletAuthentication authentication) Get user push activated or deactivated.- Parameters:
authentication- authentication info- Returns:
- PushNotificationActivatedResponseDto response for the user.
-
updateUserSmsByEmail
@PatchMapping(produces="application/json", path="/api/v1/notifications/{userId}") @PreAuthorize("(hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") public org.springframework.http.ResponseEntity<Void> updateUserSmsByEmail(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication, @RequestBody es.kukenan.smartfi.microservice.communications.api.smsbyemail.SmsByEmailRequestDto smsByEmailRequest, @PathVariable(name="userId") String userId) User updated sms by email.- Parameters:
walletAuthentication- user credentialssmsByEmailRequest- bodyuserId- user id- Returns:
- response without data
-
getSmsByEmail
@GetMapping(produces="application/json", path="/api/v1/notifications/{userId}") @PreAuthorize("(hasRole(\'ROLE_ACCESS_AGENT\') or hasRole(\'ROLE_ACCESS_SUPERVISOR\')) and (hasRole(\'ROLE_LEVEL_USER_PWD\') or hasRole(\'ROLE_LEVEL_USER_SCA\'))") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.microservice.communications.api.smsbyemail.SmsByEmailResponseDto> getSmsByEmail(es.kukenan.smartfi.common.security.WalletAuthentication authentication, @PathVariable(name="userId") String userId) Get user sms by email activated or deactivated.- Parameters:
authentication- authentication infouserId- user id- Returns:
- SmsByEmailResponseDto response for the user.
-
getNotificationsChannels
@GetMapping(value="/api/v1/notifications/channels", produces="application/json") @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") public org.springframework.http.ResponseEntity<Object> getNotificationsChannels(es.kukenan.smartfi.common.security.WalletAuthentication authentication) Get notifications channels.- Parameters:
authentication- authentication info- Returns:
- PushNotificationActivatedResponseDto response for the user.
-
onDemandNotification
@PostMapping(path="/api/v1/notifications/send", consumes="application/json", produces="application/json") @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") public org.springframework.http.ResponseEntity<Void> onDemandNotification(es.kukenan.smartfi.common.security.WalletAuthentication authentication, @RequestBody es.kukenan.smartfi.microservice.communications.api.ondemand.OnDemandNotificationRequestDto requestDto) Send on demand notification for user.- Parameters:
authentication- user credentialsrequestDto- notification info- Returns:
- Void response.
-