Skip to content

Commit

Permalink
fix : 계좌 조회 문제 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ehBeak committed Dec 5, 2023
1 parent 5ea6a50 commit 1434b26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private HouseHoldJpaEntity getHouseHoldJpaEntityOfUser(Household household) {
}

private Household getHouseHoldOfUserJpaEntity(HouseHoldJpaEntity houseHoldJpaEntity) {

if (houseHoldJpaEntity == null || houseHoldJpaEntity instanceof HibernateProxy) {
System.out.println("hello1");
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.connect.accountApp.domain.user.adapter.out.persistence;

import com.connect.accountApp.domain.household.adapter.out.persistence.HouseholdMapper;
import com.connect.accountApp.domain.household.adapter.out.persistence.jpa.model.HouseHoldJpaEntity;
import com.connect.accountApp.domain.household.domain.model.Household;
import com.connect.accountApp.domain.user.adapter.out.persistence.jpa.model.UserJpaEntity;
import com.connect.accountApp.domain.user.adapter.out.persistence.jpa.UserQueryRepository;
Expand Down Expand Up @@ -55,10 +56,6 @@ public Boolean userExist(String email) {
public User findUserWithHousehold(String userEmail) {

UserJpaEntity userJpaEntity = userQueryRepository.findUserJpaEntityWithHouseholdByEmail(userEmail);

System.out.println(
"userJpaEntity.getHouseHoldJpaEntity().getHouseholdId() = " + userJpaEntity.getHouseHoldJpaEntity()
.getHouseholdId());
return userMapper.mapToDomainEntity(userJpaEntity);
}

Expand Down Expand Up @@ -86,6 +83,12 @@ public List<User> findHouseholdMembers(Long householdId) {
.map(userMapper::mapToDomainEntity).toList();
}

@Override
public Long findHouseholdId(String userEmail) {
UserJpaEntity userJpaEntity = userQueryRepository.findUserJpaEntityWithHouseholdByEmail(userEmail);
return userJpaEntity.getHouseHoldJpaEntity().getHouseholdId();
}

@Override
public void save(User user) {
UserJpaEntity userJpaEntity = userMapper.mapToJpaEntity(user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ public interface FindHouseholdUserListPort {

List<User> findHouseholdMembers(Long householdId);

Long findHouseholdId(String userEmail);

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,9 @@ public User getUserAccount(String userEmail) {

@Override
public List<User> getMembersAccount(String userEmail) {
System.out.println("userEmail = " + userEmail);
User user = getUserPort.findUserWithHousehold(userEmail);
System.out.println("user = " + user.getUserId());
System.out.println("user = " + user.getUserAccount());
System.out.println("user = " + user.getUserNickname());
System.out.println("user = " + user.getHousehold());

System.out.println("user.getHousehold()1 = " + user.getHousehold());
// List<User> householdMembers = findHouseholdUserListPort.findHouseholdMembers();

// System.out.println("householdMembers.size() = " + householdMembers.size());
return findHouseholdUserListPort.findHouseholdMembers(user.getHousehold().getHouseholdId());

Long householdId = findHouseholdUserListPort.findHouseholdId(userEmail);

return findHouseholdUserListPort.findHouseholdMembers(householdId);
}
}

0 comments on commit 1434b26

Please sign in to comment.