Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 로그 찍기 #183

Merged
merged 3 commits into from
Aug 30, 2023
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 @@ -77,7 +77,7 @@ private BooleanExpression eqStatus(final LiquorStatus liquorStatus) {
if (Objects.isNull(liquorStatus)) {
return null;
}
return liquor.status.eq(liquorStatus);
return liquor.status.type.eq(liquorStatus.getType());
}

private BooleanExpression eqBrand(final String brand) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
import com.woowacamp.soolsool.core.member.domain.vo.MemberRoleType;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@RequiredArgsConstructor
public class MemberRoleCache {

private final MemberRoleRepository memberRoleRepository;

@Cacheable(value = "memberRole", key = "#name")
public Optional<MemberRole> findByName(final MemberRoleType name) {
log.info("MemberRoleCache findByName");
return memberRoleRepository.findByName(name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private MemberRole getMemberRole(final String memberRequestRoleType) {
.filter(type -> Objects.equals(type.getType(), memberRequestRoleType))
.findFirst()
.orElse(MemberRoleType.CUSTOMER);

log.info("memberRoleType : {}", memberRoleType);
return memberRoleRepository.findByName(memberRoleType)
.orElseThrow(() -> new SoolSoolException(MEMBER_NO_ROLE_TYPE));
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
spring:
profiles:
active: dev
redis:
host: ${SOOLSOOL_REDIS_HOST}
port: ${SOOLSOOL_REDIS_PORT}
jpa:
properties:
hibernate:
Expand Down