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

2/27 배포 #94

Merged
merged 4 commits into from
Mar 26, 2024
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 @@ -21,5 +21,6 @@ public class OrderDto {
private LocalDateTime time;
private String method;
private Long price;
private Long salePrice;
private boolean isCouponUsed;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ private OrderDto toOrderDto(Order order) {
.pickUp(order.getInOut())
.time(order.getCreatedAt())
.phone(order.getUserInfo().getPhone())
.price(order.getAmount())
.price(order.getTotalAmount())
.salePrice(order.getAmount())
.method(order.getMethod())
.foodies(order.getCart()
.getCartItems()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class VerificationService {

public String createVerificationCode(String phoneNumber, boolean someBooleanValue) {
String code = UUID.randomUUID().toString().substring(0, 6);
redisTemplate.opsForValue().set(phoneNumber + ":code", code, 5, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(phoneNumber + ":flag", String.valueOf(someBooleanValue), 5, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(phoneNumber + ":code", code, 3, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(phoneNumber + ":flag", String.valueOf(someBooleanValue), 3, TimeUnit.MINUTES);
return code;
}

Expand All @@ -28,7 +28,7 @@ public boolean verifyCode(String phoneNumber, String code) {
String storedCode = redisTemplate.opsForValue().get(storedCodeKey);
if (storedCode != null && storedCode.equals(code)) {
// 인증 코드가 일치하면 플래그 값을 true로 설정
redisTemplate.opsForValue().set(flagKey, "true", 5, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(flagKey, "true", 3, TimeUnit.MINUTES);
return true;
} else {
return false;
Expand All @@ -47,8 +47,8 @@ public boolean verifyNumberToChangePassword(String phoneNumber) {

public String createVerificationCodeToChangePassword(String phoneNumber, boolean someBooleanValue) {
String code = UUID.randomUUID().toString().substring(0, 6);
redisTemplate.opsForValue().set(phoneNumber + ":pwcode", code, 5, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(phoneNumber + ":pwflag", String.valueOf(someBooleanValue), 5, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(phoneNumber + ":pwcode", code, 3, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(phoneNumber + ":pwflag", String.valueOf(someBooleanValue), 3, TimeUnit.MINUTES);
return code;
}

Expand All @@ -59,7 +59,7 @@ public boolean verifyCodeToChangePassword(String phoneNumber, String code) {
String storedCode = redisTemplate.opsForValue().get(storedCodeKey);
if (storedCode != null && storedCode.equals(code)) {
// 인증 코드가 일치하면 플래그 값을 true로 설정
redisTemplate.opsForValue().set(flagKey, "true", 5, TimeUnit.MINUTES);
redisTemplate.opsForValue().set(flagKey, "true", 3, TimeUnit.MINUTES);
return true;
} else {
return false;
Expand Down
Loading