package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 聊天会话
 *
 * @author system
 * @since 2025-01-XX
 */
@Data
@JsonInclude
@TableName("lawyer_chat_session")
@ApiModel(value = "LawyerChatSession对象", description = "聊天会话")
public class LawyerChatSession extends Model<LawyerChatSession> {

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "咨询订单ID")
    @TableField("consultation_order_id")
    private Integer consultationOrderId;

    @ApiModelProperty(value = "客户端用户ID")
    @TableField("client_user_id")
    private Integer clientUserId;

    @ApiModelProperty(value = "律师用户ID")
    @TableField("lawyer_user_id")
    private Integer lawyerUserId;

    @ApiModelProperty(value = "会话类型, 0:文本咨询, 1:语音咨询, 2:视频咨询")
    @TableField("session_type")
    private Integer sessionType;

    @ApiModelProperty(value = "会话状态, 0:未开始, 1:进行中, 2:已结束")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "最后一条消息ID")
    @TableField("last_message_id")
    private Integer lastMessageId;

    @ApiModelProperty(value = "最后一条消息时间")
    @TableField("last_message_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastMessageTime;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;
}

