resolved conflicts
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -118,4 +118,10 @@ public class CompanyServiceImpl implements CompanyService {
|
||||
public UserWithCompanyEntity getUserWithCompanyEntity(Long userId,Long companyId){
|
||||
return companyDao.getUserWithCompany(userId,companyId);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void removeCompanyFromList(HttpServletRequest request, Long companyId) {
|
||||
UserEntity userEntity =validator.validateUser(request);
|
||||
companyDao.removeCompanyFromList(userEntity, companyId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import net.gepafin.tendermanagement.dao.RoleDao;
|
||||
import net.gepafin.tendermanagement.entities.RoleEntity;
|
||||
import net.gepafin.tendermanagement.model.request.RoleReq;
|
||||
import net.gepafin.tendermanagement.model.response.RoleResponseBean;
|
||||
import net.gepafin.tendermanagement.service.RoleService;
|
||||
@@ -46,4 +47,10 @@ public class RoleServiceImpl implements RoleService {
|
||||
return roleDao.getAllRoles();
|
||||
|
||||
}
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public RoleEntity validateRole(Long roleId) {
|
||||
return roleDao.validateRole(roleId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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