mirror of
https://github.com/cna-bootcamp/lifesub.git
synced 2025-12-06 08:06:24 +00:00
release
This commit is contained in:
parent
11a49c33a8
commit
ba3405bff3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -25,7 +25,7 @@ jwt:
|
||||
access-token-validity: ${JWT_ACCESS_TOKEN_VALIDITY:3600000}
|
||||
refresh-token-validity: ${JWT_REFRESH_TOKEN_VALIDITY:86400000}
|
||||
|
||||
allowed-origins: ${ALLOWED_ORIGINS:*}
|
||||
allowed-origins: ${ALLOWED_ORIGINS:http://localhost:3000}
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
|
||||
Binary file not shown.
@ -25,7 +25,7 @@ jwt:
|
||||
access-token-validity: ${JWT_ACCESS_TOKEN_VALIDITY:3600000}
|
||||
refresh-token-validity: ${JWT_REFRESH_TOKEN_VALIDITY:86400000}
|
||||
|
||||
allowed-origins: ${ALLOWED_ORIGINS:*}
|
||||
allowed-origins: ${ALLOWED_ORIGINS:http://localhost:3000}
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -6,6 +6,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@Builder
|
||||
public class MySubResponse {
|
||||
private final Long id;
|
||||
private final String serviceName;
|
||||
private final String logoUrl;
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import com.unicorn.lifesub.mysub.biz.usecase.out.*;
|
||||
import com.unicorn.lifesub.common.exception.BusinessException;
|
||||
import com.unicorn.lifesub.common.exception.ErrorCode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -48,6 +49,7 @@ public class MySubscriptionService implements
|
||||
public List<MySubResponse> getMySubscriptions(String userId) {
|
||||
return mySubscriptionReader.findByUserId(userId).stream()
|
||||
.map(subscription -> MySubResponse.builder()
|
||||
.id(subscription.getSubscription().getId())
|
||||
.serviceName(subscription.getSubscription().getName())
|
||||
.logoUrl(subscription.getSubscription().getLogoUrl())
|
||||
.build())
|
||||
@ -111,9 +113,13 @@ public class MySubscriptionService implements
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Value("${fee.level.collector}")
|
||||
private long collectorThreshold;
|
||||
@Value("${fee.level.addict}")
|
||||
private long addictThreshold;
|
||||
private String calculateFeeLevel(long totalFee) {
|
||||
if (totalFee < 100000) return FeeLevel.LIKFER.getFeeLevel();
|
||||
if (totalFee < 200000) return FeeLevel.COLLECTOR.getFeeLevel();
|
||||
if (totalFee < collectorThreshold) return FeeLevel.LIKFER.getFeeLevel();
|
||||
if (totalFee < addictThreshold) return FeeLevel.COLLECTOR.getFeeLevel();
|
||||
return FeeLevel.ADDICT.getFeeLevel();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@ -22,7 +22,13 @@ spring:
|
||||
jwt:
|
||||
secret-key: ${JWT_SECRET_KEY:8O2HQ13etL2BWZvYOiWsJ5uWFoLi6NBUG8divYVoCgtHVvlk3dqRksMl16toztDUeBTSIuOOPvHIrYq11G2BwQ}
|
||||
|
||||
allowed-origins: ${ALLOWED_ORIGINS:*}
|
||||
allowed-origins: ${ALLOWED_ORIGINS:http://localhost:3000}
|
||||
|
||||
# 총구독료에 따른 구독서비스 사용 레벨 기준 금액
|
||||
fee:
|
||||
level:
|
||||
collector: ${FEE_LEVEL_COLLECTOR:50000}
|
||||
addict: ${FEE_LEVEL_ADDICT:100000}
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
|
||||
Binary file not shown.
@ -11,6 +11,7 @@ import com.unicorn.lifesub.mysub.infra.gateway.repository.MySubscriptionJpaRepos
|
||||
import com.unicorn.lifesub.mysub.infra.gateway.repository.SubscriptionJpaRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@ -49,7 +50,10 @@ public class MySubscriptionGateway implements MySubscriptionReader, MySubscripti
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
mySubscriptionRepository.deleteById(id);
|
||||
@Transactional
|
||||
public void delete(Long subscriptionId) {
|
||||
MySubscriptionEntity entity = mySubscriptionRepository.findBySubscription_Id(subscriptionId)
|
||||
.orElseThrow(() -> new BusinessException(ErrorCode.SUBSCRIPTION_NOT_FOUND));
|
||||
mySubscriptionRepository.delete(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,9 @@ package com.unicorn.lifesub.mysub.infra.gateway.repository;
|
||||
import com.unicorn.lifesub.mysub.infra.gateway.entity.MySubscriptionEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface MySubscriptionJpaRepository extends JpaRepository<MySubscriptionEntity, Long> {
|
||||
List<MySubscriptionEntity> findByUserId(String userId);
|
||||
Optional<MySubscriptionEntity> findBySubscription_Id(Long subscriptionId);
|
||||
}
|
||||
|
||||
@ -22,7 +22,13 @@ spring:
|
||||
jwt:
|
||||
secret-key: ${JWT_SECRET_KEY:8O2HQ13etL2BWZvYOiWsJ5uWFoLi6NBUG8divYVoCgtHVvlk3dqRksMl16toztDUeBTSIuOOPvHIrYq11G2BwQ}
|
||||
|
||||
allowed-origins: ${ALLOWED_ORIGINS:*}
|
||||
allowed-origins: ${ALLOWED_ORIGINS:http://localhost:3000}
|
||||
|
||||
# 총구독료에 따른 구독서비스 사용 레벨 기준 금액
|
||||
fee:
|
||||
level:
|
||||
collector: ${FEE_LEVEL_COLLECTOR:50000}
|
||||
addict: ${FEE_LEVEL_ADDICT:100000}
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
|
||||
@ -22,7 +22,7 @@ spring:
|
||||
jwt:
|
||||
secret-key: ${JWT_SECRET_KEY:8O2HQ13etL2BWZvYOiWsJ5uWFoLi6NBUG8divYVoCgtHVvlk3dqRksMl16toztDUeBTSIuOOPvHIrYq11G2BwQ}
|
||||
|
||||
allowed-origins: ${ALLOWED_ORIGINS:*}
|
||||
allowed-origins: ${ALLOWED_ORIGINS:http://localhost:3000}
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
|
||||
@ -22,7 +22,7 @@ spring:
|
||||
jwt:
|
||||
secret-key: ${JWT_SECRET_KEY:8O2HQ13etL2BWZvYOiWsJ5uWFoLi6NBUG8divYVoCgtHVvlk3dqRksMl16toztDUeBTSIuOOPvHIrYq11G2BwQ}
|
||||
|
||||
allowed-origins: ${ALLOWED_ORIGINS:*}
|
||||
allowed-origins: ${ALLOWED_ORIGINS:http://localhost:3000}
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user