-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat : 환율 정보 제공 API 추가
1 parent
80eb5f5
commit ffa951a
Showing
5 changed files
with
147 additions
and
63 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
22 changes: 22 additions & 0 deletions
22
backend/src/main/java/com/isp/backend/domain/country/mapper/ExchangeRateMapper.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,22 @@ | ||
package com.isp.backend.domain.country.mapper; | ||
|
||
import com.isp.backend.domain.country.dto.response.ExchangeRateResponse; | ||
import com.isp.backend.domain.country.entity.ExchangeRate; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class ExchangeRateMapper { | ||
|
||
public ExchangeRateResponse convertToDto(ExchangeRate exchangeRate) { | ||
ExchangeRateResponse dto = new ExchangeRateResponse(); | ||
dto.setBaseCurrency(exchangeRate.getBaseCurrency()); | ||
dto.setTargetCurrency(exchangeRate.getTargetCurrency()); | ||
dto.setRate(BigDecimal.valueOf(exchangeRate.getRate())); | ||
return dto; | ||
} | ||
|
||
} |
8 changes: 0 additions & 8 deletions
8
backend/src/main/java/com/isp/backend/domain/country/repository/ExchageRateRespository.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
backend/src/main/java/com/isp/backend/domain/country/repository/ExchangeRateRepository.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,9 @@ | ||
package com.isp.backend.domain.country.repository; | ||
|
||
import com.isp.backend.domain.country.entity.ExchangeRate; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface ExchangeRateRepository extends JpaRepository<ExchangeRate, Long> { | ||
ExchangeRate findByBaseCurrencyAndTargetCurrency(String baseCurrency, String targetCurrency); | ||
|
||
} |
136 changes: 98 additions & 38 deletions
136
backend/src/main/java/com/isp/backend/domain/country/service/ExchangeRateService.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