package me.qwq.doghouse.entity;

import com.baomidou.mybatisplus.annotation.IdType;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import jakarta.validation.constraints.NotBlank;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import me.qwq.doghouse.enums.MetaTypeEnum;
import me.qwq.doghouse.interfaces.IFriendlyName;
import me.qwq.doghouse.validator.FriendlyNameValid;
/**
 * Tag
 * 
 * @author Doghole
 * @since 2021-12-01
 * @see Meta
 */
@SuppressWarnings("serial")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("meta")
@FriendlyNameValid
public class Tag extends Meta implements Serializable, IFriendlyName {
    /**
     * 标签名称
     */
    @TableId(value = "mid", type=IdType.AUTO)
    private Long mid;
    
    @TableField("name")
    @NotBlank(message = "标签名称不允许为空")
    private String name;

    @TableField("type")
    private MetaTypeEnum type = MetaTypeEnum.TAG;
    

    @TableField("parent_id")
    private Long parentId;

    @TableField("friendly_name")
    private String friendlyName;
    
    @TableField("description")
    private String description;
    /**
     * 排序
     */
    @TableField("no")
    private Integer no;
    
}
