1. package com.example.demo2.springbootmybatis.entiy;
    2. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
    3. import lombok.Data;
    4. import lombok.Getter;
    5. import lombok.Setter;
    6. import lombok.ToString;
    7. import xyz.erupt.annotation.Erupt;
    8. import xyz.erupt.annotation.EruptField;
    9. import xyz.erupt.annotation.sub_erupt.Power;
    10. import xyz.erupt.annotation.sub_field.Edit;
    11. import xyz.erupt.annotation.sub_field.View;
    12. import xyz.erupt.annotation.sub_field.sub_edit.Search;
    13. import javax.persistence.*;
    14. /**
    15. * @author 小喻同学
    16. * 使用jpa来生成对应的数据表
    17. * @Enity 注解: 表示当前是实体类,当前实体类和数据表进行映射
    18. */
    19. @Entity()
    20. @Table(name = "admin")
    21. @Erupt(
    22. name = "管理员管理",
    23. power = @Power(add = true,delete = true,edit = true,query = true,importable = true,export = true)
    24. )
    25. @JsonIgnoreProperties(value = {"hibernateLazyInitializer","handler"})
    26. @Getter
    27. @Setter
    28. @ToString
    29. public class Admin {
    30. @Id // 表示id是唯一值
    31. @GeneratedValue(strategy = GenerationType.IDENTITY)
    32. @EruptField(
    33. views = @View(title = "id",sortable = true),
    34. edit = @Edit(title = "id",notNull = true,search = @Search)
    35. )
    36. private Integer id;
    37. @EruptField(
    38. views = @View(title = "姓名"),
    39. edit = @Edit(title = "姓名",search = @Search)
    40. )
    41. @Column(name = "name")
    42. private String name;
    43. @EruptField(
    44. views = @View(title = "编号"),
    45. edit = @Edit(title = "编号",search = @Search)
    46. )
    47. @Column(name = "number")
    48. private String number;
    49. }

    配置好对应的菜单之后,显示的内容如下图所示
    image.png