-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Orange-Co/feature/search
Feature/search: 최근 본 상품 저장
- Loading branch information
Showing
12 changed files
with
123 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/co/orange/ddanzi/dto/search/SearchPageResponseDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package co.orange.ddanzi.dto.search; | ||
|
||
import co.orange.ddanzi.dto.ProductInfo; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
public class SearchPageResponseDto { | ||
private List<String> topSearchedList; | ||
private List<ProductInfo> recentlyViewedList; | ||
} |
35 changes: 0 additions & 35 deletions
35
src/main/java/co/orange/ddanzi/global/config/redis/RedisController.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/co/orange/ddanzi/global/redis/RedisRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package co.orange.ddanzi.global.redis; | ||
|
||
import java.util.Set; | ||
|
||
public interface RedisRepository { | ||
void saveDeviceToken(String deviceToken, String productId); | ||
|
||
Set<String> getRecentProducts(String deviceToken); | ||
|
||
void deleteDeviceToken(String deviceToken); | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/co/orange/ddanzi/global/redis/RedisRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package co.orange.ddanzi.global.redis; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.data.redis.core.RedisOperations; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Set; | ||
|
||
|
||
@Slf4j | ||
@Repository | ||
public class RedisRepositoryImpl implements RedisRepository { | ||
|
||
private static final String DEVICE_PREFIX = "device:"; | ||
|
||
private final RedisTemplate<String, String> redisTemplate; | ||
|
||
public RedisRepositoryImpl(RedisTemplate<String, String> redisTemplate) { | ||
this.redisTemplate = redisTemplate; | ||
} | ||
|
||
@Override | ||
public void saveDeviceToken(String deviceToken, String productId) { | ||
redisTemplate.opsForSet().add(DEVICE_PREFIX + deviceToken, productId); | ||
} | ||
|
||
@Override | ||
public Set<String> getRecentProducts(String deviceToken) { | ||
return redisTemplate.opsForSet().members(DEVICE_PREFIX + deviceToken); | ||
} | ||
|
||
@Override | ||
public void deleteDeviceToken(String deviceToken) { | ||
redisTemplate.delete(DEVICE_PREFIX + deviceToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters