package com.czg.account.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

import java.io.Serial;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 店铺权限 实体类。
 *
 * @author zs
 * @since 2025-02-18
 */
@Data

@NoArgsConstructor
@AllArgsConstructor
@Table("tb_shop_permission")
public class ShopPermission implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 权限类型：staff 员工，
     */
    private String type;

    /**
     * 权限名称
     */
    private String label;

    /**
     * 权限code，为了区分采用汉语拼音
     */
    private String code;

    /**
     * 层级
     */
    private Integer level;

    /**
     * 上级ID
     */
    private Long parentId;

    /**
     * 是否重要： 重要对应页面红色
     */
    private Integer isImportant;

    /**
     * 排序
     */
    private Integer sort;

    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    @Column(onInsertValue = "now()", onUpdateValue = "now()")
    private LocalDateTime updateTime;

    @Column(ignore = true)
    private List<ShopPermission> children;

}
