Added endpoint to get all users
This commit is contained in:
@@ -12,6 +12,8 @@ import net.gepafin.tendermanagement.model.response.UserSamlResponse;
|
||||
import net.gepafin.tendermanagement.model.response.UserResponseBean;
|
||||
import net.gepafin.tendermanagement.model.util.JWTToken;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserService {
|
||||
JWTToken createUser(HttpServletRequest request, String tempToken, UserReq userReq);
|
||||
|
||||
@@ -43,5 +45,6 @@ public interface UserService {
|
||||
UserEntity getUserByBeneficiaryId(Long beneficiaryId);
|
||||
|
||||
public UserEntity getUserEntityById(Long userId);
|
||||
List<UserResponseBean> getAllUsers(Long roleId);
|
||||
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user