resolved conflicts

This commit is contained in:
rajesh
2024-10-17 16:05:30 +05:30
23 changed files with 174 additions and 28 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

@@ -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);
}
}

View File

@@ -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);
}
}

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);
}
}