Add IExchangeResultDataConvertor interface for customizable exchange result format - #5
Draft
juwencheng with Copilot wants to merge 2 commits into
Draft
Add IExchangeResultDataConvertor interface for customizable exchange result format#5juwencheng with Copilot wants to merge 2 commits into
juwencheng with Copilot wants to merge 2 commits into
Conversation
…xchange data format Co-authored-by: juwencheng <2663764+juwencheng@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Convert method for exchange rate conversion
Add IExchangeResultDataConvertor interface for customizable exchange result format
Mar 18, 2026
Owner
|
@cursor review 这个 PR,看看还有什么问题没有 |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users had no way to customize the format of exchange rate data appended to API responses — it was hardcoded via
ExchangeResultDto.toMap()returning{base, trans, rate, price}.Changes
IExchangeResultDataConvertorinterface (core/convertor/) — singleconvert(ExchangeResultDto)method returningMap<String, Object>DefaultExchangeResultDataConvertor— default implementation delegating totoMap(), preserving backward compatibilityAutoApplyExchangeStrategy— now acceptsIExchangeResultDataConvertorvia constructor; replacesexchangeResult.toMap()withconvertor.convert(exchangeResult)AutoExchangeAutoConfiguration— registersDefaultExchangeResultDataConvertoras@ConditionalOnMissingBean, allowing users to override with a custom@BeanUsage
Override the default format by providing a custom bean:
This replaces the default
{base, trans, rate, price}structure with whatever shape the user defines.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.