@Override
public RpcResponse<List<HobbiesVo>> queryHobbies(Long userId) {
try{
List<HobbiesVo> userHobbyVoList= userHobbyApi.singleUserhobbies(userId).getData();
List<HobbiesVo> hobbiesList=hobbiesService.queryHobbies();
List<HobbiesVo> hobbiesList_=new ArrayList<HobbiesVo>();
if(userHobbyVoList.size()>0){
for(HobbiesVo UserHobbyVo:userHobbyVoList){
for (HobbiesVo HobbiesVo:hobbiesList){
if(HobbiesVo.getHobbyName().equals(UserHobbyVo.getHobbyName())){
hobbiesList_.add(HobbiesVo);
}
}
}
hobbiesList.removeAll(hobbiesList_);
}
return ResponseModel.returnListSuccess(hobbiesList);
}catch (Exception e){
logger.error("获取爱好列表失败", e);
return ResponseModel.returnException(e);
}
}