fix(接口自动化): 接口自动化多节点执行问题调整
This commit is contained in:
parent
78f15b801c
commit
fbdb707d7a
|
@ -31,8 +31,9 @@ import java.util.Map;
|
|||
@Service
|
||||
public class MsKafkaListener {
|
||||
public static final String TOPICS = "ms-api-exec-topic";
|
||||
public static final String CONSUME_ID = "ms-api-exec-consume";
|
||||
|
||||
@KafkaListener(topics = TOPICS)
|
||||
@KafkaListener(id = CONSUME_ID, topics = TOPICS, groupId = "${spring.kafka.consumer.group-id}")
|
||||
public void consume(ConsumerRecord<?, String> record) {
|
||||
LogUtil.info("接收到执行结果开始存储");
|
||||
this.save(record.value());
|
||||
|
|
|
@ -55,7 +55,7 @@ public class ApiDefinitionExecResultService {
|
|||
ApiDefinitionExecResult saveResult = new ApiDefinitionExecResult();
|
||||
saveResult.setId(UUID.randomUUID().toString());
|
||||
saveResult.setCreateTime(item.getStartTime());
|
||||
saveResult.setUserId(Objects.requireNonNull(SessionUtils.getUser()).getId());
|
||||
saveResult.setUserId(result.getUserId());
|
||||
saveResult.setName(item.getName());
|
||||
if (item.getName().indexOf("<->") != -1) {
|
||||
saveResult.setName(item.getName().substring(0, item.getName().indexOf("<->")));
|
||||
|
|
Loading…
Reference in New Issue