package tech.easyflow.skill.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.FastjsonTypeHandler;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Skill asset 实体。
 */
@Table("tb_skill_asset")
public class SkillAsset implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Generator, value = "snowFlakeId")
    private BigInteger id;
    @Column(tenantId = true)
    private BigInteger tenantId;
    private BigInteger skillId;
    private String path;
    private String name;
    private String mediaType;
    private String contentRef;
    private String contentHash;
    private Long size;
    @Column(typeHandler = FastjsonTypeHandler.class)
    private Map<String, Object> metadataJson = new LinkedHashMap<>();

    public BigInteger getId() { return id; }
    public void setId(BigInteger id) { this.id = id; }
    public BigInteger getTenantId() { return tenantId; }
    public void setTenantId(BigInteger tenantId) { this.tenantId = tenantId; }
    public BigInteger getSkillId() { return skillId; }
    public void setSkillId(BigInteger skillId) { this.skillId = skillId; }
    public String getPath() { return path; }
    public void setPath(String path) { this.path = path; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getMediaType() { return mediaType; }
    public void setMediaType(String mediaType) { this.mediaType = mediaType; }
    public String getContentRef() { return contentRef; }
    public void setContentRef(String contentRef) { this.contentRef = contentRef; }
    public String getContentHash() { return contentHash; }
    public void setContentHash(String contentHash) { this.contentHash = contentHash; }
    public Long getSize() { return size; }
    public void setSize(Long size) { this.size = size; }
    public Map<String, Object> getMetadataJson() { return metadataJson; }
    public void setMetadataJson(Map<String, Object> metadataJson) { this.metadataJson = metadataJson == null ? new LinkedHashMap<>() : metadataJson; }
}
