package com.gzzm.lobster.workspace;

import net.cyan.thunwind.annotation.ColumnDescription;
import net.cyan.thunwind.annotation.Entity;
import net.cyan.thunwind.annotation.Index;

import java.util.Date;

/**
 * Workspace —— 虚拟工作台 / Virtual workbench bound to a thread.
 *
 * <p>一个 thread 恰好对应一个 workspace。workspace 不是 shell 目录，
 * 而是 OA 文件引用 + Artifact + 文档工坊文档的统一视图。
 *
 * <p>Exactly one workspace per thread — it is NOT a shell directory.
 * It unifies OA file refs, artifacts and workshop docs.
 */
@Entity(table = "AI_WORKSPACE", keys = "workspaceId")
public class Workspace {

    @ColumnDescription(type = "varchar(40)")
    private String workspaceId;

    @Index
    @ColumnDescription(type = "varchar(40)", nullable = false)
    private String threadId;

    @Index
    @ColumnDescription(type = "varchar(40)", nullable = false)
    private String userId;

    @ColumnDescription(type = "varchar(200)")
    private String name;

    /** workspace 类型；保留扩展 / workspace type */
    @ColumnDescription(type = "varchar(20)")
    private String type;

    private Date createTime;
    private Date updateTime;

    public Workspace() {}

    public String getWorkspaceId() { return workspaceId; }
    public void setWorkspaceId(String workspaceId) { this.workspaceId = workspaceId; }
    public String getThreadId() { return threadId; }
    public void setThreadId(String threadId) { this.threadId = threadId; }
    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getType() { return type; }
    public void setType(String type) { this.type = type; }
    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }
    public Date getUpdateTime() { return updateTime; }
    public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
}
