|
|
|
@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.reactive.function.client.WebClient; |
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Service |
|
|
|
@ -26,7 +27,7 @@ public class PostToClusteringDomainServiceImpl implements PostToClusteringDomain |
|
|
|
@Override |
|
|
|
public void postToClustering(Long taskId, List<KnowledgePointDTO> kpList) { |
|
|
|
// 构建请求 DTO (AlgoRequestDTO)
|
|
|
|
ClusterQueryDTO request = new ClusterQueryDTO(taskId, kpList); |
|
|
|
List<ClusterQueryDTO> request = Collections.singletonList(new ClusterQueryDTO(taskId, kpList)); |
|
|
|
|
|
|
|
try { |
|
|
|
log.info(">>> [Interactor] 正在向算法端发送请求, TaskId: {}", taskId); |
|
|
|
@ -39,11 +40,11 @@ public class PostToClusteringDomainServiceImpl implements PostToClusteringDomain |
|
|
|
taskId, error.getMessage())) |
|
|
|
// 结果处理(非阻塞订阅)
|
|
|
|
.subscribe(result -> { |
|
|
|
if (result != null && result.getSuccess()) { |
|
|
|
if (result != null) { |
|
|
|
log.info(">>> [Interactor] 算法端已成功接收任务: {}", taskId); |
|
|
|
} else { |
|
|
|
log.warn(">>> [Interactor] 算法端拒绝了请求, TaskId: {}, 消息: {}", |
|
|
|
taskId, result != null ? result.getMessage() : "无返回消息"); |
|
|
|
// log.warn(">>> [Interactor] 算法端拒绝了请求, TaskId: {}, 消息: {}",
|
|
|
|
// taskId, result != null ? result.getMessage() : "无返回消息");
|
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|