Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public UserPersistResponse create(UserCreateRequest request) {
return UserPersistResponse.from(user);
}

@Transactional(readOnly = true)
public UserCache getUserCacheById(Long id) {
UserCache userCache = userQueryService.getUserCacheById(id);

Expand All @@ -85,6 +86,7 @@ public UserCache getUserCacheById(Long id) {
return userCache;
}

@Transactional(readOnly = true)
public PaginatedListResponse getAll(Pageable pageable) {
Page<UserCache> userCaches = userQueryService.getCaches(pageable);

Expand Down
3 changes: 3 additions & 0 deletions team1-api/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
spring:
kafka:
bootstrap-servers: 127.0.0.1:19092,127.0.0.1:19094,127.0.0.1:19096

jpa:
hibernate:
ddl-auto: update
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import goorm.deepdive.team1.domain.user.domain.User;
import goorm.deepdive.team1.domain.user.domain.UserCache;
Expand All @@ -19,7 +18,6 @@

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class UserQueryService {
private final UserRepository userRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ public interface UserRepository {

void deleteById(Long id);

boolean existsById(Long id);

Page<UserDocument> searchByRoadAddress(String keyword, Pageable pageable);

Page<UserDocument> searchByRegionAddress(String keyword, Pageable pageable);

Page<UserDocument> searchByName(String name, Pageable pageable);

boolean existsByEmail(String email);

void saveCache(UserCache userCache);

void saveAllCache(List<UserCache> userCaches);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ public void deleteById(Long id) {
userDocuments.remove(id.toString());
}

@Override
public boolean existsById(Long id) {
return users.containsKey(id);
}

@Override
public boolean existsByEmail(String email) {
return users.values().stream().anyMatch(user -> user.getEmail().equals(email));
}

@Override
public void saveCache(UserCache userCache) {
userCaches.put(userCache.getId(), userCache);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ public void deleteById(Long id) {
jpaUserRepository.deleteById(id);
}

@Override
public boolean existsById(Long id) {
return jpaUserRepository.existsById(id);
}

@Override
public Page<UserDocument> searchByRoadAddress(String keyword, Pageable pageable) {
return elasticUserRepository.searchByRoadAddress(keyword, pageable);
Expand All @@ -75,11 +70,6 @@ public Page<UserDocument> searchByName(String name, Pageable pageable) {
return elasticUserRepository.searchByName(name, pageable);
}

@Override
public boolean existsByEmail(String email) {
return jpaUserRepository.existsByEmail(email);
}

@Override
public void saveCache(UserCache userCache) {
redisUserRepository.save(userCache);
Expand Down
Loading