package com.dy.pmsGlobal.pojoBa;
|
|
import com.alibaba.fastjson2.annotation.JSONField;
|
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.dy.common.po.BaseEntity;
|
import jakarta.validation.constraints.NotEmpty;
|
import lombok.*;
|
import org.hibernate.validator.constraints.Length;
|
|
/**
|
* 权限表
|
*/
|
@TableName(value="ba_privilege", autoResultMap = true)
|
@Data
|
@Builder
|
@ToString
|
@NoArgsConstructor
|
@AllArgsConstructor
|
public class BaPrivilege implements BaseEntity {
|
|
public static final long serialVersionUID = 202404151100001L;
|
/**
|
* 主键
|
*/
|
/* 如果不明确 type类型,MP将自动为其赋值(雪花ID)
|
IdType:
|
AUTO(0), //自增
|
NONE(1), //未设置主键
|
INPUT(2), //手动输入
|
ASSIGN_ID(3), //默认全局唯一ID
|
ASSIGN_UUID(4), //全局唯一的 uuid
|
*/
|
@JSONField(serializeUsing= ObjectWriterImplToString.class)
|
@TableId(value = "id", type = IdType.INPUT)
|
public Long id;
|
|
/**
|
* 权限编号
|
*/
|
@NotEmpty(message = "权限编码不能为空") //不能为空也不能为null
|
@Length(message = "权限编码不大于{max}字,不小于{min}字", min = 8, max = 8)
|
public Integer num;
|
|
/**
|
* 权限名称
|
*/
|
@NotEmpty(message = "权限名称不能为空") //不能为空也不能为null
|
@Length(message = "权限名称不大于{max}字,不小于{min}字", min = 2, max = 50)
|
public String name;
|
|
/**
|
* 权限类别
|
*/
|
@NotEmpty(message = "权限类型不能为空") //不能为空也不能为null
|
@Length(message = "权限类型不大于{max}字,不小于{min}字", min = 4, max = 4)
|
public Integer type;
|
|
/**
|
* 类别名称
|
*/
|
@NotEmpty(message = "类别名称不能为空") //不能为空也不能为null
|
@Length(message = "权限类型不大于{max}字,不小于{min}字", min = 3, max = 6)
|
public String typeName;
|
|
}
|