velog 글쓰기 첫 연습용.
public void saveAccount(Account msgEntity) {
accountRepository.findByUsrId(msgEntity.getUsrId())
.map(p -> {
msgEntity.setId(p.getId());
msgEntity.setUpdDt(LocalDateTime.now());
return msgEntity;
})
.flatMap(p -> accountRepository.save(p))
.switchIfEmpty(accountRepository.save(msgEntity))
.subscribe();
}