Commit 41a55aa0 by jianan

国家地区查询接口8

parent 40366dfa
...@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service; ...@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -32,7 +33,9 @@ public class ApiMdCountryServiceImpl implements ApiMdCountryService { ...@@ -32,7 +33,9 @@ public class ApiMdCountryServiceImpl implements ApiMdCountryService {
List<ApiMdCountryVO> groupList = list.stream().map(this::objToVo).collect(Collectors.toList()); List<ApiMdCountryVO> groupList = list.stream().map(this::objToVo).collect(Collectors.toList());
// 热门国家/地区 // 热门国家/地区
List<ApiMdCountryVO> hotList =groupList.stream().filter(item->item.getHotRank()!=9999).collect(Collectors.toList()); List<ApiMdCountryVO> hotList = groupList.stream().filter(item -> item.getHotRank() != 9999)
.sorted(Comparator.comparing(ApiMdCountryVO::getHotRank))
.collect(Collectors.toList());
response.setHotCountries(hotList); response.setHotCountries(hotList);
response.setGroupCountries(groupList); response.setGroupCountries(groupList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment