/**
 * @ProjectName: 智慧评标-主观分助手
 * @Package: com.zhpb.gdyd_zhpb_zgf.entity.mysql
 * @ClassName: UserLog
 * @Description: 用户操作日志实体类，映射t_user_log表，记录用户的关键操作信息
 * @Author: 
 * @Date: 2025-11-28
 * @Version: 1.0
 * @Copyright: © 2025 智慧评标-主观分助手
 */
package com.zhpb.gdyd_zhpb_zgf.entity.mysql;

import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDateTime;

/**
 * 用户操作日志实体类
 */
@Entity
@Table(name = "t_user_log")
@Data
public class UserLog {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 用户ID
     */
    @Column(name = "user_id", nullable = false, length = 64)
    private String userId;

    /**
     * 用户名
     */
    @Column(name = "user_name", length = 128)
    private String userName;

    /**
     * 项目ID
     */
    @Column(name = "project_id", length = 64)
    private String projectId;

    /**
     * 操作类型
     * UPLOAD_FILE-上传文件
     * QA_QUESTION-智能问答
     * QA_MESSAGE-问答消息
     * VIEW_CATALOG-查看目录
     * CATALOG_SUMMARY-目录总结
     * MODEL_REPLY-大模型回复
     */
    @Column(name = "operation_type", nullable = false, length = 64)
    private String operationType;

    /**
     * 操作详情
     */
    @Column(name = "operation_detail", columnDefinition = "TEXT")
    private String operationDetail;

    /**
     * 关联ID（如文件ID、会话ID等）
     */
    @Column(name = "related_id", length = 64)
    private String relatedId;

    /**
     * 操作IP地址
     */
    @Column(name = "ip_address", length = 64)
    private String ipAddress;

    /**
     * 用户代理
     */
    @Column(name = "user_agent", length = 512)
    private String userAgent;

    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false)
    private LocalDateTime createTime = LocalDateTime.now();
}