Class NotificationController

java.lang.Object
es.kukenan.smartfi.microservice.communication.controller.NotificationController

@RestController public class NotificationController extends Object
NotificationController controller.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Authority (role) required in order to be able to invoke greeting API.
    static final String
    Authority (role) required in order to be able to invoke greeting API.
    static final String
    Authority (role) required in order to be able to invoke change application status.
    static final String
    REST API base path.
    static final String
    Channels path.
    static final String
    Push path.
    static final String
    On Demand notification path.
    static final String
    User changes channel path.
    On Demand Notification service.
    PushNotification service.
    Local user management service.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 credentials
      settings - 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 credentials
      smsByEmailRequest - body
      userId - 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 info
      userId - 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 credentials
      requestDto - notification info
      Returns:
      Void response.