package com.czg.market.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 角色模板 实体类。
 *
 * @author zs
 * @since 2025-12-08
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table("sys_role_template")
public class SysRoleTemplate implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * 模板名称
     */
    private String name;

    /**
     * 是否启用
     */
    private Integer isEnable;

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

    /**
     * 操作人
     */
    private String opUser;
    private Long opSysUserId;

    /**
     * 创建人
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @Column(onInsertValue = "now()", onUpdateValue = "now()")
    private LocalDateTime updateTime;

    /**
     * 角色id列表
     */
    private Long roleId;

    /**
     * 上级id
     */
    private Integer pid;

    private List<SysRoleTemplate> children = new ArrayList<>();

}
