package com.example.demo2.springbootmybatis.entiy;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import javax.persistence.*;
/**
* @author 小喻同学
* 使用jpa来生成对应的数据表
* @Enity 注解: 表示当前是实体类,当前实体类和数据表进行映射
*/
@Entity()
@Table(name = "admin")
@Erupt(
name = "管理员管理",
power = @Power(add = true,delete = true,edit = true,query = true,importable = true,export = true)
)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer","handler"})
@Getter
@Setter
@ToString
public class Admin {
@Id // 表示id是唯一值
@GeneratedValue(strategy = GenerationType.IDENTITY)
@EruptField(
views = @View(title = "id",sortable = true),
edit = @Edit(title = "id",notNull = true,search = @Search)
)
private Integer id;
@EruptField(
views = @View(title = "姓名"),
edit = @Edit(title = "姓名",search = @Search)
)
@Column(name = "name")
private String name;
@EruptField(
views = @View(title = "编号"),
edit = @Edit(title = "编号",search = @Search)
)
@Column(name = "number")
private String number;
}
配置好对应的菜单之后,显示的内容如下图所示