package com.lingyue.graph.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lingyue.common.domain.entity.SimpleModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 关系网络实体
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("graphs")
@Schema(description = "关系网络实体")
public class Graph extends SimpleModel {
    
    @Schema(description = "文档ID")
    @TableField("document_id")
    private String documentId;
    
    @Schema(description = "用户ID")
    @TableField("user_id")
    private String userId;
    
    @Schema(description = "名称")
    @TableField("name")
    private String name;
    
    @Schema(description = "节点")
    @TableField(value = "nodes", typeHandler = com.lingyue.common.mybatis.PostgreSqlJsonbTypeHandler.class)
    private Object nodes; // GraphNode数组
    
    @Schema(description = "边")
    @TableField(value = "edges", typeHandler = com.lingyue.common.mybatis.PostgreSqlJsonbTypeHandler.class)
    private Object edges; // GraphEdge数组
    
    @Schema(description = "计算结果")
    @TableField(value = "calculation_result", typeHandler = com.lingyue.common.mybatis.PostgreSqlJsonbTypeHandler.class)
    private Object calculationResult;
    
    @Schema(description = "计算状态")
    @TableField("calculation_status")
    private String calculationStatus; // pending/completed/failed
    
    @Schema(description = "元数据")
    @TableField(value = "metadata", typeHandler = com.lingyue.common.mybatis.PostgreSqlJsonbTypeHandler.class)
    private Object metadata;
}
