use of com.varsql.web.model.entity.user.UserEntity in project varsql by varsqlinfo.
the class JoinServiceImpl method saveUser.
/**
* @method : saveUser
* @desc : 사용자 정보 등록.
* @author : ytkim
* @date : 2020. 4. 27.
* @param joinForm
* @return
* @throws EncryptDecryptException
*/
public boolean saveUser(UserReqeustDTO joinForm) throws EncryptDecryptException {
logger.debug("saveUser {} ", VartechUtils.reflectionToString(joinForm));
UserEntity entity = joinForm.toEntity();
entity.setUserRole(AuthorityType.GUEST.name());
entity.setAcceptYn(false);
userMgmtRepository.save(entity);
return true;
}
use of com.varsql.web.model.entity.user.UserEntity in project varsql by varsqlinfo.
the class UserMgmtServiceImpl method updateAccept.
/**
* @Method Name : updateAccept
* @Method 설명 : 사용자 수락 거부 .
* @작성자 : ytkim
* @작성일 : 2017. 12. 1.
* @변경이력 :
* @param paramMap
* @return
*/
@Transactional(value = ResourceConfigConstants.APP_TRANSMANAGER, rollbackFor = Exception.class)
public ResponseResult updateAccept(String acceptyn, String selectItem) {
String[] viewidArr = StringUtils.split(selectItem, ",");
AuthorityType role = "Y".equals(acceptyn) ? AuthorityType.USER : AuthorityType.GUEST;
List<UserEntity> users = userMgmtRepository.findByViewidIn(Arrays.asList(viewidArr)).stream().map(item -> {
item.setUserRole(role.name());
item.setAcceptYn("Y".equals(acceptyn) ? true : false);
return item;
}).collect(Collectors.toList());
userMgmtRepository.saveAll(users);
return VarsqlUtils.getResponseResultItemOne(1);
}
use of com.varsql.web.model.entity.user.UserEntity in project varsql by varsqlinfo.
the class UserMgmtServiceImpl method initPassword.
/**
* @Method Name : initPassword
* @Method 설명 : 패스워드 초기화
* @작성자 : ytkim
* @작성일 : 2017. 12. 1.
* @변경이력 :
* @param PasswordForm
* @return
* @throws EncryptDecryptException
*/
public ResponseResult initPassword(String viewid) throws EncryptDecryptException {
String passwordInfo = PasswordUtil.createPassword(Configuration.getInstance().passwordType(), Configuration.getInstance().passwordInitSize());
UserEntity entity = userMgmtRepository.findByViewid(viewid);
entity.setUpw(passwordInfo);
entity = userMgmtRepository.save(entity);
return VarsqlUtils.getResponseResultItemOne(passwordInfo);
}
use of com.varsql.web.model.entity.user.UserEntity in project varsql by varsqlinfo.
the class ManagerMgmtServiceImpl method updateManagerRole.
/**
* @method : updateManagerRole
* @desc : 매니저 role 등록 삭제.
* @author : ytkim
* @date : 2020. 4. 22.
* @param mode
* @param viewid
* @return
*/
@Transactional(value = ResourceConfigConstants.APP_TRANSMANAGER, rollbackFor = Exception.class)
public ResponseResult updateManagerRole(String mode, String viewid) {
logger.info("updateManagerRole mode : {} , viewid : {} ", mode, viewid);
UserEntity userInfo = userMgmtRepository.findByViewid(viewid);
userInfo.setUserRole("add".equals(mode) ? AuthorityType.MANAGER.name() : AuthorityType.USER.name());
userInfo = userMgmtRepository.save(userInfo);
if (!"add".equals(mode)) {
dbManagerRepository.deleteByViewid(viewid);
}
return VarsqlUtils.getResponseResultItemOne(1);
}
use of com.varsql.web.model.entity.user.UserEntity in project varsql by varsqlinfo.
the class UserPreferencesServiceImpl method updatePasswordInfo.
/**
* @Method Name : updatePasswordInfo
* @Method 설명 : 비밀번호 변경.
* @작성자 : ytkim
* @작성일 : 2017. 11. 29.
* @변경이력 :
* @param passwordForm
* @param resultObject
* @return
* @throws EncryptDecryptException
*/
public ResponseResult updatePasswordInfo(PasswordRequestDTO passwordForm) throws EncryptDecryptException {
UserEntity userInfo = userMgmtRepository.findByViewid(SecurityUtil.userViewId());
ResponseResult resultObject = new ResponseResult();
if (passwordEncoder.matches(passwordForm.getCurrPw(), userInfo.getUpw())) {
userInfo.setUpw(passwordForm.getUpw());
userMgmtRepository.save(userInfo);
resultObject.setItemOne(1);
} else {
resultObject.setResultCode(VarsqlAppCode.COMM_PASSWORD_NOT_VALID);
}
return resultObject;
}
Aggregations