144 changed files with 9341 additions and 0 deletions
@ -0,0 +1,27 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<parent> |
||||
|
<artifactId>gov-access-lb</artifactId> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<version>2.0.0</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>gov-access-lb-client</artifactId> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-commons-tools</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>io.swagger</groupId> |
||||
|
<artifactId>swagger-annotations</artifactId> |
||||
|
<version>1.5.20</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</project> |
||||
@ -0,0 +1,61 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 国际化 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GovLanguageDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 表名 |
||||
|
*/ |
||||
|
private String tableName; |
||||
|
|
||||
|
/** |
||||
|
* 表主键 |
||||
|
*/ |
||||
|
private String tableId; |
||||
|
|
||||
|
/** |
||||
|
* 字段名 |
||||
|
*/ |
||||
|
private String fieldName; |
||||
|
|
||||
|
/** |
||||
|
* 字段值 |
||||
|
*/ |
||||
|
private String fieldValue; |
||||
|
|
||||
|
/** |
||||
|
* 语言 |
||||
|
*/ |
||||
|
private String language; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,124 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.TreeStringNode; |
||||
|
import com.epmet.dto.result.MenuResourceDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GovMenuDTO extends TreeStringNode<GovMenuDTO> implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 上级ID,一级菜单为0 |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 菜单名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 菜单URL |
||||
|
*/ |
||||
|
private String url; |
||||
|
|
||||
|
/** |
||||
|
* 类型 0:菜单 1:按钮 |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
|
||||
|
/** |
||||
|
* 菜单图标 |
||||
|
*/ |
||||
|
private String icon; |
||||
|
|
||||
|
/** |
||||
|
* 权限标识,如:sys:menu:save |
||||
|
*/ |
||||
|
private String permissions; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 菜单资源 |
||||
|
*/ |
||||
|
private List<MenuResourceDTO> resourceList; |
||||
|
|
||||
|
/** |
||||
|
* 上级菜单名称 |
||||
|
*/ |
||||
|
private String parentName; |
||||
|
|
||||
|
/** |
||||
|
* 是否显示,1:显示 0不显示 |
||||
|
*/ |
||||
|
private Integer showFlag; |
||||
|
} |
||||
@ -0,0 +1,102 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 资源管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GovResourceDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 资源编码,如菜单ID |
||||
|
*/ |
||||
|
private String resourceCode; |
||||
|
|
||||
|
/** |
||||
|
* 资源名称 |
||||
|
*/ |
||||
|
private String resourceName; |
||||
|
|
||||
|
/** |
||||
|
* 资源URL |
||||
|
*/ |
||||
|
private String resourceUrl; |
||||
|
|
||||
|
/** |
||||
|
* 请求方式(如:GET、POST、PUT、DELETE) |
||||
|
*/ |
||||
|
private String resourceMethod; |
||||
|
|
||||
|
/** |
||||
|
* 菜单标识 0:非菜单资源 1:菜单资源 |
||||
|
*/ |
||||
|
private Integer menuFlag; |
||||
|
|
||||
|
/** |
||||
|
* 认证等级 0:权限认证 1:登录认证 2:无需认证 |
||||
|
*/ |
||||
|
private Integer authLevel; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,93 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GovRoleDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 角色名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 部门ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 菜单ID列表 |
||||
|
*/ |
||||
|
private List<String> menuIdList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GovRoleMenuDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 菜单ID |
||||
|
*/ |
||||
|
private String menuId; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色用户关系 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GovRoleUserDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识:0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,86 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 权限范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OperationScopeDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 范围key |
||||
|
*/ |
||||
|
private String scopeKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围名称 |
||||
|
*/ |
||||
|
private String scopeName; |
||||
|
|
||||
|
/** |
||||
|
* 范围序号 |
||||
|
*/ |
||||
|
private String scopeIndex; |
||||
|
|
||||
|
/** |
||||
|
* 是否删除,0:未删除,1:已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建者id |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新者id |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色能进行那些操作 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RoleOperationDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 是否删除,0:未删除,1:已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建者id |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新者id |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,86 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色能操作哪些范围 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RoleScopeDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围Key |
||||
|
*/ |
||||
|
private String scopeKey; |
||||
|
|
||||
|
/** |
||||
|
* 是否删除,0:未删除,1:已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建者id |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新者id |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class AccessConfigAdd4RoletFormDTO { |
||||
|
@NotBlank(message = "角色Key不能为空") |
||||
|
private String roleKey; |
||||
|
|
||||
|
@NotBlank(message = "操作Key不能为空") |
||||
|
private String operationKey; |
||||
|
|
||||
|
private List<String> scopeKeys; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 权限配置-操作默认范围form dto |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccessConfigOpeDefaultScopesFormDTO { |
||||
|
|
||||
|
public interface ListOpeDefaultScopesGroup {} |
||||
|
public interface SaveOpeDefaultScopesGroup {} |
||||
|
|
||||
|
@NotBlank(message = "角色Key不能为空", groups = { ListOpeDefaultScopesGroup.class, SaveOpeDefaultScopesGroup.class }) |
||||
|
private String roleKey; |
||||
|
|
||||
|
@NotBlank(message = "操作Key不能为空", groups = { ListOpeDefaultScopesGroup.class, SaveOpeDefaultScopesGroup.class }) |
||||
|
private String operationKey; |
||||
|
|
||||
|
private List<String> scopeKeys; |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.dto.result.AccessConfigOpesResultDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class AccessConfigOpesFormDTO { |
||||
|
|
||||
|
@NotBlank(message = "角色ID不能为空") |
||||
|
private String roleId; |
||||
|
private List<AccessConfigOpesResultDTO> opes; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
@Data |
||||
|
public class AccessConfigOptionsFormDTO { |
||||
|
|
||||
|
@NotBlank(message = "角色ID不能为空") |
||||
|
private String roleId; |
||||
|
|
||||
|
@NotBlank(message = "操作的Key不能为空") |
||||
|
private String operationKey; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 角色默认操作权限列表from DTO |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccessConfigRoleDefaultOpesFormDTO { |
||||
|
|
||||
|
@NotBlank(message = "角色Key不能为空") |
||||
|
private String roleKey; |
||||
|
|
||||
|
private List<String> operationKeys; |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
@Data |
||||
|
public class AccessConfigSaveConfigDTO { |
||||
|
|
||||
|
@NotBlank(message = "角色ID不能为空") |
||||
|
private String roleId; |
||||
|
@NotBlank(message = "操作Key不能为空") |
||||
|
private String operationKey; |
||||
|
private Set<String> scopeKeys; |
||||
|
private Set<String> settingKeys; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 查询拥有的权限的DTO,非后台配置用 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccessSettingFormDTO { |
||||
|
private String roleId; |
||||
|
private String operationKey; |
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
@Data |
||||
|
public class GetSQLFilterFormDTO { |
||||
|
|
||||
|
@NotBlank |
||||
|
private String operationKey; |
||||
|
|
||||
|
@NotBlank |
||||
|
private String userId; |
||||
|
|
||||
|
@NotBlank |
||||
|
private String app; |
||||
|
|
||||
|
@NotBlank |
||||
|
private String client; |
||||
|
|
||||
|
private String tableAlias; |
||||
|
|
||||
|
private Set<String> gridIds; |
||||
|
|
||||
|
private Set<String> departmentIds; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
@Data |
||||
|
public class HasSpecifiedPermissionFormDTO { |
||||
|
|
||||
|
@NotBlank |
||||
|
private String operationKey; |
||||
|
|
||||
|
@NotBlank |
||||
|
private String userId; |
||||
|
|
||||
|
@NotBlank |
||||
|
private String app; |
||||
|
|
||||
|
@NotBlank |
||||
|
private String client; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class InitDefaultOperationsFormDTO { |
||||
|
|
||||
|
private List<InitDefaultOpesRoleDTO> roles; |
||||
|
|
||||
|
@Data |
||||
|
public static class InitDefaultOpesRoleDTO { |
||||
|
public InitDefaultOpesRoleDTO() { |
||||
|
} |
||||
|
|
||||
|
private String roleId; |
||||
|
private String roleKey; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
@Data |
||||
|
public class ListOpePermsFormDTO { |
||||
|
|
||||
|
@NotBlank(message = "用户ID不能为空") |
||||
|
private String staffId; |
||||
|
@NotBlank(message = "当前单位不能为空") |
||||
|
private String currAgencyId; |
||||
|
|
||||
|
private String currGridId; |
||||
|
|
||||
|
private String currDeptId; |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
@Data |
||||
|
public class OperationScopeFormDTO { |
||||
|
|
||||
|
public interface ListOperationScopeGroup {} |
||||
|
|
||||
|
@NotBlank(message = "角色ID不能为空", groups = {ListOperationScopeGroup.class}) |
||||
|
private String roleId; |
||||
|
|
||||
|
@NotBlank(message = "操作的key不能为空", groups = {ListOperationScopeGroup.class}) |
||||
|
private String operationKey; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,59 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
@Data |
||||
|
public class StaffPermCacheFormDTO { |
||||
|
|
||||
|
/** |
||||
|
* 更新权限缓存分组 |
||||
|
*/ |
||||
|
public interface UpdatePermissionCache {} |
||||
|
|
||||
|
/** |
||||
|
* 查询当前权限列表 |
||||
|
*/ |
||||
|
public interface GetStaffCurrPermissions {} |
||||
|
|
||||
|
/** |
||||
|
* 工作人员 id |
||||
|
*/ |
||||
|
@NotBlank(message = "工作人员ID不能为空", groups = {UpdatePermissionCache.class, GetStaffCurrPermissions.class}) |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 登录头信息app |
||||
|
*/ |
||||
|
@NotBlank(message = "登录头信息app不能为空", groups = {UpdatePermissionCache.class, GetStaffCurrPermissions.class}) |
||||
|
private String app; |
||||
|
|
||||
|
/** |
||||
|
* 登录头信息client |
||||
|
*/ |
||||
|
@NotBlank(message = "登录头信息client不能为空", groups = {UpdatePermissionCache.class, GetStaffCurrPermissions.class}) |
||||
|
private String client; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID路径 |
||||
|
*/ |
||||
|
private String orgIdPath; |
||||
|
|
||||
|
/** |
||||
|
* 权限列表 |
||||
|
*/ |
||||
|
private Set<String> permissions; |
||||
|
|
||||
|
/** |
||||
|
* 角色列表 |
||||
|
*/ |
||||
|
private Set<String> roleIdList; |
||||
|
|
||||
|
/** |
||||
|
* 当前所在网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 权限配置-操作的默认范围result dto |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccessConfigOpeDefaultScopesResultDTO { |
||||
|
private String scopeKey; |
||||
|
private String scopeName; |
||||
|
private String scopeIndex; |
||||
|
private String operationKey; |
||||
|
private String roleKey; |
||||
|
private Boolean assigned; |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class AccessConfigOpesResultDTO { |
||||
|
|
||||
|
private String operationKey; |
||||
|
private String operationName; |
||||
|
private String brief; |
||||
|
private Boolean assigned; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class AccessConfigOptionsResultDTO { |
||||
|
private List<AccessConfigScopeResultDTO> scopeOptions; |
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class AccessConfigScopeResultDTO { |
||||
|
|
||||
|
private String scopeKey; |
||||
|
private String scopeName; |
||||
|
private String scopeIndex; |
||||
|
private String operationKey; |
||||
|
private String roleId; |
||||
|
private Boolean assigned; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,58 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 权限配置 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-29 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AccessSettingResultDTO { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 配置KEY |
||||
|
*/ |
||||
|
private String settingKey; |
||||
|
|
||||
|
/** |
||||
|
* 配置值 |
||||
|
*/ |
||||
|
private String settingValue; |
||||
|
|
||||
|
/** |
||||
|
* 配置名称 |
||||
|
*/ |
||||
|
private String settingName; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,59 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.security.dto.GovTokenDto; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
@Data |
||||
|
public class LoginUserDetailsResultDTO { |
||||
|
|
||||
|
/** |
||||
|
* 政府端:gov、居民端:resi、运营端:oper |
||||
|
*/ |
||||
|
private String app; |
||||
|
|
||||
|
/** |
||||
|
* PC端:web、微信小程序:wxmp |
||||
|
*/ |
||||
|
private String client; |
||||
|
|
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 角色列表 |
||||
|
*/ |
||||
|
//private Set<String> roleIdList;
|
||||
|
private List<GovTokenDto.Role> roleList; |
||||
|
|
||||
|
/** |
||||
|
* 部门id列表 |
||||
|
*/ |
||||
|
private Set<String> deptIdList; |
||||
|
|
||||
|
/** |
||||
|
* 当前登录的组织id(顶级) |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String orgIdPath; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID列表 |
||||
|
*/ |
||||
|
private Set<String> gridIdList; |
||||
|
|
||||
|
/** |
||||
|
* 当前工作人员进入的客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 菜单资源 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "菜单资源") |
||||
|
public class MenuResourceDTO { |
||||
|
@ApiModelProperty(value = "资源URL") |
||||
|
private String resourceUrl; |
||||
|
@ApiModelProperty(value = "请求方式(如:GET、POST、PUT、DELETE)") |
||||
|
private String resourceMethod; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class OperationScopeDefaultResultDTO { |
||||
|
|
||||
|
private String roleKey; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围key |
||||
|
*/ |
||||
|
private String scopeKey; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class RoleOpeScopeResultDTO { |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围key |
||||
|
*/ |
||||
|
private String scopeKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围名称 |
||||
|
*/ |
||||
|
private String scopeName; |
||||
|
|
||||
|
/** |
||||
|
* 范围序号 |
||||
|
*/ |
||||
|
private String scopeIndex; |
||||
|
|
||||
|
private String series; |
||||
|
private Integer sort; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,60 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色默认的可操作功能列表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-05-21 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RoleOperationDefaultResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 角色KEY |
||||
|
*/ |
||||
|
private String roleKey; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 操作名称 |
||||
|
*/ |
||||
|
private String operationName; |
||||
|
|
||||
|
/** |
||||
|
* 是否已经具有该操作权限 |
||||
|
*/ |
||||
|
private Boolean assigned; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,87 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色能进行那些操作 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RoleOperationResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 操作名称 |
||||
|
*/ |
||||
|
private String operationName; |
||||
|
|
||||
|
/** |
||||
|
* 是否删除,0:未删除,1:已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建者id |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新者id |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.enums; |
||||
|
|
||||
|
/** |
||||
|
* 菜单资源标识 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
public enum MenuFlagEnum { |
||||
|
/** |
||||
|
* 菜单资源 |
||||
|
*/ |
||||
|
YES(1), |
||||
|
/** |
||||
|
* 非菜单资源 |
||||
|
*/ |
||||
|
NO(0); |
||||
|
|
||||
|
private int value; |
||||
|
|
||||
|
MenuFlagEnum(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
public int value() { |
||||
|
return this.value; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.enums; |
||||
|
|
||||
|
/** |
||||
|
* 菜单类型枚举 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
public enum MenuTypeEnum { |
||||
|
/** |
||||
|
* 菜单 |
||||
|
*/ |
||||
|
MENU(0), |
||||
|
/** |
||||
|
* 按钮 |
||||
|
*/ |
||||
|
BUTTON(1); |
||||
|
|
||||
|
private int value; |
||||
|
|
||||
|
MenuTypeEnum(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
public int value() { |
||||
|
return this.value; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2019 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.enums; |
||||
|
|
||||
|
/** |
||||
|
* 叶子节点枚举 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
*/ |
||||
|
public enum RegionLeafEnum { |
||||
|
YES(1), |
||||
|
NO(0); |
||||
|
|
||||
|
private int value; |
||||
|
|
||||
|
RegionLeafEnum(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
public int value() { |
||||
|
return this.value; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2019 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.enums; |
||||
|
|
||||
|
/** |
||||
|
* 行政区域 级别枚举 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
*/ |
||||
|
public enum RegionLevelEnum { |
||||
|
ONE(1), |
||||
|
TWO(2), |
||||
|
THREE(3); |
||||
|
|
||||
|
private int value; |
||||
|
|
||||
|
RegionLevelEnum(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
public int value() { |
||||
|
return this.value; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.enums; |
||||
|
|
||||
|
/** |
||||
|
* 用户状态 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
public enum UserStatusEnum { |
||||
|
DISABLE(0), |
||||
|
ENABLED(1); |
||||
|
|
||||
|
private int value; |
||||
|
|
||||
|
UserStatusEnum(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
public int value() { |
||||
|
return this.value; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.epmet.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.form.InitDefaultOperationsFormDTO; |
||||
|
import com.epmet.dto.form.ListOpePermsFormDTO; |
||||
|
import com.epmet.feign.fallback.GovAccessFeignClientFallBack; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
import java.util.Set; |
||||
|
|
||||
|
//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallBack.class, url = "http://localhost:8099")
|
||||
|
@FeignClient(name = "lb-server", fallback = GovAccessFeignClientFallBack.class) |
||||
|
public interface GovAccessFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* 批量为角色ID初始化操作权限列表 |
||||
|
* @param formDTO |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/gov/access/role/initdefaultoperationsforroles") |
||||
|
Result initDefaultOperationsForRoles(@RequestBody InitDefaultOperationsFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* 列出觉得的功能权限列表 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/gov/access/access/listoperationpermissions") |
||||
|
Result<Set<String>> listOperationPermissions(@RequestBody ListOpePermsFormDTO listOpePermsFormDTO); |
||||
|
|
||||
|
@PostMapping("/lb/get-host") |
||||
|
Result getHost(); |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.form.InitDefaultOperationsFormDTO; |
||||
|
import com.epmet.dto.form.ListOpePermsFormDTO; |
||||
|
import com.epmet.feign.GovAccessFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovAccessFeignClientFallBack implements GovAccessFeignClient { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public Result initDefaultOperationsForRoles(InitDefaultOperationsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "initDefaultOperationsForRoles", formDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<Set<String>> listOperationPermissions(ListOpePermsFormDTO listOpePermsFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listOperationPermissions", listOpePermsFormDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result getHost() { |
||||
|
return ModuleUtils.feignConError("lb-server", "getHost", null); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
FROM java:8 |
||||
|
|
||||
|
RUN export LANG="zh_CN.UTF-8" |
||||
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
||||
|
RUN echo 'Asia/Shanghai' > /etc/timezone |
||||
|
|
||||
|
COPY ./target/*.jar ./gov-access-lb.jar |
||||
|
|
||||
|
EXPOSE 9999 |
||||
|
|
||||
|
ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] |
||||
@ -0,0 +1,18 @@ |
|||||
|
version: "3.7" |
||||
|
services: |
||||
|
gov-access-lb-server: |
||||
|
container_name: gov-access-lb-server-dev |
||||
|
image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-lb-server:version_placeholder |
||||
|
ports: |
||||
|
- "9999:9999" |
||||
|
network_mode: host # 使用现有网络 |
||||
|
volumes: |
||||
|
- "/opt/epmet-cloud-logs/dev:/logs" |
||||
|
environment: |
||||
|
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./gov-access-lb.jar" |
||||
|
restart: "unless-stopped" |
||||
|
deploy: |
||||
|
resources: |
||||
|
limits: |
||||
|
cpus: '0.1' |
||||
|
memory: 250M |
||||
@ -0,0 +1,18 @@ |
|||||
|
version: "3.7" |
||||
|
services: |
||||
|
gov-access-server: |
||||
|
container_name: gov-access-server-prod |
||||
|
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-access-server:0.3.39 |
||||
|
ports: |
||||
|
- "8099:8099" |
||||
|
network_mode: host # 使用现有网络 |
||||
|
volumes: |
||||
|
- "/opt/epmet-cloud-logs/prod:/logs" |
||||
|
environment: |
||||
|
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./gov-access.jar" |
||||
|
restart: "unless-stopped" |
||||
|
deploy: |
||||
|
resources: |
||||
|
limits: |
||||
|
cpus: '0.1' |
||||
|
memory: 600M |
||||
@ -0,0 +1,18 @@ |
|||||
|
version: "3.7" |
||||
|
services: |
||||
|
gov-access-server: |
||||
|
container_name: gov-access-server-test |
||||
|
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-access-server:version_placeholder |
||||
|
ports: |
||||
|
- "8099:8099" |
||||
|
network_mode: host # 使用现有网络 |
||||
|
volumes: |
||||
|
- "/opt/epmet-cloud-logs/test:/logs" |
||||
|
environment: |
||||
|
RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./gov-access.jar" |
||||
|
restart: "unless-stopped" |
||||
|
deploy: |
||||
|
resources: |
||||
|
limits: |
||||
|
cpus: '0.1' |
||||
|
memory: 400M |
||||
@ -0,0 +1,137 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<version>0.3.41</version> |
||||
|
<parent> |
||||
|
<artifactId>gov-access-lb</artifactId> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<version>2.0.0</version> |
||||
|
</parent> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
|
||||
|
<artifactId>gov-access-lb-server</artifactId> |
||||
|
<packaging>jar</packaging> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>gov-access-client</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>gov-org-client</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-user-client</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-commons-tools</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.epmet</groupId> |
||||
|
<artifactId>epmet-commons-mybatis</artifactId> |
||||
|
<version>2.0.0</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework</groupId> |
||||
|
<artifactId>spring-context-support</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-actuator</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>de.codecentric</groupId> |
||||
|
<artifactId>spring-boot-admin-starter-client</artifactId> |
||||
|
<version>${spring.boot.admin.version}</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba.cloud</groupId> |
||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
||||
|
</dependency> |
||||
|
<!-- 替换Feign原生httpclient --> |
||||
|
<dependency> |
||||
|
<groupId>io.github.openfeign</groupId> |
||||
|
<artifactId>feign-httpclient</artifactId> |
||||
|
<version>10.3.0</version> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
|
||||
|
<build> |
||||
|
<finalName>${project.artifactId}</finalName> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
</plugin> |
||||
|
<plugin> |
||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||
|
<artifactId>maven-surefire-plugin</artifactId> |
||||
|
<configuration> |
||||
|
<skipTests>true</skipTests> |
||||
|
</configuration> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory> |
||||
|
<resources> |
||||
|
<resource> |
||||
|
<filtering>true</filtering> |
||||
|
<directory>${basedir}/src/main/resources</directory> |
||||
|
</resource> |
||||
|
</resources> |
||||
|
</build> |
||||
|
|
||||
|
<profiles> |
||||
|
<profile> |
||||
|
<id>dev</id> |
||||
|
<activation> |
||||
|
<activeByDefault>true</activeByDefault> |
||||
|
</activation> |
||||
|
<properties> |
||||
|
<server.port>9999</server.port> |
||||
|
<spring.profiles.active>dev</spring.profiles.active> |
||||
|
|
||||
|
<!-- 数据库配置--> |
||||
|
<spring.datasource.druid.url> |
||||
|
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_gov_access?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> |
||||
|
</spring.datasource.druid.url> |
||||
|
<spring.datasource.druid.username>epmet_gov_access_user</spring.datasource.druid.username> |
||||
|
<spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password> |
||||
|
<!-- redis配置 --> |
||||
|
<spring.redis.index>0</spring.redis.index> |
||||
|
<spring.redis.host>192.168.1.130</spring.redis.host> |
||||
|
<spring.redis.port>6379</spring.redis.port> |
||||
|
<spring.redis.password>123456</spring.redis.password> |
||||
|
<!-- nacos --> |
||||
|
<nacos.register-enabled>true</nacos.register-enabled> |
||||
|
<nacos.server-addr>192.168.1.130:8848</nacos.server-addr> |
||||
|
<nacos.discovery.namespace>6ceab336-d004-4acf-89c6-e121d06f4988</nacos.discovery.namespace> |
||||
|
<nacos.config.namespace></nacos.config.namespace> |
||||
|
<nacos.config.group></nacos.config.group> |
||||
|
<nacos.config-enabled>false</nacos.config-enabled> |
||||
|
<nacos.ip/> |
||||
|
|
||||
|
<!--flyway migration 数据库迁移工具--> |
||||
|
<spring.flyway.enabled>false</spring.flyway.enabled> |
||||
|
</properties> |
||||
|
</profile> |
||||
|
</profiles> |
||||
|
|
||||
|
</project> |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet; |
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
||||
|
import org.springframework.cloud.openfeign.EnableFeignClients; |
||||
|
|
||||
|
/** |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@SpringBootApplication |
||||
|
@EnableDiscoveryClient |
||||
|
@EnableFeignClients |
||||
|
//@EnableConfigurationProperties(value = {DatabaseProperties.class})
|
||||
|
public class GovAccessLbApplication { |
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(GovAccessLbApplication.class, args); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.aspect; |
||||
|
|
||||
|
import com.epmet.commons.tools.aspect.BaseRequestLogAspect; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.annotation.Around; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.springframework.core.annotation.Order; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestAttributes; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
/** |
||||
|
* 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 |
||||
|
*/ |
||||
|
@Aspect |
||||
|
@Component |
||||
|
@Order(0) |
||||
|
public class RequestLogAspect extends BaseRequestLogAspect { |
||||
|
|
||||
|
@Override |
||||
|
@Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") |
||||
|
public Object proceed(ProceedingJoinPoint point) throws Throwable { |
||||
|
return super.proceed(point, getRequest()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取Request对象 |
||||
|
* |
||||
|
* @return |
||||
|
*/ |
||||
|
private HttpServletRequest getRequest() { |
||||
|
RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
||||
|
ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
||||
|
return sra.getRequest(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
package com.epmet.bean; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.HashSet; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
@Data |
||||
|
public class OpeScopeFilterResultBean { |
||||
|
|
||||
|
private HashSet<String> orgLevelScopes; |
||||
|
private Set<String> switchScopes; |
||||
|
private boolean allScopes; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,15 @@ |
|||||
|
//package com.epmet.config;
|
||||
|
//
|
||||
|
//import lombok.Data;
|
||||
|
//import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
//
|
||||
|
//@ConfigurationProperties(prefix = "spring.datasource.druid")
|
||||
|
//@Data
|
||||
|
//public class DatabaseProperties {
|
||||
|
//
|
||||
|
// private String driverClassName;
|
||||
|
// private String url;
|
||||
|
// private String username;
|
||||
|
// private String password;
|
||||
|
//
|
||||
|
//}
|
||||
@ -0,0 +1,29 @@ |
|||||
|
//package com.epmet.config;
|
||||
|
//
|
||||
|
//import org.flywaydb.core.Flyway;
|
||||
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
//
|
||||
|
//import javax.annotation.PostConstruct;
|
||||
|
//
|
||||
|
///**
|
||||
|
// * 数据库迁移配置
|
||||
|
// */
|
||||
|
//@Configuration
|
||||
|
//public class DbMigrationConfig {
|
||||
|
//
|
||||
|
// @Autowired
|
||||
|
// private DatabaseProperties databaseProperties;
|
||||
|
//
|
||||
|
// @PostConstruct
|
||||
|
// public void migrate() {
|
||||
|
// Flyway flyway = Flyway.configure().dataSource(
|
||||
|
// databaseProperties.getUrl(),
|
||||
|
// databaseProperties.getUsername(),
|
||||
|
// databaseProperties.getPassword())
|
||||
|
// .baselineOnMigrate(true)
|
||||
|
// .load();
|
||||
|
//
|
||||
|
// flyway.migrate();
|
||||
|
// }
|
||||
|
//
|
||||
|
//}
|
||||
@ -0,0 +1,26 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.config; |
||||
|
|
||||
|
import com.epmet.commons.tools.config.ModuleConfig; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 模块配置信息-新闻公告模块 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ModuleConfigImpl implements ModuleConfig { |
||||
|
@Override |
||||
|
public String getName() { |
||||
|
return "govaccess"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,69 @@ |
|||||
|
package com.epmet.config; |
||||
|
|
||||
|
import com.epmet.commons.tools.enums.RequirePermissionEnum; |
||||
|
import com.epmet.entity.OperationEntity; |
||||
|
import com.epmet.service.OperationService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import javax.annotation.PostConstruct; |
||||
|
import java.util.*; |
||||
|
|
||||
|
@Configuration |
||||
|
public class PermissionInitializer { |
||||
|
|
||||
|
@Autowired |
||||
|
private OperationService operationService; |
||||
|
|
||||
|
/** |
||||
|
* 初始化操作权限 |
||||
|
*/ |
||||
|
@PostConstruct |
||||
|
public void initOpePermissions() { |
||||
|
final Map<String, OperationEntity> existsOpesMap = new HashMap<>(); |
||||
|
List<OperationEntity> allExistsOpeEntities = operationService.listAllOperations(); |
||||
|
allExistsOpeEntities.stream().forEach(ope -> existsOpesMap.put(ope.getOperationKey(), ope)); |
||||
|
|
||||
|
ArrayList<OperationEntity> operations2Create = new ArrayList<>(); |
||||
|
ArrayList<OperationEntity> operations2Update = new ArrayList<>(); |
||||
|
|
||||
|
// 1.收集需要添加的
|
||||
|
List<RequirePermissionEnum> permEnums = Arrays.asList(RequirePermissionEnum.values()); |
||||
|
for (RequirePermissionEnum perm : permEnums) { |
||||
|
String key = perm.getKey(); |
||||
|
if (!existsOpesMap.containsKey(key)) { |
||||
|
OperationEntity operationEntity = new OperationEntity(); |
||||
|
operationEntity.setOperationKey(key); |
||||
|
operationEntity.setBrief(perm.getBrief()); |
||||
|
operationEntity.setOperationName(perm.getName()); |
||||
|
operations2Create.add(operationEntity); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//2.收集需要修改的
|
||||
|
for (RequirePermissionEnum perm : permEnums) { |
||||
|
String key = perm.getKey(); |
||||
|
String name = perm.getName(); |
||||
|
String brief = perm.getBrief(); |
||||
|
if (existsOpesMap.containsKey(key)) { |
||||
|
OperationEntity ope = existsOpesMap.get(key); |
||||
|
if (!name.equals(ope.getOperationName()) || !brief.equals(ope.getBrief())) { |
||||
|
// name或者brief发生过变化的,需要更新
|
||||
|
ope.setBrief(brief); |
||||
|
ope.setOperationName(name); |
||||
|
operations2Update.add(ope); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//3.批量添加和修改
|
||||
|
if (!CollectionUtils.isEmpty(operations2Create)) { |
||||
|
operationService.createBatch(operations2Create); |
||||
|
} |
||||
|
|
||||
|
if (!CollectionUtils.isEmpty(operations2Update)) { |
||||
|
operationService.updateBatch(operations2Update); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
package com.epmet.constant; |
||||
|
|
||||
|
/** |
||||
|
* 操作范围系列常量 |
||||
|
*/ |
||||
|
public class OperationScopeConstant { |
||||
|
|
||||
|
/** |
||||
|
* ===================系列=================== |
||||
|
*/ |
||||
|
public static final String SERIES_ORG_LEVEL = "org_level"; |
||||
|
public static final String SERIES_SWITCH = "switch"; |
||||
|
public static final String SERIES_ALL = "all"; |
||||
|
|
||||
|
/** |
||||
|
* ===================范围=================== |
||||
|
*/ |
||||
|
// 无任何范围限制
|
||||
|
public static final String SCOPE_ALL = "all"; |
||||
|
|
||||
|
// 覆盖机构下的所有范围
|
||||
|
public static final String SCOPE_ORG_ALL = "org_all"; |
||||
|
|
||||
|
//"同级组织的下级"
|
||||
|
public static final String SCOPE_ORG_EQUAL_SUB = "org_equal_sub"; |
||||
|
//"同级组织及下级"
|
||||
|
public static final String SCOPE_ORG_EQUAL_AND_SUB = "org_equal_and_sub"; |
||||
|
// 同级组织的上级
|
||||
|
public static final String SCOPE_ORG_EQUAL_SUP = "org_equal_sup"; |
||||
|
// 同级组织及上级
|
||||
|
public static final String SCOPE_ORG_EQUAL_AND_SUP = "org_equal_and_sup"; |
||||
|
//"同级组织"
|
||||
|
public static final String SCOPE_ORG_EQUAL = "org_equal"; |
||||
|
|
||||
|
//"本组织的下级"
|
||||
|
public static final String SCOPE_ORG_CURR_SUB = "org_curr_sub"; |
||||
|
//"本组织及下级"
|
||||
|
public static final String SCOPE_ORG_CURR_AND_SUB = "org_curr_and_sub"; |
||||
|
//"本组织"
|
||||
|
public static final String SCOPE_ORG_CURR = "org_curr"; |
||||
|
|
||||
|
//"本组织的上级"
|
||||
|
public static final String SCOPE_ORG_CURR_SUP = "org_curr_sup"; |
||||
|
//"本组织及上级"
|
||||
|
public static final String SCOPE_ORG_CURR_AND_SUP = "org_curr_and_sup"; |
||||
|
|
||||
|
//我创建的
|
||||
|
public static final String SCOPE_I_CREATED = "i_created"; |
||||
|
//网格内
|
||||
|
public static final String SCOPE_IN_GRID = "in_grid"; |
||||
|
// 部门内
|
||||
|
public static final String SCOPE_IN_DEPARTMENT = "in_department"; |
||||
|
} |
||||
@ -0,0 +1,138 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.form.*; |
||||
|
import com.epmet.dto.result.AccessConfigOpeDefaultScopesResultDTO; |
||||
|
import com.epmet.dto.result.AccessConfigOpesResultDTO; |
||||
|
import com.epmet.dto.result.AccessConfigOptionsResultDTO; |
||||
|
import com.epmet.dto.result.RoleOperationDefaultResultDTO; |
||||
|
import com.epmet.service.AccessConfigService; |
||||
|
import oracle.jdbc.proxy.annotation.Post; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("config") |
||||
|
public class AccessConfigController { |
||||
|
|
||||
|
@Autowired |
||||
|
private AccessConfigService accessConfigService; |
||||
|
|
||||
|
/** |
||||
|
* 根据roleKey查询角色默认操作列表(包括assigned字段,标识该角色是否已经具有该操作权限) |
||||
|
* @param roleKey |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("roledefaultops/{roleKey}") |
||||
|
public Result listRoleDefaultOps(@PathVariable("roleKey") String roleKey) { |
||||
|
List<RoleOperationDefaultResultDTO> defaultOps = accessConfigService.listRoleDefaultOpsByRoleKey(roleKey); |
||||
|
return new Result().ok(defaultOps); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据角色ID列出角色的操作列表(及该操作的scope范围) |
||||
|
* @param roleId |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("roleopes/{roleId}") |
||||
|
public Result listRoleOperations(@PathVariable("roleId") String roleId) { |
||||
|
List<AccessConfigOpesResultDTO> opes = accessConfigService.listOpesByRole(roleId); |
||||
|
return new Result().ok(opes); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存角色的操作权限列表 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("saveroleopes") |
||||
|
public Result saveRoleOpes(@RequestBody AccessConfigOpesFormDTO formDTO) { |
||||
|
accessConfigService.saveRoleOpes(formDTO.getRoleId(), formDTO.getOpes()); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询可配置项列表 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("configoptions") |
||||
|
public Result listConfigOptions(@RequestBody AccessConfigOptionsFormDTO accessConfigFormDTO) { |
||||
|
ValidatorUtils.validateEntity(accessConfigFormDTO); |
||||
|
AccessConfigOptionsResultDTO options = accessConfigService.listScopeOptionsForAccessConfig(accessConfigFormDTO.getRoleId(), accessConfigFormDTO.getOperationKey()); |
||||
|
return new Result().ok(options); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存设置 |
||||
|
* @param config |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("saveconfig") |
||||
|
public Result saveSettings(@RequestBody AccessConfigSaveConfigDTO config) { |
||||
|
ValidatorUtils.validateEntity(config); |
||||
|
String roleId = config.getRoleId(); |
||||
|
String operationKey = config.getOperationKey(); |
||||
|
Set<String> scopeKeys = config.getScopeKeys(); |
||||
|
accessConfigService.saveConfig(roleId, operationKey, scopeKeys); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存角色默认操作权限列表 |
||||
|
* @param form |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("roledefaultopes/save") |
||||
|
public Result saveRoleDefaultOperations(@RequestBody AccessConfigRoleDefaultOpesFormDTO form) { |
||||
|
ValidatorUtils.validateEntity(form); |
||||
|
accessConfigService.saveRoleDefaultOperations(form.getRoleKey(), form.getOperationKeys()); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询操作的默认范围列表 |
||||
|
* @param form |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("opedefaultscopes/list") |
||||
|
public Result listOpeDefaultScopes(@RequestBody AccessConfigOpeDefaultScopesFormDTO form) { |
||||
|
ValidatorUtils.validateEntity(form, AccessConfigOpeDefaultScopesFormDTO.ListOpeDefaultScopesGroup.class); |
||||
|
List<AccessConfigOpeDefaultScopesResultDTO> scopes = accessConfigService.listOpeDefaultScopes4Role(form.getRoleKey(), form.getOperationKey()); |
||||
|
return new Result().ok(scopes); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存操作的默认范围配置 |
||||
|
* @param form |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("opedefaultscopes/save") |
||||
|
public Result saveOpeDefaultScopes(@RequestBody AccessConfigOpeDefaultScopesFormDTO form) { |
||||
|
ValidatorUtils.validateEntity(form, AccessConfigOpeDefaultScopesFormDTO.SaveOpeDefaultScopesGroup.class); |
||||
|
accessConfigService.saveOpeDefaultScopes(form.getRoleKey(), form.getOperationKey(), form.getScopeKeys()); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 给角色添加操作权限和操作范围 |
||||
|
* @return |
||||
|
* @author wxz |
||||
|
* @date 2020.11.17 17:41 |
||||
|
*/ |
||||
|
@PostMapping("add-ope-and-scopes-4role") |
||||
|
public Result addOpeAndScopes4Role(@RequestBody AccessConfigAdd4RoletFormDTO form) { |
||||
|
ValidatorUtils.validateEntity(form); |
||||
|
String roleKey = form.getRoleKey(); |
||||
|
String operationKey = form.getOperationKey(); |
||||
|
List<String> scopeKeys = form.getScopeKeys(); |
||||
|
|
||||
|
accessConfigService.addOpeAndScopes4Role(roleKey, operationKey, scopeKeys); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,60 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.form.*; |
||||
|
import com.epmet.service.AccessService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* 权限相关Api |
||||
|
* @Author wxz |
||||
|
* @Description |
||||
|
* @Date 2020/4/23 17:54 |
||||
|
**/ |
||||
|
@RestController |
||||
|
@RequestMapping("access") |
||||
|
public class AccessController { |
||||
|
|
||||
|
@Autowired |
||||
|
private AccessService accessService; |
||||
|
|
||||
|
/** |
||||
|
* 用户是否具有指定功能权限 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("hasspecifiedpermission") |
||||
|
public Result<Boolean> hasSpecifiedPermission(@RequestBody HasSpecifiedPermissionFormDTO form) { |
||||
|
ValidatorUtils.validateEntity(form); |
||||
|
Boolean hasPermission = accessService.hasPermission(form.getOperationKey(), form.getUserId(), form.getApp(), form.getClient()); |
||||
|
return new Result<Boolean>().ok(hasPermission); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 列出功能权限列表 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("listoperationpermissions") |
||||
|
public Result<Set<String>> listOperationPermissions(@RequestBody ListOpePermsFormDTO listOpePermsFormDTO) { |
||||
|
ValidatorUtils.validateEntity(listOpePermsFormDTO); |
||||
|
String currAgencyId = listOpePermsFormDTO.getCurrAgencyId(); |
||||
|
String staffId = listOpePermsFormDTO.getStaffId(); |
||||
|
Set<String> operationPermissions = accessService.listOperationPermissions(staffId, currAgencyId); |
||||
|
return new Result<Set<String>>().ok(operationPermissions); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询sql过滤片段 |
||||
|
* @param form |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("getSqlFilterSegment") |
||||
|
public Result getSqlFilterSegment(@RequestBody GetSQLFilterFormDTO form) { |
||||
|
ValidatorUtils.validateEntity(form); |
||||
|
String sqlFilterSegment = accessService.getSqlFilterSegment(form); |
||||
|
return new Result().ok(sqlFilterSegment); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,64 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("demo") |
||||
|
public class DemoController { |
||||
|
|
||||
|
@PostMapping("adduser") |
||||
|
public Result addUser(@RequestBody UserFormDTO form) { |
||||
|
ValidatorUtils.validateEntity(form, UserFormDTO.AddUserShowGroup.class, UserFormDTO.AddUserInternalGroup.class); |
||||
|
System.out.println(form); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
class UserFormDTO { |
||||
|
//>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
|
||||
|
/** |
||||
|
* 添加用户操作的内部异常分组 |
||||
|
* 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... |
||||
|
*/ |
||||
|
public interface AddUserInternalGroup {} |
||||
|
|
||||
|
/** |
||||
|
* 添加用户操作的用户可见异常分组 |
||||
|
* 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup |
||||
|
* 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 |
||||
|
*/ |
||||
|
public interface AddUserShowGroup extends CustomerClientShowGroup {} |
||||
|
|
||||
|
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
|
|
||||
|
/** |
||||
|
* 该字段在查询用户和添加用户的时候都要校验,所以在groups中会添加2个分组,校验器会优先校验继承了CustomerClientShowGroup |
||||
|
* 的分组 |
||||
|
* 1.该分组校验出错,直接将信息返回客户端,(多个字段有错误,多个字段的错误信息 |
||||
|
* 拼接起来,逗号分隔,详见ValidatorUtils#validadtorEntity()方法) |
||||
|
* 2.该分组校验成功,则继续往下,校验内部错误,若出现内部错误,则返回7000,服务器开小差... |
||||
|
*/ |
||||
|
@NotBlank(message = "请输入姓名信息", groups = { AddUserInternalGroup.class, AddUserShowGroup.class }) |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 用户别名,只在内部传输,因此它所属的分组不能继承CustomerClientShowGroup |
||||
|
*/ |
||||
|
@NotBlank(message = "用户别名不能为空", groups = { AddUserInternalGroup.class }) |
||||
|
private String alias; |
||||
|
|
||||
|
@NotBlank(message = "请输入地址信息", groups = { AddUserShowGroup.class }) |
||||
|
private String address; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,85 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.GovLanguageDTO; |
||||
|
import com.epmet.service.GovLanguageService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 国际化 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("operlanguage") |
||||
|
public class GovLanguageController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GovLanguageService govLanguageService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GovLanguageDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GovLanguageDTO> page = govLanguageService.page(params); |
||||
|
return new Result<PageData<GovLanguageDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GovLanguageDTO> get(@PathVariable("id") String id){ |
||||
|
GovLanguageDTO data = govLanguageService.get(id); |
||||
|
return new Result<GovLanguageDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GovLanguageDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
govLanguageService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GovLanguageDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
govLanguageService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
govLanguageService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,156 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.LoginUser; |
||||
|
import com.epmet.commons.tools.exception.ErrorCode; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.GovMenuDTO; |
||||
|
import com.epmet.dto.result.MenuResourceDTO; |
||||
|
import com.epmet.service.GovMenuService; |
||||
|
import com.epmet.service.GovResourceService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/3/17 16:35 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("menu") |
||||
|
public class GovMenuController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GovMenuService govMenuService; |
||||
|
|
||||
|
@Autowired |
||||
|
private GovResourceService govResourceService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GovMenuDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GovMenuDTO> page = govMenuService.page(params); |
||||
|
return new Result<PageData<GovMenuDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GovMenuDTO> get(@PathVariable("id") String id){ |
||||
|
GovMenuDTO data = govMenuService.get(id); |
||||
|
|
||||
|
//菜单资源列表
|
||||
|
List<MenuResourceDTO> resourceList = govResourceService.getMenuResourceList(id); |
||||
|
|
||||
|
return new Result<GovMenuDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GovMenuDTO dto, @LoginUser TokenDto tokenDto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
govMenuService.save(dto,tokenDto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GovMenuDTO dto, @LoginUser TokenDto tokenDto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
govMenuService.update(dto,tokenDto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
govMenuService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping("{id}") |
||||
|
public Result delete(@PathVariable("id") String id, @LoginUser TokenDto tokenDto){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isNull(id, "id"); |
||||
|
|
||||
|
//判断是否有子菜单或按钮
|
||||
|
List<GovMenuDTO> list = govMenuService.getListPid(id); |
||||
|
if(list.size() > 0){ |
||||
|
return new Result().error(ErrorCode.SUB_MENU_EXIST); |
||||
|
} |
||||
|
|
||||
|
govMenuService.delete(id, tokenDto); |
||||
|
|
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 获取菜单列表 |
||||
|
* @param type 类型 |
||||
|
* @return Result<List<GovMenuDTO>> |
||||
|
*/ |
||||
|
@GetMapping("list") |
||||
|
public Result<List<GovMenuDTO>> list(Integer type){ |
||||
|
List<GovMenuDTO> list = govMenuService.getMenuList(type); |
||||
|
|
||||
|
return new Result<List<GovMenuDTO>>().ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导航 |
||||
|
* @param tokenDto token |
||||
|
* @return List<GovMenuDTO> |
||||
|
*/ |
||||
|
@GetMapping("nav") |
||||
|
public Result<List<GovMenuDTO>> nav(@LoginUser TokenDto tokenDto){ |
||||
|
List<GovMenuDTO> list = govMenuService.getUserMenuNavList(tokenDto); |
||||
|
return new Result<List<GovMenuDTO>>().ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 权限标识 |
||||
|
* @param tokenDto token |
||||
|
* @return Set<String> |
||||
|
*/ |
||||
|
@GetMapping("permissions") |
||||
|
public Result<Set<String>> permissions(@LoginUser TokenDto tokenDto){ |
||||
|
Set<String> set = govMenuService.getUserPermissions(tokenDto); |
||||
|
return new Result<Set<String>>().ok(set); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单权限 |
||||
|
* @param tokenDto token |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("select") |
||||
|
public Result<List<GovMenuDTO>> select(@LoginUser TokenDto tokenDto){ |
||||
|
List<GovMenuDTO> list = govMenuService.getUserMenuList(tokenDto, null); |
||||
|
|
||||
|
return new Result<List<GovMenuDTO>>().ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param tokenDto |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
* @Author yinzuomei |
||||
|
* @Description 运营端用户退出系统,清空菜单和操作权限 |
||||
|
* @Date 2020/5/21 18:07 |
||||
|
**/ |
||||
|
@GetMapping("cleargovuseraccess") |
||||
|
public Result clearGovUserAccess(@LoginUser TokenDto tokenDto) { |
||||
|
govMenuService.clearOperUserAccess(tokenDto.getApp(), tokenDto.getClient(), tokenDto.getUserId()); |
||||
|
return new Result(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,84 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.GovResourceDTO; |
||||
|
import com.epmet.service.GovResourceService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 资源管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("govresource") |
||||
|
public class GovResourceController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GovResourceService govResourceService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GovResourceDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GovResourceDTO> page = govResourceService.page(params); |
||||
|
return new Result<PageData<GovResourceDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GovResourceDTO> get(@PathVariable("id") String id){ |
||||
|
GovResourceDTO data = govResourceService.get(id); |
||||
|
return new Result<GovResourceDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GovResourceDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
govResourceService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GovResourceDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
govResourceService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
govResourceService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.GovRoleDTO; |
||||
|
import com.epmet.service.GovRoleMenuService; |
||||
|
import com.epmet.service.GovRoleService; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("govrole") |
||||
|
public class GovRoleController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GovRoleService govRoleService; |
||||
|
@Autowired |
||||
|
private GovRoleMenuService govRoleMenuService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GovRoleDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GovRoleDTO> page = govRoleService.page(params); |
||||
|
return new Result<PageData<GovRoleDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GovRoleDTO> get(@PathVariable("id") String id){ |
||||
|
GovRoleDTO data = govRoleService.get(id); |
||||
|
|
||||
|
//查询角色对应的菜单
|
||||
|
List<String> menuIdList = govRoleMenuService.getMenuIdList(id); |
||||
|
data.setMenuIdList(menuIdList); |
||||
|
|
||||
|
return new Result<GovRoleDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GovRoleDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
govRoleService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GovRoleDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
govRoleService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
govRoleService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@GetMapping("list") |
||||
|
@ApiOperation("列表") |
||||
|
public Result<List<GovRoleDTO>> list(){ |
||||
|
List<GovRoleDTO> data = govRoleService.list(new HashMap<>(1)); |
||||
|
|
||||
|
return new Result<List<GovRoleDTO>>().ok(data); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,85 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.GovRoleMenuDTO; |
||||
|
import com.epmet.service.GovRoleMenuService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("govrolemenu") |
||||
|
public class GovRoleMenuController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GovRoleMenuService govRoleMenuService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GovRoleMenuDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GovRoleMenuDTO> page = govRoleMenuService.page(params); |
||||
|
return new Result<PageData<GovRoleMenuDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GovRoleMenuDTO> get(@PathVariable("id") String id){ |
||||
|
GovRoleMenuDTO data = govRoleMenuService.get(id); |
||||
|
return new Result<GovRoleMenuDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GovRoleMenuDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
govRoleMenuService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GovRoleMenuDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
govRoleMenuService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
govRoleMenuService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,132 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.dto.GovRoleUserDTO; |
||||
|
import com.epmet.service.GovRoleUserService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 角色用户关系 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("govroleuser") |
||||
|
public class GovRoleUserController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GovRoleUserService govRoleUserService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GovRoleUserDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GovRoleUserDTO> page = govRoleUserService.page(params); |
||||
|
return new Result<PageData<GovRoleUserDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GovRoleUserDTO> get(@PathVariable("id") String id){ |
||||
|
GovRoleUserDTO data = govRoleUserService.get(id); |
||||
|
return new Result<GovRoleUserDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GovRoleUserDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
govRoleUserService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GovRoleUserDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
govRoleUserService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
govRoleUserService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 获取权限id列表 |
||||
|
* @param id 用户id |
||||
|
* @return List<String> |
||||
|
* @author zhaoqifeng |
||||
|
*/ |
||||
|
@GetMapping("getRoleIdList/{id}") |
||||
|
public Result<List<String>>getRoleIdList(@PathVariable("id") String id) { |
||||
|
List<String> list = govRoleUserService.getRoleIdList(id); |
||||
|
return new Result<List<String>>().ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存更新权限 |
||||
|
* @param userId 用户id |
||||
|
* @param roleIdList 权限列表 |
||||
|
* @author zhaoqifeng |
||||
|
*/ |
||||
|
@PostMapping("saveOrUpdateRole") |
||||
|
public Result saveOrUpdate(@RequestParam("userId") String userId, @RequestBody List<String> roleIdList) { |
||||
|
govRoleUserService.saveOrUpdate(userId, roleIdList); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据用户id,删除角色用户关系 |
||||
|
* @param id 用户id |
||||
|
* @return Result |
||||
|
*/ |
||||
|
@PostMapping("deleteByUserId") |
||||
|
public Result deleteByUserId(String id) { |
||||
|
govRoleUserService.deleteByUserId(id); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 根据用户ids,删除角色用户关系 |
||||
|
* @param ids 用户ids |
||||
|
* @return Result |
||||
|
*/ |
||||
|
@PostMapping("deleteByUserIds") |
||||
|
public Result deleteByUserIds(@RequestBody String[] ids) { |
||||
|
govRoleUserService.deleteByUserIds(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.form.InitDefaultOperationsFormDTO; |
||||
|
import com.epmet.dto.result.RoleOperationResultDTO; |
||||
|
import com.epmet.service.RoleOperationService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("role") |
||||
|
public class RoleController { |
||||
|
|
||||
|
@Autowired |
||||
|
private RoleOperationService roleOperationService; |
||||
|
|
||||
|
/** |
||||
|
* 查询角色对应的操作列表 |
||||
|
* @param roleId |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("operations/{roleId}") |
||||
|
public Result<List<RoleOperationResultDTO>> listOperationsByRoleId(@PathVariable("roleId") String roleId) { |
||||
|
List<RoleOperationResultDTO> roleOperationResultDTOS = roleOperationService.listOperationsByRoleId(roleId); |
||||
|
return new Result<List<RoleOperationResultDTO>>().ok(roleOperationResultDTOS); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 批量为角色ID初始化操作权限列表 |
||||
|
* @param formDTO |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("initdefaultoperationsforroles") |
||||
|
public Result initDefaultOperationsForRoles(@RequestBody InitDefaultOperationsFormDTO formDTO) { |
||||
|
List<InitDefaultOperationsFormDTO.InitDefaultOpesRoleDTO> roles = formDTO.getRoles(); |
||||
|
roleOperationService.initDefaultOperationsForRoles(roles); |
||||
|
return new Result(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.ExternalRequestAuth; |
||||
|
import com.epmet.service.TestService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("test") |
||||
|
public class TestController { |
||||
|
|
||||
|
@Autowired |
||||
|
private TestService testService; |
||||
|
|
||||
|
@ExternalRequestAuth |
||||
|
@GetMapping("test") |
||||
|
public void test() { |
||||
|
System.out.println("TestController -> test()"); |
||||
|
testService.test(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.GovLanguageEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 国际化 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GovLanguageDao extends BaseDao<GovLanguageEntity> { |
||||
|
|
||||
|
GovLanguageEntity getLanguage(GovLanguageEntity entity); |
||||
|
|
||||
|
void updateLanguage(GovLanguageEntity entity); |
||||
|
|
||||
|
void insertOperLanguageEntity(GovLanguageEntity entity); |
||||
|
} |
||||
@ -0,0 +1,52 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.GovMenuEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GovMenuDao extends BaseDao<GovMenuEntity> { |
||||
|
|
||||
|
GovMenuEntity getById(@Param("id") String id, @Param("language") String language); |
||||
|
|
||||
|
/** |
||||
|
* 查询所有菜单列表 |
||||
|
* |
||||
|
* @param type 菜单类型 |
||||
|
* @param language 语言 |
||||
|
*/ |
||||
|
List<GovMenuEntity> getMenuList(@Param("type") Integer type, @Param("language") String language); |
||||
|
|
||||
|
/** |
||||
|
* 查询用户菜单列表 |
||||
|
* |
||||
|
* @param userId 用户ID |
||||
|
* @param type 菜单类型 |
||||
|
* @param language 语言 |
||||
|
*/ |
||||
|
List<GovMenuEntity> getUserMenuList(@Param("userId") String userId, @Param("type") Integer type, @Param("language") String language); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 根据父菜单,查询子菜单 |
||||
|
* @param pid 父菜单ID |
||||
|
*/ |
||||
|
List<GovMenuEntity> getListPid(String pid); |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.GovResourceEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 资源管理 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GovResourceDao extends BaseDao<GovResourceEntity> { |
||||
|
/** |
||||
|
* 根据资源编码,删除对应的资源 |
||||
|
* @param code 资源编码 |
||||
|
*/ |
||||
|
void deleteByCode(String code); |
||||
|
|
||||
|
/** |
||||
|
* 获取资源列表 |
||||
|
* @param menuId 菜单ID |
||||
|
*/ |
||||
|
List<GovResourceEntity> getMenuResourceList(String menuId); |
||||
|
|
||||
|
/** |
||||
|
* 获取所有资源列表 |
||||
|
*/ |
||||
|
List<GovResourceEntity> getResourceList(); |
||||
|
|
||||
|
/** |
||||
|
* 获取用户资源列表 |
||||
|
* @param userId 用户ID |
||||
|
*/ |
||||
|
List<GovResourceEntity> getUserResourceList(@Param("userId") String userId); |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.GovRoleEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 角色管理 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GovRoleDao extends BaseDao<GovRoleEntity> { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.GovRoleMenuEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GovRoleMenuDao extends BaseDao<GovRoleMenuEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 根据角色ID,获取菜单ID列表 |
||||
|
*/ |
||||
|
List<String> getMenuIdList(String roleId); |
||||
|
|
||||
|
/** |
||||
|
* 根据角色id,删除角色菜单关系 |
||||
|
* @param roleId 角色id |
||||
|
*/ |
||||
|
void deleteByRoleId(String roleId); |
||||
|
|
||||
|
/** |
||||
|
* 根据菜单id,删除角色菜单关系 |
||||
|
* @param menuId 菜单id |
||||
|
*/ |
||||
|
void deleteByMenuId(String menuId); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 根据角色ids,删除角色菜单关系 |
||||
|
* @param roleIds 角色ids |
||||
|
*/ |
||||
|
void deleteByRoleIds(String[] roleIds); |
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.GovRoleUserEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 角色用户关系 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GovRoleUserDao extends BaseDao<GovRoleUserEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 根据角色ids,删除角色用户关系 |
||||
|
* @param roleIds 角色ids |
||||
|
*/ |
||||
|
void deleteByRoleIds(String[] roleIds); |
||||
|
|
||||
|
/** |
||||
|
* 根据用户ids,删除角色用户关系 |
||||
|
* @param userIds 用户ids |
||||
|
*/ |
||||
|
void deleteByUserIds(String[] userIds); |
||||
|
|
||||
|
/** |
||||
|
* 根据角色id,删除角色用户关系 |
||||
|
* @param roleId 角色id |
||||
|
*/ |
||||
|
void deleteByRoleId(String roleId); |
||||
|
|
||||
|
/** |
||||
|
* 根据用户id,删除角色用户关系 |
||||
|
* @param userId 用户id |
||||
|
*/ |
||||
|
void deleteByUserId(String userId); |
||||
|
|
||||
|
/** |
||||
|
* 角色ID列表 |
||||
|
* @param userId 用户ID |
||||
|
* |
||||
|
* @return |
||||
|
*/ |
||||
|
List<String> getRoleIdList(String userId); |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.OperationEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 操作类型表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-30 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface OperationDao extends BaseDao<OperationEntity> { |
||||
|
|
||||
|
List<OperationEntity> listAllOperationEntities(); |
||||
|
|
||||
|
List<OperationEntity> listAllValidOperationEntities(); |
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.result.RoleOpeScopeResultDTO; |
||||
|
import com.epmet.entity.OperationScopeEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.springframework.context.annotation.Scope; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* 权限范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface OperationScopeDao extends BaseDao<OperationScopeEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 查询角色的操作key对应操作范围列表 |
||||
|
* @param roleId 角色id |
||||
|
* @param operationKey 操作key |
||||
|
* @return |
||||
|
*/ |
||||
|
Set<RoleOpeScopeResultDTO> listOperationScopesByRoleId(@Param("roleId") String roleId, |
||||
|
@Param("operationKey") String operationKey); |
||||
|
|
||||
|
/** |
||||
|
* 查询角色所有operation及其范围 |
||||
|
* @param roleId |
||||
|
*/ |
||||
|
List<RoleOpeScopeResultDTO> listAllRoleOperationScopesByRoleId(String roleId); |
||||
|
|
||||
|
String getDefaultScopeKeyForOperation(@Param("operationKey") String operationKey); |
||||
|
|
||||
|
String getScopeIndexByScopeKey(@Param("scopeKey") String scopeKey); |
||||
|
} |
||||
@ -0,0 +1,64 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.result.AccessConfigOpeDefaultScopesResultDTO; |
||||
|
import com.epmet.dto.result.OperationScopeDefaultResultDTO; |
||||
|
import com.epmet.entity.OperationScopeDefaultEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 默认操作范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface OperationScopeDefaultDao extends BaseDao<OperationScopeDefaultEntity> { |
||||
|
List<OperationScopeDefaultEntity> listAllValid(); |
||||
|
|
||||
|
/** |
||||
|
* 根据角色key和操作key查询默认操作权限列表 |
||||
|
* @param roleKey |
||||
|
* @return |
||||
|
*/ |
||||
|
List<OperationScopeDefaultResultDTO> listDefaultOpeScopes(@Param("roleKey") String roleKey); |
||||
|
|
||||
|
/** |
||||
|
* 查询操作的默认范围 |
||||
|
* @param roleKey |
||||
|
* @param operationKey |
||||
|
* @return |
||||
|
*/ |
||||
|
List<AccessConfigOpeDefaultScopesResultDTO> listOpeDefaultScopes4Config( |
||||
|
@Param("roleKey") String roleKey, |
||||
|
@Param("operationKey") String operationKey); |
||||
|
|
||||
|
List<OperationScopeDefaultEntity> listOpeDefaultScopesByRoleAndOpeKey( |
||||
|
@Param("roleKey") String roleKey, |
||||
|
@Param("operationKey") String operationKey); |
||||
|
|
||||
|
int delete( |
||||
|
@Param("roleKey") String roleKey, |
||||
|
@Param("operationKey") String operationKey, |
||||
|
@Param("scopeKey") String scopeKey); |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.result.AccessConfigOpesResultDTO; |
||||
|
import com.epmet.dto.result.RoleOperationResultDTO; |
||||
|
import com.epmet.entity.RoleOperationEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 角色能进行那些操作 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-22 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RoleOperationDao extends BaseDao<RoleOperationEntity> { |
||||
|
|
||||
|
List<RoleOperationResultDTO> listOperationsByRoleId(@Param("roleId") String roleId); |
||||
|
|
||||
|
List<AccessConfigOpesResultDTO> listOpesForAccessConfig(@Param("roleId") String roleId); |
||||
|
|
||||
|
void deleteRoleOpe(@Param("roleId") String roleId, @Param("opeKey") String opeKey); |
||||
|
|
||||
|
RoleOperationEntity getRoleOpe(@Param("roleId") String roleId, @Param("opeKey") String opeKey); |
||||
|
|
||||
|
int enableRoleOpe(@Param("roleId") String roleId, @Param("opeKey") String opeKey); |
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.result.AccessConfigOpeDefaultScopesResultDTO; |
||||
|
import com.epmet.dto.result.RoleOperationDefaultResultDTO; |
||||
|
import com.epmet.entity.RoleOperationDefaultEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 角色默认的可操作功能列表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-05-21 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RoleOperationDefaultDao extends BaseDao<RoleOperationDefaultEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 查询可用 |
||||
|
* @return |
||||
|
*/ |
||||
|
List<RoleOperationDefaultResultDTO> listAllValid(); |
||||
|
|
||||
|
/** |
||||
|
* 查询某个roleKey的所有默认操作权限 |
||||
|
* @param roleKey |
||||
|
* @return |
||||
|
*/ |
||||
|
List<RoleOperationDefaultResultDTO> listByRoleKey(@Param("roleKey") String roleKey); |
||||
|
|
||||
|
List<RoleOperationDefaultResultDTO> listRoleDefaultOpsByRoleKey(@Param("roleKey") String roleKey); |
||||
|
|
||||
|
int deleteByRoleKeyAndOpeKey( |
||||
|
@Param("roleKey") String roleKey, |
||||
|
@Param("operationKey") String operationKey); |
||||
|
} |
||||
@ -0,0 +1,85 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.result.AccessConfigScopeResultDTO; |
||||
|
import com.epmet.entity.RoleScopeEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* 角色能操作哪些范围 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface RoleScopeDao extends BaseDao<RoleScopeEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 权限配置:列出可选项 |
||||
|
* @param roleId |
||||
|
* @param operationKey |
||||
|
* @return |
||||
|
*/ |
||||
|
List<AccessConfigScopeResultDTO> listScopeOptionsForAccessConfig(@Param("roleId") String roleId, @Param("operationKey") String operationKey); |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @param roleId |
||||
|
* @param operationKey |
||||
|
* @return |
||||
|
*/ |
||||
|
List<RoleScopeEntity> listScopeEntities(@Param("roleId") String roleId, @Param("operationKey") String operationKey); |
||||
|
|
||||
|
/** |
||||
|
* 使用roleId+OperationKey+ScopeKey删除 |
||||
|
* @param roleId |
||||
|
* @param operationKey |
||||
|
* @param scopeKeys2Remove |
||||
|
* @return |
||||
|
*/ |
||||
|
int deleteByRoleIdAndOpeKey(@Param("roleId") String roleId, |
||||
|
@Param("operationKey") String operationKey, |
||||
|
@Param("scopeKeys2Remove") Set<String> scopeKeys2Remove); |
||||
|
|
||||
|
/** |
||||
|
* 启用 |
||||
|
* @param roleId |
||||
|
* @param operationKey |
||||
|
* @param scopeKey |
||||
|
* @return |
||||
|
*/ |
||||
|
int enableByRoleIdAndOpeKey(@Param("roleId") String roleId, |
||||
|
@Param("operationKey") String operationKey, |
||||
|
@Param("scopeKey") String scopeKey); |
||||
|
|
||||
|
/** |
||||
|
* 使用RoleId + operationKey + scopeKey |
||||
|
* @param roleId |
||||
|
* @param operationKey |
||||
|
* @param scopeKey |
||||
|
*/ |
||||
|
RoleScopeEntity getByRoleIdAndOpeKey(@Param("roleId") String roleId, |
||||
|
@Param("operationKey") String operationKey, |
||||
|
@Param("scopeKey") String scopeKey); |
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 国际化 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("gov_language") |
||||
|
public class GovLanguageEntity implements Serializable { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 表名 |
||||
|
*/ |
||||
|
private String tableName; |
||||
|
/** |
||||
|
* 表主键 |
||||
|
*/ |
||||
|
private String tableId; |
||||
|
/** |
||||
|
* 字段名 |
||||
|
*/ |
||||
|
private String fieldName; |
||||
|
/** |
||||
|
* 字段值 |
||||
|
*/ |
||||
|
private String fieldValue; |
||||
|
/** |
||||
|
* 语言 |
||||
|
*/ |
||||
|
private String language; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,69 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("gov_menu") |
||||
|
public class GovMenuEntity extends BaseEpmetEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 上级ID,一级菜单为0 |
||||
|
*/ |
||||
|
private String pid; |
||||
|
/** |
||||
|
* 菜单名称 |
||||
|
*/ |
||||
|
@TableField(exist = false) |
||||
|
private String name; |
||||
|
/** |
||||
|
* 菜单URL |
||||
|
*/ |
||||
|
private String url; |
||||
|
/** |
||||
|
* 类型 0:菜单 1:按钮 |
||||
|
*/ |
||||
|
private Integer type; |
||||
|
/** |
||||
|
* 菜单图标 |
||||
|
*/ |
||||
|
private String icon; |
||||
|
/** |
||||
|
* 权限标识,如:sys:menu:save |
||||
|
*/ |
||||
|
private String permissions; |
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
/** |
||||
|
* 上级菜单名称 |
||||
|
*/ |
||||
|
@TableField(exist = false) |
||||
|
private String parentName; |
||||
|
|
||||
|
/** |
||||
|
* 是否显示,1:显示 0不显示 |
||||
|
*/ |
||||
|
private Integer showFlag; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 资源管理 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("gov_resource") |
||||
|
public class GovResourceEntity extends BaseEpmetEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 资源编码,如菜单ID |
||||
|
*/ |
||||
|
private String resourceCode; |
||||
|
/** |
||||
|
* 资源名称 |
||||
|
*/ |
||||
|
private String resourceName; |
||||
|
/** |
||||
|
* 资源URL |
||||
|
*/ |
||||
|
private String resourceUrl; |
||||
|
/** |
||||
|
* 请求方式(如:GET、POST、PUT、DELETE) |
||||
|
*/ |
||||
|
private String resourceMethod; |
||||
|
/** |
||||
|
* 菜单标识 0:非菜单资源 1:菜单资源 |
||||
|
*/ |
||||
|
private Integer menuFlag; |
||||
|
/** |
||||
|
* 认证等级 0:权限认证 1:登录认证 2:无需认证 |
||||
|
*/ |
||||
|
private Integer authLevel; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.FieldFill; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 角色管理 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("gov_role") |
||||
|
public class GovRoleEntity extends BaseEpmetEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 角色名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
/** |
||||
|
* 部门ID |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private Long deptId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("gov_role_menu") |
||||
|
public class GovRoleMenuEntity extends BaseEpmetEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
/** |
||||
|
* 菜单ID |
||||
|
*/ |
||||
|
private String menuId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 角色用户关系 |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("gov_role_user") |
||||
|
public class GovRoleUserEntity extends BaseEpmetEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 操作类型表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-30 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("operation") |
||||
|
public class OperationEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String operationName; |
||||
|
|
||||
|
/** |
||||
|
* 操作简介 |
||||
|
*/ |
||||
|
private String brief; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 默认操作范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("operation_scope_default") |
||||
|
public class OperationScopeDefaultEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
private String roleKey; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围key |
||||
|
*/ |
||||
|
private String scopeKey; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 权限范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("operation_scope") |
||||
|
public class OperationScopeEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 范围key |
||||
|
*/ |
||||
|
private String scopeKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围名称 |
||||
|
*/ |
||||
|
private String scopeName; |
||||
|
|
||||
|
private String scopeIndex; |
||||
|
private String series; |
||||
|
private Integer sort; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("role_operation_default") |
||||
|
public class RoleOperationDefaultEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 角色KEY |
||||
|
*/ |
||||
|
private String roleKey; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 角色能进行那些操作 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("role_operation") |
||||
|
public class RoleOperationEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 角色能操作哪些范围 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("role_scope") |
||||
|
public class RoleScopeEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 角色ID |
||||
|
*/ |
||||
|
private String roleId; |
||||
|
|
||||
|
/** |
||||
|
* 操作key |
||||
|
*/ |
||||
|
private String operationKey; |
||||
|
|
||||
|
/** |
||||
|
* 范围Key |
||||
|
*/ |
||||
|
private String scopeKey; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,62 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 角色能进行那些操作 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-04-22 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RoleOperationExcel { |
||||
|
|
||||
|
@Excel(name = "") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "角色ID") |
||||
|
private String roleId; |
||||
|
|
||||
|
@Excel(name = "操作key") |
||||
|
private String operationKey; |
||||
|
|
||||
|
@Excel(name = "是否删除,0:未删除,1:已删除") |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建者id") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新者id") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,77 @@ |
|||||
|
package com.epmet.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.GovStaffRoleDTO; |
||||
|
import com.epmet.dto.OperUserDTO; |
||||
|
import com.epmet.dto.form.LatestGridFormDTO; |
||||
|
import com.epmet.dto.form.StaffGridVisitedFormDTO; |
||||
|
import com.epmet.dto.form.StaffRoleFormDTO; |
||||
|
import com.epmet.dto.result.CustomerGridByUserIdResultDTO; |
||||
|
import com.epmet.dto.result.LatestCustomerResultDTO; |
||||
|
import com.epmet.feign.fallback.EpmetUserFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
//, url = "localhost:8087"
|
||||
|
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) |
||||
|
public interface EpmetUserFeignClient { |
||||
|
/** |
||||
|
* 获取最近一次登录的客户信息 |
||||
|
* |
||||
|
* @param userId |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/epmetuser/staffagencyvisited/getlatestcustomer/{userId}") |
||||
|
Result<LatestCustomerResultDTO> getLatestCustomer(@PathVariable("userId") String userId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询工作人员上次登录的网格 |
||||
|
* @Param customerId ; staffId |
||||
|
* @return Result<CustomerGridByUserIdResultDTO> |
||||
|
* @Author wangc |
||||
|
* @Date 2020.04.23 10:44 |
||||
|
**/ |
||||
|
@PostMapping(value = "/epmetuser/staffgridvisited/getstafflatestgrid") |
||||
|
Result<CustomerGridByUserIdResultDTO> getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); |
||||
|
|
||||
|
/** |
||||
|
* @param staffGridVisitedFormDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
* @Author yinzuomei |
||||
|
* @Description 保存网格访问记录 |
||||
|
* @Date 2020/4/23 13:27 |
||||
|
**/ |
||||
|
@PostMapping(value = "/epmetuser/staffgridvisited/savestaffgridvisitedrecord", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
||||
|
Result saveStaffGridVisitedRecord(@RequestBody StaffGridVisitedFormDTO staffGridVisitedFormDTO); |
||||
|
/** |
||||
|
* 查询工作人员的角色 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/epmetuser/staffrole/staffroles") |
||||
|
Result<List<GovStaffRoleDTO>> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* 根据id查询运营人员详情 |
||||
|
* |
||||
|
* @param operUserId oper_user表主键 |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List <com.epmet.dto.OperUserDTO>> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/3/19 09:28 |
||||
|
**/ |
||||
|
@GetMapping("/operuser/queryOperUserDtoById/{operUserId}") |
||||
|
Result<OperUserDTO> info(@PathVariable("operUserId") String operUserId); |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.CustomerAgencyDTO; |
||||
|
import com.epmet.feign.fallback.GovOrgFeignClientFallBack; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class, url = "localhost:8092")
|
||||
|
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) |
||||
|
public interface GovOrgFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* 根据Id查询agency |
||||
|
* @param agencyId |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/gov/org/agency/agencybyid/{agencyId}") |
||||
|
Result<CustomerAgencyDTO> getAgencyById(@PathVariable("agencyId") String agencyId); |
||||
|
|
||||
|
/** |
||||
|
* 根据staffId查询所属的组织机构 |
||||
|
* @param staffId |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/gov/org/agency/agencybystaff/{staffId}") |
||||
|
Result<CustomerAgencyDTO> getAgencyByStaff(@PathVariable("staffId") String staffId); |
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.GovStaffRoleDTO; |
||||
|
import com.epmet.dto.OperUserDTO; |
||||
|
import com.epmet.dto.form.LatestGridFormDTO; |
||||
|
import com.epmet.dto.form.StaffGridVisitedFormDTO; |
||||
|
import com.epmet.dto.form.StaffRoleFormDTO; |
||||
|
import com.epmet.dto.result.CustomerGridByUserIdResultDTO; |
||||
|
import com.epmet.dto.result.LatestCustomerResultDTO; |
||||
|
import com.epmet.feign.EpmetUserFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Component |
||||
|
public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<LatestCustomerResultDTO> getLatestCustomer(String userId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestCustomer", userId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<List<GovStaffRoleDTO>> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<OperUserDTO> info(String operUserId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "info", operUserId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<CustomerGridByUserIdResultDTO> getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffLatestGrid",latestGridFormDTO); |
||||
|
} |
||||
|
@Override |
||||
|
public Result saveStaffGridVisitedRecord(StaffGridVisitedFormDTO staffGridVisitedFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffGridVisitedRecord", staffGridVisitedFormDTO); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.form.LatestGridFormDTO; |
||||
|
import com.epmet.dto.result.CustomerGridByUserIdResultDTO; |
||||
|
import com.epmet.dto.result.LatestCustomerResultDTO; |
||||
|
import com.epmet.feign.GovOrgFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovOrgFeignClientFallBack implements GovOrgFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<CustomerAgencyDTO> getAgencyById(String agencyId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyById", agencyId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<CustomerAgencyDTO> getAgencyByStaff(String staffId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaff", staffId); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 国际化 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovLanguageRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,74 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisKeys; |
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import com.epmet.commons.tools.utils.HttpContextUtils; |
||||
|
import com.epmet.dto.GovMenuDTO; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* 菜单管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovMenuRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(String userId, String app, String client) { |
||||
|
redisUtils.deleteByPattern(RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage())); |
||||
|
redisUtils.delete(RedisKeys.getUserPermissionsKey(userId, app, client)); |
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public void setUserMenuNavList(String userId, String app, String client, List<GovMenuDTO> menuList){ |
||||
|
String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage()); |
||||
|
redisUtils.set(key, menuList); |
||||
|
} |
||||
|
|
||||
|
public List<GovMenuDTO> getUserMenuNavList(String userId, String app, String client){ |
||||
|
String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage()); |
||||
|
return (List<GovMenuDTO>)redisUtils.get(key); |
||||
|
} |
||||
|
|
||||
|
public void setUserPermissions(String userId, String app, String client, Set<String> permsSet){ |
||||
|
String key = RedisKeys.getUserPermissionsKey(userId, app, client); |
||||
|
redisUtils.set(key, permsSet); |
||||
|
} |
||||
|
|
||||
|
public Set<String> getUserPermissions(String userId, String app, String client){ |
||||
|
String key = RedisKeys.getUserPermissionsKey(userId, app, client); |
||||
|
return (Set<String>)redisUtils.get(key); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisKeys; |
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 资源管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovResourceRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete() { |
||||
|
String key = RedisKeys.getSysResourceKey(); |
||||
|
|
||||
|
redisUtils.delete(key); |
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 角色菜单关系 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovRoleMenuRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 角色管理 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovRoleRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 角色用户关系 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-03-18 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GovRoleUserRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue