package com.qqchen.deploy.backend.system.entity;

import com.qqchen.deploy.backend.framework.annotation.LogicDelete;
import com.qqchen.deploy.backend.framework.domain.Entity;
import jakarta.persistence.Column;
import jakarta.persistence.Table;
import jakarta.persistence.ManyToMany;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashSet;
import java.util.Set;

/**
 * 角色标签实体
 */
@Data
@EqualsAndHashCode(callSuper = true, exclude = "roles")
@jakarta.persistence.Entity
@Table(name = "sys_role_tag")
@LogicDelete
public class RoleTag extends Entity<Long> {
    
    /**
     * 标签名称
     */
    @Column(nullable = false, length = 50)
    private String name;
    
    /**
     * 标签颜色（十六进制颜色码）
     */
    @Column(length = 20)
    private String color;
    
    /**
     * 标签描述
     */
    @Column(length = 200)
    private String description;
    
    /**
     * 关联的角色列表
     */
    @ManyToMany(mappedBy = "tags")
    private Set<Role> roles = new HashSet<>();
} 