mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
refactor(core): remove global running flow context map and exception context reference
This commit is contained in:
@@ -3,10 +3,8 @@ package work.slhaf.partner.runtime.exception.pojo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import work.slhaf.partner.api.common.entity.PersistableObject;
|
||||
import work.slhaf.partner.runtime.interaction.data.context.PartnerRunningFlowContext;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.HashMap;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@@ -14,7 +12,6 @@ public class GlobalExceptionData extends PersistableObject {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected HashMap<String, PartnerRunningFlowContext> context = PartnerRunningFlowContext.getInstance();
|
||||
protected Long exceptionTime = System.currentTimeMillis();
|
||||
private String exceptionMessage;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import work.slhaf.partner.runtime.interaction.data.context.subcontext.ModuleCont
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -21,8 +20,6 @@ public class PartnerRunningFlowContext extends RunningFlowContext {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static HashMap<String, PartnerRunningFlowContext> activeContext = new HashMap<>();
|
||||
|
||||
protected String userId;
|
||||
protected String userNickname;
|
||||
protected String userInfo;
|
||||
@@ -38,14 +35,6 @@ public class PartnerRunningFlowContext extends RunningFlowContext {
|
||||
|
||||
protected String uuid = UUID.randomUUID().toString();
|
||||
|
||||
public PartnerRunningFlowContext() {
|
||||
activeContext.put(userId, this);
|
||||
}
|
||||
|
||||
public static HashMap<String, PartnerRunningFlowContext> getInstance() {
|
||||
return activeContext;
|
||||
}
|
||||
|
||||
public boolean isFinished() {
|
||||
return moduleContext.isFinished();
|
||||
}
|
||||
@@ -59,8 +48,4 @@ public class PartnerRunningFlowContext extends RunningFlowContext {
|
||||
appendPromptList.addFirst(appendedPrompt);
|
||||
}
|
||||
|
||||
public void clearUp() {
|
||||
activeContext.remove(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user