|
@@ -1,13 +1,12 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import com.diagbot.client.AiptServiceClient;
|
|
|
import com.diagbot.dto.ConceptIntroduceDTO;
|
|
|
-import com.diagbot.dto.RespDTO;
|
|
|
-import com.diagbot.util.RespDTOUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.ConceptIntroduceVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -18,7 +17,7 @@ import java.util.List;
|
|
|
@Component
|
|
|
public class ConceptDetailFacade {
|
|
|
@Autowired
|
|
|
- private AiptServiceClient aiptServiceClient;
|
|
|
+ private ConceptDetailCacheFacade conceptDetailCacheFacade;
|
|
|
|
|
|
/**
|
|
|
* 获取提示信息
|
|
@@ -27,9 +26,7 @@ public class ConceptDetailFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public ConceptIntroduceDTO getConceptDetail(ConceptIntroduceVO conceptIntroduceVO) {
|
|
|
- RespDTO<ConceptIntroduceDTO> res = aiptServiceClient.getConceptDetail(conceptIntroduceVO);
|
|
|
- RespDTOUtil.respNGDeal(res, "获取静态知识失败");
|
|
|
- return res.data;
|
|
|
+ return conceptDetailCacheFacade.getConceptDetail(conceptIntroduceVO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -39,8 +36,16 @@ public class ConceptDetailFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<ConceptIntroduceDTO> getConceptDetails(List<ConceptIntroduceVO> conceptIntroduceVOList) {
|
|
|
- RespDTO<List<ConceptIntroduceDTO>> res = aiptServiceClient.getConceptDetails(conceptIntroduceVOList);
|
|
|
- RespDTOUtil.respNGDeal(res, "获取静态知识失败");
|
|
|
- return res.data;
|
|
|
+ List<ConceptIntroduceDTO> res = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(conceptIntroduceVOList)) {
|
|
|
+ for (ConceptIntroduceVO conceptIntroduceVO : conceptIntroduceVOList) {
|
|
|
+ ConceptIntroduceDTO conceptIntroduceDTO
|
|
|
+ = conceptDetailCacheFacade.getConceptDetail(conceptIntroduceVO);
|
|
|
+ if (null != conceptIntroduceDTO) {
|
|
|
+ res.add(conceptIntroduceDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
}
|
|
|
}
|