package com.infoepoch.pms.agent.platform.chat.domain.irepository;

import com.infoepoch.pms.agent.common.utils.AbstractCriteria;

/**
 * @author jiangyz
 * @date 2026/4/17 20:24
 * 对话记录表查询条件类
 */
public class ConversationCriteria extends AbstractCriteria {

    //region 会话id
    public boolean bySessionId() {
        return this.andMap.containsKey("SessionId");
    }

    private String sessionId;

    public String getSessionId() {
        if (bySessionId())
            return sessionId;
        return null;
    }

    public void setSessionId(String value) {
        this.sessionId = value;
        this.andMap.put("SessionId", value);
    }
    //endregion

    //region user / assistant / tool
    public boolean byRole() {
        return this.andMap.containsKey("Role");
    }

    private String role;

    public String getRole() {
        if (byRole())
            return role;
        return null;
    }

    public void setRole(String value) {
        this.role = value;
        this.andMap.put("Role", value);
    }
    //endregion

    //region 触发了哪个智能体，普通对话为 NULL
    public boolean byAgentId() {
        return this.andMap.containsKey("AgentId");
    }

    private String agentId;

    public String getAgentId() {
        if (byAgentId())
            return agentId;
        return null;
    }

    public void setAgentId(String value) {
        this.agentId = value;
        this.andMap.put("AgentId", value);
    }
    //endregion

    //region 消息所属上下文线程 ID
    public boolean byThreadId() {
        return this.andMap.containsKey("ThreadId");
    }

    private String threadId;

    public String getThreadId() {
        if (byThreadId())
            return threadId;
        return null;
    }

    public void setThreadId(String value) {
        this.threadId = value;
        this.andMap.put("ThreadId", value);
    }
    //endregion

}