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.ConsultSessionRules;

/**
 * 在线接诊（兽医）测试样本。
 */
public final class VetOnlineConsultTestSamples
{
    public static final Long VET_PROVIDER_ID = 101L;

    public static final Long VET_SYS_USER_ID = 1L;

    public static final Long OTHER_PROVIDER_ID = 202L;

    public static final Long ASKER_USER_ID = 50L;

    public static final Long SESSION_ID = 5001L;

    private VetOnlineConsultTestSamples()
    {
    }

    public static BizConsultSession activeSession()
    {
        BizConsultSession row = new BizConsultSession();
        row.setId(SESSION_ID);
        row.setConsultType(ConsultSessionRules.CONSULT_TYPE_VET);
        row.setAskerUserId(ASKER_USER_ID);
        row.setAskerName("扎西");
        row.setReceiverUserId(VET_SYS_USER_ID);
        row.setReceiverProviderId(VET_PROVIDER_ID);
        row.setReceiverName("测试兽医");
        row.setLastMessageTime(recentTime());
        row.setLastMessagePreview("最近一条");
        row.setVetVisible(ConsultSessionRules.VET_VISIBLE_YES);
        row.setAskerAvatar("/avatar.png");
        return row;
    }

    public static BizConsultSession hiddenSession()
    {
        BizConsultSession row = activeSession();
        row.setVetVisible(ConsultSessionRules.VET_VISIBLE_NO);
        return row;
    }

    public static BizConsultSession oldSession()
    {
        BizConsultSession row = activeSession();
        row.setId(5002L);
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.MONTH, -4);
        row.setLastMessageTime(cal.getTime());
        row.setLastMessagePreview("超窗消息");
        return row;
    }

    public static BizConsultMessage sampleTextMessage()
    {
        BizConsultMessage msg = new BizConsultMessage();
        msg.setId(9001L);
        msg.setSessionId(SESSION_ID);
        msg.setSenderRole(ConsultSessionRules.SENDER_ROLE_ASKER);
        msg.setSenderUserId(ASKER_USER_ID);
        msg.setSenderName("扎西");
        msg.setMsgType(ConsultSessionRules.MSG_TYPE_TEXT);
        msg.setContent("牛不吃草");
        msg.setSendTime(recentTime());
        return msg;
    }

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