-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Redis 환경 기능 개선 + 상시 위치 정보 알림 API 구현 (#30)
✨ feat: Redis 환경 기능 개선 + 상시 위치 정보 알림 API 구현 (#30)
- Loading branch information
Showing
8 changed files
with
79 additions
and
21 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
16 changes: 16 additions & 0 deletions
16
noti-service/src/main/java/com/waither/notiservice/dto/LocationDto.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,16 @@ | ||
package com.waither.notiservice.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class LocationDto { | ||
|
||
public double x; | ||
|
||
public double y; | ||
} |
9 changes: 0 additions & 9 deletions
9
noti-service/src/main/java/com/waither/notiservice/redis/FireTokenBaseRepository.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
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
34 changes: 34 additions & 0 deletions
34
noti-service/src/main/java/com/waither/notiservice/utils/RedisUtils.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,34 @@ | ||
package com.waither.notiservice.utils; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class RedisUtils { | ||
|
||
private final RedisTemplate<String, Object> redisTemplate; | ||
|
||
public void save(String key, Object val) { | ||
redisTemplate.opsForValue().set(key, val); | ||
} | ||
|
||
public void save(String key, Object val, long timeout, TimeUnit unit ) { | ||
redisTemplate.opsForValue().set(key, val, timeout, unit); | ||
} | ||
|
||
public boolean hasKey(String key) { | ||
return Boolean.TRUE.equals(redisTemplate.hasKey(key)); | ||
} | ||
|
||
public Object get(String key) { | ||
return redisTemplate.opsForValue().get(key); | ||
} | ||
|
||
public boolean delete(String key) { | ||
return Boolean.TRUE.equals(redisTemplate.delete(key)); | ||
} | ||
} |
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