字段修改
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 com.red.circle.wallet.inner.model.dto.UserFreightBalanceDTO;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Map;
|
import java.util.*;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -127,27 +125,24 @@ public class UserFreightBalanceRestServiceImpl implements UserFreightBalanceRest
|
|||||||
* @param countryFlagMap 国家代码到国旗URL的映射
|
* @param countryFlagMap 国家代码到国旗URL的映射
|
||||||
* @return 所有匹配的国旗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()) {
|
if (supportedCountries == null || supportedCountries.isEmpty() || countryFlagMap.isEmpty()) {
|
||||||
return "";
|
return new ArrayList<>(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分割支持的国家代码
|
// 分割支持的国家代码
|
||||||
String[] countries = supportedCountries.split(",");
|
String[] countries = supportedCountries.split(",");
|
||||||
|
|
||||||
// 收集所有匹配到的国旗URL
|
// 收集所有匹配到的国旗URL
|
||||||
StringBuilder flagUrls = new StringBuilder();
|
List<String> flagUrls = new ArrayList<>();
|
||||||
for (String country : countries) {
|
for (String country : countries) {
|
||||||
String countryCode = country.trim();
|
String countryCode = country.trim();
|
||||||
if (countryFlagMap.containsKey(countryCode)) {
|
if (countryFlagMap.containsKey(countryCode)) {
|
||||||
if (!flagUrls.isEmpty()) {
|
flagUrls.add(countryFlagMap.get(countryCode));
|
||||||
flagUrls.append(",");
|
|
||||||
}
|
|
||||||
flagUrls.append(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 com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
@ -131,6 +133,6 @@ public class UserFreightBalanceCO extends ClientObject {
|
|||||||
/**
|
/**
|
||||||
* 支持的国家国旗URL列表(根据supportedCountries匹配所有国旗,逗号分隔).
|
* 支持的国家国旗URL列表(根据supportedCountries匹配所有国旗,逗号分隔).
|
||||||
*/
|
*/
|
||||||
private String nationalFlag;
|
private List<String> nationalFlag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user