【7.6.0】【sys】【permission】初始化角色绑定权限界面的请求参数和响应实体的封装

pull/55/MERGE
fengshuonan 2023-06-13 13:57:30 +08:00
parent 6d07a23e41
commit cea2772e9a
2 changed files with 179 additions and 0 deletions

View File

@ -0,0 +1,76 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.sys.modular.role.pojo.request;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
*
*
* @author fengshuonan
* @since 2023/6/13 13:43
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class RoleBindPermissionRequest extends BaseRequest {
/**
* id
*/
@NotNull(message = "角色id不能为空", groups = roleBindPermission.class)
@ChineseDescription("角色id")
private Long roleId;
/**
*
* <p>
*
*/
@ChineseDescription("模块下的所有的菜单和菜单下的功能")
@NotEmpty(message = "模块下的所有的菜单和菜单下的功能不能为空", groups = roleBindPermission.class)
private List<Long> modularTotalItemList;
/**
*
* <p>
*
*/
@ChineseDescription("选中的菜单和菜单下的功能集合")
private List<Long> selectedItemList;
/**
*
*/
public @interface roleBindPermission {
}
}

View File

@ -0,0 +1,103 @@
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* GunsAPACHE LICENSE 2.0使
*
* 1.LICENSE
* 2.Guns
* 3.
* 4. https://gitee.com/stylefeng/guns
* 5. https://gitee.com/stylefeng/guns
* 6.
*/
package cn.stylefeng.roses.kernel.sys.modular.role.pojo.response;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.tree.factory.base.AbstractTreeNode;
import lombok.Data;
import java.util.List;
/**
*
* <p>
* 123options
*
* @author fengshuonan
* @since 2023/6/13 13:54
*/
@Data
public class RoleBindPermissionResponse implements AbstractTreeNode<RoleBindPermissionResponse> {
/**
* IDidid
*/
@ChineseDescription("节点ID")
private Long nodeId;
/**
* ID
*/
@ChineseDescription("节点父ID")
private Long nodeParentId;
/**
*
*/
@ChineseDescription("节点名称")
private String nodeName;
/**
*
*/
@ChineseDescription("节点编码")
private String nodeCode;
/**
* (true)
*/
@ChineseDescription("是否选择(已拥有的是true)")
private Boolean checked;
/**
*
*/
@ChineseDescription("子节点集合")
private List<RoleBindPermissionResponse> children;
@Override
public String getNodeId() {
if (this.nodeId != null) {
return this.nodeId.toString();
} else {
return "";
}
}
@Override
public String getNodeParentId() {
if (this.nodeParentId != null) {
return this.nodeParentId.toString();
} else {
return "";
}
}
@Override
public void setChildrenNodes(List<RoleBindPermissionResponse> childrenNodes) {
this.children = childrenNodes;
}
}