点赞点踩

This commit is contained in:
zren25
2025-03-11 11:37:46 +08:00
parent c74f26798f
commit a6485821e9
3 changed files with 33 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ import java.time.LocalDateTime;
@Slf4j @Slf4j
@Component @Component
@RestController @RestController
public class CorpusProcessKafkaConsumer { public class CorpusProcessKafkaProducer {
@Autowired @Autowired
private TmTelephoneCorpusService tmTelephoneCorpusService; private TmTelephoneCorpusService tmTelephoneCorpusService;
@@ -46,6 +46,9 @@ public class CorpusProcessKafkaConsumer {
BeanUtils.copyProperties(aicorpusTelephone, tmTelephoneCorpus); BeanUtils.copyProperties(aicorpusTelephone, tmTelephoneCorpus);
tmTelephoneCorpus.setCreateBy("kafka"); tmTelephoneCorpus.setCreateBy("kafka");
tmTelephoneCorpus.setCreateTime(LocalDateTime.now()); tmTelephoneCorpus.setCreateTime(LocalDateTime.now());
// TODO 只处理dcc的
tmTelephoneCorpusService.saveTelephoneCorpus(tmTelephoneCorpus); tmTelephoneCorpusService.saveTelephoneCorpus(tmTelephoneCorpus);
tmTelephoneCorpusService.runTelephoneCorpusDify(aicorpusTelephone); tmTelephoneCorpusService.runTelephoneCorpusDify(aicorpusTelephone);

View File

@@ -0,0 +1,21 @@
package com.volvo.ai.analytic.center.mq;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "${rocketmq.consumer.corpus.isLikeTpoicGroup}",
topic = "${rocketmq.consumer.corpus.isLikeTpoic}",
enableMsgTrace = true)
public class CorpushIsLikeConsumer implements RocketMQListener<MessageExt>{
@Override
public void onMessage(MessageExt messageExt) {
log.info("CorpushIsLikeConsumer message: " + messageExt);
}
}

View File

@@ -20,6 +20,7 @@ import com.volvo.ai.analytic.center.mapper.TmTelephoneCorpusMapper;
import com.volvo.ai.analytic.center.service.DataMaskingRuleService; import com.volvo.ai.analytic.center.service.DataMaskingRuleService;
import com.volvo.ai.analytic.center.service.DiFyService; import com.volvo.ai.analytic.center.service.DiFyService;
import com.volvo.ai.analytic.center.service.TmTelephoneCorpusService; import com.volvo.ai.analytic.center.service.TmTelephoneCorpusService;
import com.volvo.ai.analytic.center.utils.ConstantStr;
import com.volvo.ai.analytic.center.utils.FlowResultSplitUtil; import com.volvo.ai.analytic.center.utils.FlowResultSplitUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
@@ -28,6 +29,7 @@ import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.messaging.support.MessageBuilder; import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,7 @@ import java.util.stream.Collectors;
* @author rz * @author rz
* @date 2025-03-04 * @date 2025-03-04
*/ */
@RefreshScope
@Slf4j @Slf4j
@Service @Service
public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusMapper, TmTelephoneCorpus> implements TmTelephoneCorpusService { public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusMapper, TmTelephoneCorpus> implements TmTelephoneCorpusService {
@@ -53,9 +56,10 @@ public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusM
@Resource @Resource
private RocketMQTemplate rocketMqTemplate; private RocketMQTemplate rocketMqTemplate;
@Value("${rocketmq.corpusTelephone.topic}") @Value("${rocketmq.producer.corpus.topic}")
private String topic; private String topic;
@Value("${dify.corpus.telephoneToken}")
private String telephoneToken;
@Autowired @Autowired
private RemoteCarModelClient remoteCarModelClient; private RemoteCarModelClient remoteCarModelClient;
@@ -80,8 +84,8 @@ public class TmTelephoneCorpusServiceImpl extends ServiceImpl<TmTelephoneCorpusM
Map<String, Object> inputMap = new HashMap(); Map<String, Object> inputMap = new HashMap();
DiFyReq diFyImageReq = new DiFyReq(); DiFyReq diFyImageReq = new DiFyReq();
diFyImageReq.setUser("11111"); diFyImageReq.setUser(ConstantStr.corpus_user);
diFyImageReq.setFlowId("app-peJXSjHjVKdkYxjdOUuPnZ5b"); diFyImageReq.setFlowId(telephoneToken);
JSONObject jsonObject = JSONObject.parseObject( aicorpusTelephone.getDisplay()); JSONObject jsonObject = JSONObject.parseObject( aicorpusTelephone.getDisplay());