//最終返回集合searchTitleLists
List<TitleContentResp> searchTitleLists = new ArrayList<>();
//根據內容查標題
List<TitleContentResp> searchTitleList = xx.getSearchTitle(titleSearchReq);
if(!searchTitleList.isEmpty()){
for (TitleContentResp titleContentResp:searchTitleList){
searchTitleLists.add(titleContentResp);
}
}
//根據類目1查標題
List<TitleContentResp> searchTitleListByTitle = xx.getSearchTitleByTitle(titleSearchReq);
if(!searchTitleListByTitle.isEmpty()){
for (TitleContentResp titleContentResp:searchTitleListByTitle){
searchTitleLists.add(titleContentResp);
}
//集合中某个属性 去除重复值
searchTitleLists = searchTitleLists.stream().distinct().collect(Collectors.toList());
return searchTitleLists;