diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java index 24e1d59b..0468086d 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java @@ -19,9 +19,7 @@ import com.red.circle.wallet.inner.model.cmd.UserFreightBalancePageQryCmd; import com.red.circle.wallet.inner.model.dto.UserFreightBalanceDTO; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -127,27 +125,24 @@ public class UserFreightBalanceRestServiceImpl implements UserFreightBalanceRest * @param countryFlagMap 国家代码到国旗URL的映射 * @return 所有匹配的国旗URL(逗号分隔),如果没有匹配则返回空字符串 */ - private String matchNationalFlag(String supportedCountries, Map countryFlagMap) { + private List matchNationalFlag(String supportedCountries, Map countryFlagMap) { if (supportedCountries == null || supportedCountries.isEmpty() || countryFlagMap.isEmpty()) { - return ""; + return new ArrayList<>(0); } // 分割支持的国家代码 String[] countries = supportedCountries.split(","); // 收集所有匹配到的国旗URL - StringBuilder flagUrls = new StringBuilder(); + List flagUrls = new ArrayList<>(); for (String country : countries) { String countryCode = country.trim(); if (countryFlagMap.containsKey(countryCode)) { - if (!flagUrls.isEmpty()) { - flagUrls.append(","); - } - flagUrls.append(countryFlagMap.get(countryCode)); + flagUrls.add(countryFlagMap.get(countryCode)); } } - return flagUrls.toString(); + return flagUrls; } } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/UserFreightBalanceCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/UserFreightBalanceCO.java index ea8b48e4..70820bce 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/UserFreightBalanceCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/user/UserFreightBalanceCO.java @@ -6,6 +6,8 @@ import com.red.circle.framework.dto.ClientObject; import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import java.math.BigDecimal; import java.sql.Timestamp; +import java.util.List; + import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -131,6 +133,6 @@ public class UserFreightBalanceCO extends ClientObject { /** * 支持的国家国旗URL列表(根据supportedCountries匹配所有国旗,逗号分隔). */ - private String nationalFlag; + private List nationalFlag; }