package com.ruoyi.web.modules.diagnosis;

import java.util.Calendar;
import java.util.Date;
import com.ruoyi.web.modules.diagnosis.domain.BizConsultMessage;
import com.ruoyi.web.modules.diagnosis.domain.BizConsultSession;
import com.ruoyi.web.modules.diagnosis.support.AiConsultConstants;
import com.ruoyi.web.modules.diagnosis.support.ConsultSessionRules;

/**
 * AI 诊断测试样本。
 */
public final class AiOnlineConsultTestSamples
{
    public static final Long VA_USER_ID = 1L;

    public static final Long VB_USER_ID = 2L;

    public static final Long SESSION_ID = 6001L;

    public static final Long OTHER_SESSION_ID = 6999L;

    private AiOnlineConsultTestSamples()
    {
    }

    public static BizConsultSession activeAiSession()
    {
        BizConsultSession row = new BizConsultSession();
        row.setId(SESSION_ID);
        row.setConsultType(ConsultSessionRules.CONSULT_TYPE_AI);
        row.setAskerUserId(VA_USER_ID);
        row.setAskerName("兽医甲");
        row.setSessionTitle("牛不吃草");
        row.setLastMessageTime(recentTime());
        row.setLastMessagePreview("最近一条");
        row.setVetVisible(ConsultSessionRules.VET_VISIBLE_YES);
        return row;
    }

    public static BizConsultSession emptyAiSession()
    {
        BizConsultSession row = activeAiSession();
        row.setSessionTitle(AiConsultConstants.SESSION_TITLE_NEW);
        row.setLastMessagePreview(null);
        return row;
    }

    public static BizConsultSession hiddenAiSession()
    {
        BizConsultSession row = activeAiSession();
        row.setVetVisible(ConsultSessionRules.VET_VISIBLE_NO);
        return row;
    }

    public static BizConsultSession otherUserSession()
    {
        BizConsultSession row = activeAiSession();
        row.setId(OTHER_SESSION_ID);
        row.setAskerUserId(VB_USER_ID);
        return row;
    }

    public static BizConsultSession oldAiSession()
    {
        BizConsultSession row = activeAiSession();
        row.setId(6002L);
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.MONTH, -4);
        row.setLastMessageTime(cal.getTime());
        row.setLastMessagePreview("超窗");
        return row;
    }

    public static BizConsultSession vetConsultSession()
    {
        BizConsultSession row = new BizConsultSession();
        row.setId(5001L);
        row.setConsultType(ConsultSessionRules.CONSULT_TYPE_VET);
        row.setAskerUserId(VA_USER_ID);
        row.setReceiverProviderId(101L);
        return row;
    }

    public static BizConsultMessage sampleTextMessage()
    {
        BizConsultMessage msg = new BizConsultMessage();
        msg.setId(9101L);
        msg.setSessionId(SESSION_ID);
        msg.setSenderRole(ConsultSessionRules.SENDER_ROLE_ASKER);
        msg.setSenderUserId(VA_USER_ID);
        msg.setSenderName("兽医甲");
        msg.setMsgType(ConsultSessionRules.MSG_TYPE_TEXT);
        msg.setContent("牛不吃草");
        msg.setSendTime(recentTime());
        return msg;
    }

    private static Date recentTime()
    {
        return new Date();
    }
}
