Class UserController
java.lang.Object
es.kukenan.smartfi.microservice.smartficore.controller.AbstractController
es.kukenan.smartfi.microservice.smartficore.controller.UserController
Controller to reply Core User endpoints definition.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAuthority (role) required in order to be able to invoke change application status.static final StringAuthority (role) required in order to be able to invoke company endpoints.private es.kukenan.smartfi.common.context.RequestContextManagerRequest context manager.private es.kukenan.smartfi.common.service.jwt.JwtServiceImplJWT service for create a bearer to call products.private UserServiceCompany service. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.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.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.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
-
Field Details
-
userService
Company service. -
jwtService
@Autowired private es.kukenan.smartfi.common.service.jwt.JwtServiceImpl jwtServiceJWT service for create a bearer to call products. -
contextManager
@Autowired private es.kukenan.smartfi.common.context.RequestContextManager contextManagerRequest context manager. -
API_BACKOFFICE_AUTHORITIES
Authority (role) required in order to be able to invoke change application status.- See Also:
-
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.
-