Added endpoint to get all users

This commit is contained in:
harish
2024-10-16 17:12:31 +05:30
parent edd9c1cb1a
commit 38db6127f7
10 changed files with 61 additions and 10 deletions

View File

@@ -72,7 +72,7 @@ public class AuthenticationService {
public JWTToken login(LoginReq loginReq,HttpServletRequest request) {
UserEntity user=null;
try {
LoginAttemptEntity loginAttemptEntity = prepareLoginAttemptEntity(loginReq, request);
log.info("Attempting login for email: {}", loginReq.getEmail());
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
@@ -89,10 +89,6 @@ public class AuthenticationService {
Translator.toLocale(GepafinConstant.USER_NOT_FOUND_MSG));
}
createSuccessLoginAttempt(loginAttemptEntity);
} catch (Exception e) {
}
return getJWTTokenBean(user, loginReq.getRememberMe());
}

View File

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@@ -124,4 +125,10 @@ public class UserServiceImpl implements UserService {
// Calling DAO Function
return userDao.validateUser(userId);
}
@Override
@Transactional(readOnly = true)
public List<UserResponseBean> getAllUsers(Long roleId) {
// Calling DAO Function
return userDao.getAllUsers(roleId);
}
}