1
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
package com.ruoyi.jarvis.domain.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* 企微侧多轮交互会话(与 Jarvis_java JDUtil 中 interaction_state + Redis 存 JSON 方式对齐)
|
||||
*/
|
||||
public class WeComChatSession {
|
||||
|
||||
public static final String SCENE_JD_LOGISTICS_SHARE = "JD_LOGISTICS_SHARE";
|
||||
public static final String STEP_WAIT_REMARK = "WAIT_REMARK";
|
||||
|
||||
private static final DateTimeFormatter FMT = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
|
||||
|
||||
/** 业务场景 */
|
||||
private String scene;
|
||||
/** 当前步骤 */
|
||||
private String step;
|
||||
/** 已识别的京东 3.cn 物流短链 */
|
||||
private String logisticsUrl;
|
||||
/** 最近一次交互时间(超时清理用) */
|
||||
private String lastInteractionTime;
|
||||
|
||||
public static WeComChatSession startLogisticsWaitRemark(String logisticsUrl) {
|
||||
WeComChatSession s = new WeComChatSession();
|
||||
s.setScene(SCENE_JD_LOGISTICS_SHARE);
|
||||
s.setStep(STEP_WAIT_REMARK);
|
||||
s.setLogisticsUrl(logisticsUrl);
|
||||
s.touch();
|
||||
return s;
|
||||
}
|
||||
|
||||
public void touch() {
|
||||
this.lastInteractionTime = LocalDateTime.now().format(FMT);
|
||||
}
|
||||
|
||||
public boolean isLogisticsWaitRemark() {
|
||||
return SCENE_JD_LOGISTICS_SHARE.equals(scene) && STEP_WAIT_REMARK.equals(step)
|
||||
&& logisticsUrl != null && !logisticsUrl.isEmpty();
|
||||
}
|
||||
|
||||
public String getScene() {
|
||||
return scene;
|
||||
}
|
||||
|
||||
public void setScene(String scene) {
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
public String getStep() {
|
||||
return step;
|
||||
}
|
||||
|
||||
public void setStep(String step) {
|
||||
this.step = step;
|
||||
}
|
||||
|
||||
public String getLogisticsUrl() {
|
||||
return logisticsUrl;
|
||||
}
|
||||
|
||||
public void setLogisticsUrl(String logisticsUrl) {
|
||||
this.logisticsUrl = logisticsUrl;
|
||||
}
|
||||
|
||||
public String getLastInteractionTime() {
|
||||
return lastInteractionTime;
|
||||
}
|
||||
|
||||
public void setLastInteractionTime(String lastInteractionTime) {
|
||||
this.lastInteractionTime = lastInteractionTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user