字段修改
This commit is contained in:
parent
9fcc725040
commit
71cddc71fc
@ -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<String, String> countryFlagMap) {
|
||||
private List<String> matchNationalFlag(String supportedCountries, Map<String, String> countryFlagMap) {
|
||||
if (supportedCountries == null || supportedCountries.isEmpty() || countryFlagMap.isEmpty()) {
|
||||
return "";
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
|
||||
// 分割支持的国家代码
|
||||
String[] countries = supportedCountries.split(",");
|
||||
|
||||
// 收集所有匹配到的国旗URL
|
||||
StringBuilder flagUrls = new StringBuilder();
|
||||
List<String> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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<String> nationalFlag;
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user