validate login attempt

This commit is contained in:
rajesh
2024-10-25 11:10:07 +05:30
parent 93acc378d3
commit 4ef26827e7
6 changed files with 30 additions and 8 deletions

View File

@@ -41,7 +41,7 @@ public interface LoginAttemptApi {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE)}))})
@GetMapping(value = "/login-attempt", produces = {"application/json"})
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
default ResponseEntity<LoginAttemptPageableResponseBean<List<LoginAttemptEntity>>> getLoginAttemptsList(
default ResponseEntity<LoginAttemptPageableResponseBean<List<LoginAttemptEntity>>> getLoginAttemptsList(HttpServletRequest request,
@ApiParam(value = "page number") @RequestParam(name = "pageNo", required = false) Integer pageNo,
@ApiParam(value = "page limit") @RequestParam(name = "pageLimit", required = false) Integer pageLimit) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);

View File

@@ -39,8 +39,8 @@ public class LoginAttemptApiController implements LoginAttemptApi {
private UserService userService;
@Override
public ResponseEntity<LoginAttemptPageableResponseBean<List<LoginAttemptEntity>>> getLoginAttemptsList(Integer pageNo, Integer pageLimit) {
LoginAttemptPageableResponseBean<List<LoginAttemptEntity>> response = loginAttemptService.getLoginAttemptsList(pageNo, pageLimit);
public ResponseEntity<LoginAttemptPageableResponseBean<List<LoginAttemptEntity>>> getLoginAttemptsList(HttpServletRequest request, Integer pageNo, Integer pageLimit) {
LoginAttemptPageableResponseBean<List<LoginAttemptEntity>> response = loginAttemptService.getLoginAttemptsList(request, pageNo, pageLimit);
return ResponseEntity.status(HttpStatus.OK).body(response);
}