package com.huimv.employment.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDateTime;

/**
 * AI 对话会话主表 {@code fe_conversation} 实体。
 * <p>
 * 会话仅归属用户，不与企业绑定；企业在草稿/订单认证节点绑定。
 * {@code conversation_no} 与上游 AI 网关 {@code session_id} 对应。
 * </p>
 */
@TableName("fe_conversation")
public class FeConversation {

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 对外业务编号，全局唯一，与 AI 接口 session_id 一致，最长 32 字符 */
    private String conversationNo;

    /** 发起对话的用户，与 JWT 中 userId 对应 */
    private Long userId;

    /** 侧边栏展示标题，可由首条消息摘要或 AI 生成 */
    private String title;

    /** employment / knowledge / order / cost / attendance / emergency */
    private String chatType;

    /** active=进行中；archived=已归档（只读） */
    private String status;

    /** 最后一条消息时间，列表排序依据 */
    private LocalDateTime lastMessageAt;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    @TableLogic
    private Integer delFlag;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getConversationNo() {
        return conversationNo;
    }

    public void setConversationNo(String conversationNo) {
        this.conversationNo = conversationNo;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getChatType() {
        return chatType;
    }

    public void setChatType(String chatType) {
        this.chatType = chatType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public LocalDateTime getLastMessageAt() {
        return lastMessageAt;
    }

    public void setLastMessageAt(LocalDateTime lastMessageAt) {
        this.lastMessageAt = lastMessageAt;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }
}
