java.lang.Object
es.kukenan.smartfi.microservice.smartficore.controller.AbstractController
es.kukenan.smartfi.microservice.smartficore.controller.UserController

@RestController public class UserController extends AbstractController
Controller to reply Core User endpoints definition.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Authority (role) required in order to be able to invoke change application status.
    static final String
    Authority (role) required in order to be able to invoke company endpoints.
    private es.kukenan.smartfi.common.context.RequestContextManager
    Request context manager.
    private es.kukenan.smartfi.common.service.jwt.JwtServiceImpl
    JWT service for create a bearer to call products.
    private UserService
    Company service.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.DetailUserDto>>
    getClientDetail(String clientId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Get client full object.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Map<String,Long>>>
    getClientsCount(String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Count clients.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDto>>>
    getClientsList(Integer pageNumber, Integer pageSize, String sortedBy, String userId, es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.FilterUserRequestDto filterUserRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Search list of clients.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDto>>>
    getClientsOfCompanyList(Integer pageNumber, Integer pageSize, String sortedBy, String userId, es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.FilterUserRequestDto filterUserRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Search list of clients.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Map<String,Long>>>
    getCompanyClientsCount(String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Count clients.
    org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.DetailUserDto>>
    updateClient(es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.UpdateUserDto updateUserDto, String clientId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
    Update some client data.

    Methods inherited from class es.kukenan.smartfi.microservice.smartficore.controller.AbstractController

    fillResponseOk, fillResponseOk

    Methods inherited from class java.lang.Object

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

    • userService

      @Autowired private UserService userService
      Company service.
    • jwtService

      @Autowired private es.kukenan.smartfi.common.service.jwt.JwtServiceImpl jwtService
      JWT service for create a bearer to call products.
    • contextManager

      @Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManager
      Request context manager.
    • API_BACKOFFICE_AUTHORITIES

      public static final String API_BACKOFFICE_AUTHORITIES
      Authority (role) required in order to be able to invoke change application status.
      See Also:
    • API_COMPANY_AUTHORITIES

      public static final String API_COMPANY_AUTHORITIES
      Authority (role) required in order to be able to invoke company endpoints.
      See Also:
  • Constructor Details

    • UserController

      public UserController()
  • Method Details

    • getClientsList

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @PostMapping(path="/api-clients/clients", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDto>>> getClientsList(@RequestParam(name="pageNumber",required=false) Integer pageNumber, @RequestParam(name="pageSize",required=false) Integer pageSize, @RequestParam(name="sortedBy",required=false) String sortedBy, @RequestHeader(name="X-USER-PROFILE-ID",required=false) String userId, @RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.FilterUserRequestDto filterUserRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Search list of clients.
      Parameters:
      pageNumber - number of page to get.
      pageSize - size of list to return.
      sortedBy - sort param.
      userId - user id.
      filterUserRequestDto - company info.
      authentication - user credentials.
      Returns:
      clients list.
    • getClientsOfCompanyList

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @PostMapping(path="/api-clients/clients/company", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.common.api.dtos.ResultsPageDto<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.BasicUserDto>>> getClientsOfCompanyList(@RequestParam(name="pageNumber",required=false) Integer pageNumber, @RequestParam(name="pageSize",required=false) Integer pageSize, @RequestParam(name="sortedBy",required=false) String sortedBy, @RequestHeader(name="X-USER-PROFILE-ID",required=false) String userId, @RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.FilterUserRequestDto filterUserRequestDto, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Search list of clients.
      Parameters:
      pageNumber - number of page to get.
      pageSize - size of list to return.
      sortedBy - sort param.
      userId - user id.
      filterUserRequestDto - company info.
      authentication - user credentials.
      Returns:
      clients list.
    • getClientDetail

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @GetMapping(path="/api-clients/client/{clientId}", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.DetailUserDto>> getClientDetail(@PathVariable("clientId") String clientId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Get client full object.
      Parameters:
      clientId - client identifier.
      authentication - user credentials.
      Returns:
      client detail.
    • getClientsCount

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\'))") @GetMapping(path="/api-clients/clients", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Map<String,Long>>> getClientsCount(@RequestHeader(name="X-USER-PROFILE-ID",required=false) String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Count clients.
      Parameters:
      userId - user id.
      authentication - user credentials.
      Returns:
      clients count.
    • getCompanyClientsCount

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @GetMapping(path="/api-clients/clients/company", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<Map<String,Long>>> getCompanyClientsCount(@RequestHeader(name="X-USER-PROFILE-ID",required=false) String userId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Count clients.
      Parameters:
      userId - user id.
      authentication - user credentials.
      Returns:
      clients count.
    • updateClient

      @PreAuthorize("(hasRole(\'ROLE_ACCESS_ADMIN\') and hasRole(\'ROLE_LEVEL_BACKOFFICE_ADMIN\')) or (hasRole(\'ROLE_ACCESS_MODERATOR\') and hasRole(\'ROLE_LEVEL_USER_MODERATOR\')) or (hasRole(\'ROLE_ACCESS_COMPANY\') and hasRole(\'ROLE_LEVEL_USER_COMPANY\'))") @PutMapping(path="/api-clients/client/{clientId}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<es.kukenan.smartfi.dto.ResponseDTO<es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.DetailUserDto>> updateClient(@RequestBody es.kukenan.smartfi.microservice.backoffice.dtos.backoffice.user.UpdateUserDto updateUserDto, @PathVariable("clientId") String clientId, es.kukenan.smartfi.common.security.WalletAuthentication authentication)
      Update some client data.
      Parameters:
      updateUserDto - update information.
      clientId - client identifier.
      authentication - user credentials.
      Returns:
      client detail.