package com.lesingle.creation.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lesingle.creation.common.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 权限表实体类
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_auth_permission")
public class Permission extends BaseEntity {

    /**
     * 租户 ID
     */
    @TableField("tenant_id")
    private Long tenantId;

    /**
     * 权限名称
     */
    @TableField("name")
    private String name;

    /**
     * 权限编码（在租户内唯一）
     */
    @TableField("code")
    private String code;

    /**
     * 资源名称，如 user, role, menu
     */
    @TableField("resource")
    private String resource;

    /**
     * 操作类型，如 create, read, update, delete
     */
    @TableField("action")
    private String action;

    /**
     * 权限描述
     */
    @TableField("description")
    private String description;

    /**
     * 有效状态：1-有效，2-失效
     */
    @TableField("valid_state")
    private Integer validState;
}
