Record Class AddRoleReq
java.lang.Object
java.lang.Record
io.github.xezzon.zeroweb.role.entity.AddRoleReq
- Record Components:
code- 角色简码,用于区分同级别角色name- 角色名称,用于界面展示inheritable- 是否允许创建下级角色parentId- 上级角色 ID
- All Implemented Interfaces:
io.github.xezzon.zeroweb.core.trait.Into<Role>
public record AddRoleReq(@Alphanumeric @NotBlank @Size(max=255) String code, @NotBlank @Size(max=255) String name, @NotNull Boolean inheritable, @NotNull String parentId)
extends Record
implements io.github.xezzon.zeroweb.core.trait.Into<Role>
新增角色请求对象
用于封装新增角色时客户端提交的请求参数。
该类实现了 Into 接口,支持转换为角色实体对象。
使用 MapStruct 进行对象转换,提供类型安全的映射功能。
- Author:
- xezzon
-
Constructor Summary
ConstructorsConstructorDescriptionAddRoleReq(@Alphanumeric @NotBlank @Size(max=255) String code, @NotBlank @Size(max=255) String name, @NotNull Boolean inheritable, @NotNull String parentId) Creates an instance of aAddRoleReqrecord class. -
Method Summary
Modifier and TypeMethodDescription@Alphanumeric @NotBlank @Size(max=255) Stringcode()Returns the value of thecoderecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull BooleanReturns the value of theinheritablerecord component.into()@NotBlank @Size(max=255) Stringname()Returns the value of thenamerecord component.@NotNull StringparentId()Returns the value of theparentIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AddRoleReq
public AddRoleReq(@Alphanumeric @NotBlank @Size(max=255) @Alphanumeric @NotBlank @Size(max=255) String code, @NotBlank @Size(max=255) @NotBlank @Size(max=255) String name, @NotNull @NotNull Boolean inheritable, @NotNull @NotNull String parentId) Creates an instance of aAddRoleReqrecord class.- Parameters:
code- the value for thecoderecord componentname- the value for thenamerecord componentinheritable- the value for theinheritablerecord componentparentId- the value for theparentIdrecord component
-
-
Method Details
-
into
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
code
-
name
-
inheritable
Returns the value of theinheritablerecord component.- Returns:
- the value of the
inheritablerecord component
-
parentId
-