Skip to content

Commit

Permalink
fix: market qr 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Aug 5, 2024
1 parent cf6efd5 commit e9b0a90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public interface MarketQrVisitRepository extends JpaRepository<MarketQrVisit, Long> {

MarketQrVisit findByMarketId(Long marketId);
MarketQrVisit findByMarketIdAAndUserUserId(Long marketId, Long userId);

Integer countAllByMarketIdAndUserUserId(Long marketId, Long userId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.likelion.coremodule.market.domain.Market;
import com.likelion.coremodule.market.domain.MarketQrVisit;
import com.likelion.coremodule.market.repository.MarketQrVisitRepository;
import com.likelion.coremodule.market.repository.MarketRepository;
import com.likelion.coremodule.store.repository.StoreRepository;
import com.likelion.coremodule.user.domain.User;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand All @@ -15,13 +13,11 @@
@Transactional
public class HomeQueryService {

private final MarketRepository marketRepository;
private final MarketQrVisitRepository marketQrVisitRepository;
private final StoreRepository storeRepository;

public void updateQrVisit(User user, Market market) {

MarketQrVisit marketQrVisit = marketQrVisitRepository.findByMarketId(market.getId());
MarketQrVisit marketQrVisit = marketQrVisitRepository.findByMarketIdAAndUserUserId(market.getId(), user.getUserId());

if (marketQrVisit != null) {
marketQrVisit.updateQrVisit();
Expand Down

0 comments on commit e9b0a90

Please sign in to comment.