初始化后台服务

develop
mengqiang 4 years ago
commit 1047eb13d0
  1. 6
      README.md
  2. 52
      sso-auth-center-service/.gitignore
  3. 3
      sso-auth-center-service/README.md
  4. 220
      sso-auth-center-service/pom.xml
  5. 84
      sso-auth-center-service/sso-auth-center-admin/pom.xml
  6. 25
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/AuthCenterAdminApplication.java
  7. 89
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/aspect/LogPrintlnAspect.java
  8. 35
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/CaptchaController.java
  9. 106
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/DeptController.java
  10. 57
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/LoginController.java
  11. 42
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/LoginLogController.java
  12. 105
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/MenuController.java
  13. 118
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/RoleController.java
  14. 143
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/SystemController.java
  15. 84
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/SystemMgmtController.java
  16. 196
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/UserController.java
  17. 75
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/UserOnlineController.java
  18. 83
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/admin/UserProfileController.java
  19. 65
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/controller/getway/OpenApiController.java
  20. 147
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/security/SecurityConfig.java
  21. 47
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/security/filter/TokenAuthenticationFilter.java
  22. 38
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/security/handle/AuthenticationEntryPointImpl.java
  23. 45
      sso-auth-center-service/sso-auth-center-admin/src/main/java/com/sso/security/handle/LogoutSuccessHandlerImpl.java
  24. 2
      sso-auth-center-service/sso-auth-center-admin/src/main/resources/application.properties
  25. 23
      sso-auth-center-service/sso-auth-center-admin/src/main/resources/banner.txt
  26. 104
      sso-auth-center-service/sso-auth-center-admin/src/main/resources/config/application-dev.properties
  27. 55
      sso-auth-center-service/sso-auth-center-admin/src/main/resources/logback-spring.xml
  28. 34
      sso-auth-center-service/sso-business/pom.xml
  29. 24
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/dto/RoleCountDTO.java
  30. 109
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/dto/SsoOnlineUserDTO.java
  31. 36
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/dto/SsoUserDeptDTO.java
  32. 91
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/dto/SsoUserMgmtDTO.java
  33. 36
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/dto/SsoUserRoleDTO.java
  34. 84
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoDept.java
  35. 34
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoDeptTreePath.java
  36. 84
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoLoginLog.java
  37. 119
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoMenu.java
  38. 87
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoOnlineUser.java
  39. 84
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoRole.java
  40. 50
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoRoleMenu.java
  41. 110
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoSystem.java
  42. 69
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoSystemManager.java
  43. 113
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoUser.java
  44. 49
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoUserDept.java
  45. 49
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoUserRole.java
  46. 69
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/entity/SsoUserSystem.java
  47. 113
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoDeptMapper.java
  48. 61
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoDeptTreePathMapper.java
  49. 91
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoLoginLogMapper.java
  50. 112
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoMenuMapper.java
  51. 111
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoOnlineUserMapper.java
  52. 112
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoRoleMapper.java
  53. 86
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoRoleMenuMapper.java
  54. 100
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoSystemManagerMapper.java
  55. 128
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoSystemMapper.java
  56. 85
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoUserDeptMapper.java
  57. 159
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoUserMapper.java
  58. 121
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoUserRoleMapper.java
  59. 95
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/mapper/SsoUserSystemMapper.java
  60. 89
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/query/LoginLogQuery.java
  61. 117
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/query/SsoDeptQuery.java
  62. 117
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/query/SsoMenuQuery.java
  63. 127
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/query/SsoRoleQuery.java
  64. 129
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/query/SystemMgmtPageQuery.java
  65. 87
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/query/UserOnlineQuery.java
  66. 129
      sso-auth-center-service/sso-business/src/main/java/com/sso/dao/query/UserPageQuery.java
  67. 30
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/SysCodeBO.java
  68. 29
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/dept/DeptDeleteBO.java
  69. 24
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/dept/DeptIdQueryBO.java
  70. 34
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/dept/DeptMgmtTreeBO.java
  71. 63
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/dept/DeptSaveBO.java
  72. 67
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/dept/DeptUpdateBO.java
  73. 45
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/getway/ApplyAuthBO.java
  74. 49
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/getway/GetWayReqBO.java
  75. 42
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/login/LoginBO.java
  76. 41
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/login/LoginLogListPageBO.java
  77. 30
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/menu/MenuDeleteBO.java
  78. 102
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/menu/MenuSaveBO.java
  79. 33
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/menu/MenuTreeBO.java
  80. 30
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/menu/MenuUpdateBO.java
  81. 26
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemDeleteBO.java
  82. 54
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemMgmtListPageBO.java
  83. 35
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemMgmtRemoveBO.java
  84. 41
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemMgmtSaveBO.java
  85. 33
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemMgmtStatusBO.java
  86. 62
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemSaveBO.java
  87. 26
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemSortBO.java
  88. 33
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemUpdateBO.java
  89. 40
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/platform/SystemUpdateSecretBO.java
  90. 28
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/role/RoleDeleteBO.java
  91. 30
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/role/RoleListOptionBO.java
  92. 40
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/role/RoleListPageBO.java
  93. 34
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/role/RoleRemoveUserBO.java
  94. 64
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/role/RoleSaveBO.java
  95. 28
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/role/RoleUpdateBO.java
  96. 90
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/user/UserAddBO.java
  97. 32
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/user/UserBatchDeleteBO.java
  98. 32
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/user/UserDeleteBO.java
  99. 31
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/user/UserDetailBO.java
  100. 60
      sso-auth-center-service/sso-business/src/main/java/com/sso/model/bo/user/UserListPageBO.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,6 @@
程序员小强-统一认证中心
sso-auth-center-service 统一认证中心服务端项目
sso-auth-center-vue 页面后台(vue)

@ -0,0 +1,52 @@
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar
# Eclipse
.classpath
.project
.settings/
# Intellij
.idea/
*.iml
*.iws
# Mac
.DS_Store
/D:/
/logs/

@ -0,0 +1,3 @@
# sso-auth-center
统一认证中心服务端

@ -0,0 +1,220 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sso</groupId>
<artifactId>sso-auth-center-service</artifactId>
<version>1.0.0</version>
<name>sso-auth-center-service</name>
<description>程序员小强-统一认证中心</description>
<modules>
<module>sso-auth-center</module>
<module>sso-framework</module>
<module>sso-business</module>
<module>sso-common</module>
</modules>
<packaging>pom</packaging>
<properties>
<sso-auth-center.version>1.0.0</sso-auth-center.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-boot.version>2.1.17.RELEASE</spring-boot.version>
<lombok.version>1.18.10</lombok.version>
<guava.version>30.0-jre</guava.version>
<bitwalker.version>1.21</bitwalker.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<mybatis.boot.version>1.3.2</mybatis.boot.version>
<druid.version>1.2.4</druid.version>
<kaptcha.version>2.3.2</kaptcha.version>
<fastjson.version>1.2.75</fastjson.version>
<jna.version>5.5.0</jna.version>
<commons.io.version>2.5</commons.io.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<poi.version>3.17</poi.version>
<jwt.version>0.9.1</jwt.version>
<jedis.version>3.2.0</jedis.version>
<hutool-all.version>5.4.3</hutool-all.version>
<hibernate-validator.version>6.0.20.Final</hibernate-validator.version>
<skipTests>true</skipTests>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- mybatis -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.boot.version}</version>
</dependency>
<!-- druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>${jedis.version}</version>
</dependency>
<!-- io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--文件上传 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<!-- fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- jwt 用于 token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- 验证码 -->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>${kaptcha.version}</version>
</dependency>
<!-- guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool-all.version}</version>
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
<!-- 核心配置模块 -->
<dependency>
<groupId>com.sso</groupId>
<artifactId>sso-framework</artifactId>
<version>${sso-auth-center.version}</version>
</dependency>
<!-- 业务模块-->
<dependency>
<groupId>com.sso</groupId>
<artifactId>sso-business</artifactId>
<version>${sso-auth-center.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.sso</groupId>
<artifactId>sso-common</artifactId>
<version>${sso-auth-center.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
</dependencies>
<build>
<finalName>sso-auth-center</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>repo</id>
<url>http://mvn.taofen8.com/artifactory/repo</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>taofen8.repo</id>
<name>taofen8 Repository</name>
<url>http://mvn.taofen8.com/artifactory/local</url>
</repository>
<snapshotRepository>
<id>taofen8.repo</id>
<name>taofen8 Repository</name>
<url>http://mvn.taofen8.com/artifactory/snapshot</url>
</snapshotRepository>
</distributionManagement>
</project>

@ -0,0 +1,84 @@
<?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>
<groupId>com.sso</groupId>
<artifactId>sso-auth-center-service</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>sso-auth-center</artifactId>
<description>
web服务入口
</description>
<repositories>
<repository>
<id>taofen8.repo</id>
<url>http://mvn.taofen8.com/artifactory/repo</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 业务模块 -->
<dependency>
<groupId>com.sso</groupId>
<artifactId>sso-business</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.1.RELEASE</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,25 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* 统一认证中心服务端 - 启动类
*
* @author 程序员小强
*/
@EnableTransactionManagement
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class})
public class AuthCenterAdminApplication {
public static void main(String[] args) {
SpringApplication.run(AuthCenterAdminApplication.class, args);
}
}

@ -0,0 +1,89 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.aspect;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
/**
* controller 日志打印
*
* @author 程序员小强
*/
@Slf4j
@Aspect
@Component
public class LogPrintlnAspect {
/**
* 配置织入点
*/
@Pointcut("execution(public * com.sso.controller.admin..*.*(..))")
public void allMethod() {
}
@Around("allMethod()")
public Object doAround(ProceedingJoinPoint call) throws Throwable {
MethodSignature signature = (MethodSignature) call.getSignature();
Method method = signature.getMethod();
String[] classNameArray = method.getDeclaringClass().getName().split("\\.");
String methodName = classNameArray[classNameArray.length - 1] + "." + method.getName();
String params = buildParamsDefault(call);
long start = System.currentTimeMillis();
Object result = null;
try {
MDC.put("logId", String.format("[%s]", RandomStringUtils.randomAlphanumeric(10)));
log.info("[ {} ] requestParam: {}", methodName, params);
result = call.proceed();
return result;
} finally {
log.info("[ {} ] runTime: {} ms", methodName, (System.currentTimeMillis() - start));
}
}
private String buildParamsDefault(ProceedingJoinPoint call) {
StringBuilder params = new StringBuilder(" [");
for (int i = 0; i < call.getArgs().length; i++) {
Object obj = call.getArgs()[i];
if (null != obj) {
if (obj instanceof HttpServletRequest) {
continue;
}
if (obj instanceof HttpServletResponse) {
continue;
}
String str = obj.toString();
if (obj.getClass() != String.class) {
str = ToStringBuilder.reflectionToString(obj, ToStringStyle.JSON_STYLE);
}
if (i != call.getArgs().length - 1) {
params.append(str).append(",");
} else {
params.append(str).append(" ]");
}
}
if (params.length() == 1) {
params.append("]");
}
}
return params.toString();
}
}

@ -0,0 +1,35 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.service.admin.CaptchaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
/**
* 验证码操作处理
*
* @author 程序员小强
*/
@Slf4j
@RestController
public class CaptchaController {
@Autowired
private CaptchaService captchaService;
/**
* 生成验证码
*/
@RequestMapping("/captchaImage")
public ResultModel<?> getCode(HttpServletResponse response) {
return ResultModel.success(captchaService.genCode(response));
}
}

@ -0,0 +1,106 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.SysCodeBO;
import com.sso.model.bo.dept.DeptDeleteBO;
import com.sso.model.bo.dept.DeptMgmtTreeBO;
import com.sso.model.bo.dept.DeptSaveBO;
import com.sso.model.bo.dept.DeptUpdateBO;
import com.sso.model.vo.dept.DeptDetailVO;
import com.sso.service.admin.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 部门管理接口
*
* @author 程序员小强
*/
@RestController
@RequestMapping("/dept")
public class DeptController {
@Autowired
private DeptService deptService;
/**
* 部门管理页-部门树
*
* @param treeBO
*/
@GetMapping("/listDeptMgmtTree")
@PreAuthorize("@ss.hasPermission('dept:listDeptMgmtTree')")
public ResultModel<?> listDeptMgmtTree(@Valid DeptMgmtTreeBO treeBO) {
return ResultModel.success(deptService.listDeptMgmtTree(treeBO));
}
/**
* 部门下拉-部门树
*
* @param sysCodeBO
*/
@RequestMapping("/listDeptOptionTree")
public ResultModel<?> listDeptOptionTree(@Valid SysCodeBO sysCodeBO) {
return ResultModel.success(deptService.listDeptOptionTree(sysCodeBO.getSysCode()));
}
/**
* 部门详情
*
* @param deptId
*/
@RequestMapping("/detail/{deptId}")
public ResultModel<DeptDetailVO> getDeptDetail(@PathVariable Long deptId) {
return ResultModel.success(deptService.getDeptDetail(deptId));
}
/**
* 添加部门
*
* @param saveBO
*/
@PostMapping("/add")
@PreAuthorize("@ss.hasPermission('dept:add')")
public ResultModel<?> addDept(@Valid @RequestBody DeptSaveBO saveBO) {
saveBO.setOperateBy(SecurityUtils.getOperateName());
deptService.addDept(saveBO);
return ResultModel.success();
}
/**
* 修改部门
*
* @param updateBO
*/
@PutMapping("/update")
@PreAuthorize("@ss.hasPermission('dept:update')")
public ResultModel<?> updateDept(@Valid @RequestBody DeptUpdateBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
deptService.updateDept(updateBO);
return ResultModel.success();
}
/**
* 删除部门
*
* @param deptId 部门ID
*/
@DeleteMapping("/delete/{deptId}")
@PreAuthorize("@ss.hasPermission('dept:delete')")
public ResultModel<?> deleteDept(@PathVariable Long deptId) {
DeptDeleteBO deptDeleteBO = new DeptDeleteBO();
deptDeleteBO.setDeptId(deptId);
deptDeleteBO.setOperateBy(SecurityUtils.getOperateName());
deptService.deleteDept(deptDeleteBO);
return ResultModel.success();
}
}

@ -0,0 +1,57 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.model.bo.login.LoginBO;
import com.sso.model.vo.login.LoginTokenVO;
import com.sso.model.vo.login.LoginUserInfoVO;
import com.sso.service.admin.login.SsoLoginService;
import com.sso.service.admin.login.SysPermissionService;
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.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
* 登录验证
*
* @author 程序员小强
*/
@RestController
public class LoginController {
@Autowired
private SsoLoginService ssoLoginService;
@Autowired
private SysPermissionService permissionService;
/**
* 登录方法
*
* @param loginBO 登录信息
* @return 结果
*/
@PostMapping("/login")
public ResultModel<LoginTokenVO> login(@Valid @RequestBody LoginBO loginBO) {
return ResultModel.success(ssoLoginService.login(loginBO));
}
/**
* 获取用户信息
*
* @return 用户信息
*/
@GetMapping("getUserInfo")
public ResultModel<?> getInfo() {
LoginUserInfoVO userInfo = permissionService.getLoginUserInfo();
return ResultModel.success(userInfo);
}
}

@ -0,0 +1,42 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultPageModel;
import com.sso.model.bo.login.LoginLogListPageBO;
import com.sso.model.vo.login.LoginLogPageVO;
import com.sso.service.admin.LoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
* 登录日志管理接口
*
* @author 程序员小强
*/
@RestController
@RequestMapping("/login/log")
public class LoginLogController {
@Autowired
private LoginLogService loginLogService;
/**
* 登录日志分页列表
*
* @param pageBO
*/
@PreAuthorize("@ss.hasPermission('login:log:listPage')")
@RequestMapping("/listPage")
public ResultPageModel<LoginLogPageVO> listPage(@Valid LoginLogListPageBO pageBO) {
return loginLogService.listPageUser(pageBO);
}
}

@ -0,0 +1,105 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.menu.MenuDeleteBO;
import com.sso.model.bo.menu.MenuSaveBO;
import com.sso.model.bo.menu.MenuTreeBO;
import com.sso.model.bo.menu.MenuUpdateBO;
import com.sso.model.vo.menu.MenuDetailVO;
import com.sso.service.admin.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 菜单管理接口
*
* @author 程序员小强
*/
@RestController
@RequestMapping("/menu")
public class MenuController {
@Autowired
private MenuService menuService;
/**
* 菜单管理页-菜单树
*
* @param treeBO
*/
@GetMapping("/listMenuTree")
@PreAuthorize("@ss.hasPermission('menu:listMenuTree')")
public ResultModel<?> listDeptMgmtTree(@Valid MenuTreeBO treeBO) {
return ResultModel.success(menuService.listMenuTree(treeBO));
}
/**
* 菜单管理页-菜单树下拉列表
*
* @param treeBO
*/
@GetMapping("/listMenuOptionTree")
public ResultModel<?> listMenuOptionTree(@Valid MenuTreeBO treeBO) {
return ResultModel.success(menuService.listMenuOptionTree(treeBO));
}
/**
* 菜单详情
*
* @param menuId
*/
@RequestMapping("/detail/{menuId}")
public ResultModel<MenuDetailVO> getMenuDetail(@PathVariable Long menuId) {
return ResultModel.success(menuService.getMenuDetail(menuId));
}
/**
* 添加菜单
*
* @param saveBO
*/
@PostMapping("/add")
@PreAuthorize("@ss.hasPermission('menu:add')")
public ResultModel<?> addDept(@Valid @RequestBody MenuSaveBO saveBO) {
saveBO.setOperateBy(SecurityUtils.getOperateName());
menuService.addMenu(saveBO);
return ResultModel.success();
}
/**
* 修改菜单
*
* @param updateBO
*/
@PutMapping("/update")
@PreAuthorize("@ss.hasPermission('menu:update')")
public ResultModel<?> updateMenu(@Valid @RequestBody MenuUpdateBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
menuService.updateMenu(updateBO);
return ResultModel.success();
}
/**
* 删除菜单
*
* @param menuId 菜单ID
*/
@DeleteMapping("/delete/{menuId}")
@PreAuthorize("@ss.hasPermission('menu:delete')")
public ResultModel<?> deleteMenu(@PathVariable Long menuId) {
MenuDeleteBO deptDeleteBO = new MenuDeleteBO();
deptDeleteBO.setMenuId(menuId);
deptDeleteBO.setOperateBy(SecurityUtils.getOperateName());
menuService.deleteMenu(deptDeleteBO);
return ResultModel.success();
}
}

@ -0,0 +1,118 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.common.model.result.ResultPageModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.role.*;
import com.sso.model.vo.role.RoleDetailVO;
import com.sso.model.vo.role.RolePageVO;
import com.sso.service.admin.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 角色接口
*
* @author 程序员小强
*/
@RestController
@RequestMapping("/role")
public class RoleController {
@Autowired
private RoleService roleService;
/**
* 角色分页列表
*
* @param pageBO
*/
@RequestMapping("/listPage")
@PreAuthorize("@ss.hasPermission('role:listPage')")
public ResultPageModel<RolePageVO> listPage(@Valid RoleListPageBO pageBO) {
return roleService.listPageRole(pageBO);
}
/**
* 角色-下拉选项列表
*
* @param optionBO
*/
@RequestMapping("/listOption")
public ResultModel<?> listRoleOption(@Valid RoleListOptionBO optionBO) {
return ResultModel.success(roleService.listRoleOption(optionBO));
}
/**
* 角色详情
*
* @param roleId
*/
@RequestMapping("/detail/{roleId}")
public ResultModel<RoleDetailVO> getDeptDetail(@PathVariable Long roleId) {
return ResultModel.success(roleService.getDeptDetail(roleId));
}
/**
* 添加角色
*
* @param saveBO
*/
@PostMapping("/add")
@PreAuthorize("@ss.hasPermission('role:add')")
public ResultModel<?> addRole(@Valid @RequestBody RoleSaveBO saveBO) {
saveBO.setOperateBy(SecurityUtils.getOperateName());
roleService.addRole(saveBO);
return ResultModel.success();
}
/**
* 修改角色
*
* @param updateBO
*/
@PutMapping("/update")
@PreAuthorize("@ss.hasPermission('role:update')")
public ResultModel<?> updateRole(@Valid @RequestBody RoleUpdateBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
roleService.updateRole(updateBO);
return ResultModel.success();
}
/**
* 删除角色
*
* @param roleId 角色ID
*/
@DeleteMapping("/delete/{roleId}")
@PreAuthorize("@ss.hasPermission('role:delete')")
public ResultModel<?> deleteDept(@PathVariable Long roleId) {
RoleDeleteBO deptDeleteBO = new RoleDeleteBO();
deptDeleteBO.setRoleId(roleId);
deptDeleteBO.setOperateBy(SecurityUtils.getOperateName());
roleService.deleteRole(deptDeleteBO);
return ResultModel.success();
}
/**
* 移除角色用户绑定关系
*
* @param removeUserBO
*/
@PutMapping("/removeUser")
@PreAuthorize("@ss.hasPermission('role:removeUser')")
public ResultModel<?> removeUserRole(@Valid @RequestBody RoleRemoveUserBO removeUserBO) {
removeUserBO.setOperateBy(SecurityUtils.getOperateName());
roleService.removeUserRole(removeUserBO);
return ResultModel.success();
}
}

@ -0,0 +1,143 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.platform.*;
import com.sso.model.vo.platform.SystemDetailVO;
import com.sso.service.admin.FileUploadService;
import com.sso.service.admin.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* 目标系统平台相关接口
*
* @author 程序员小强
*/
@RestController
@RequestMapping("/system")
public class SystemController {
@Autowired
private SystemService systemService;
@Resource
private FileUploadService fileUploadService;
/**
* 我的平台列表
*
* @return 系统列表
*/
@GetMapping("/myList")
public ResultModel<?> myList() {
return ResultModel.success(systemService.listMySystem());
}
/**
* 我的平台-排序
*
* @return 系统列表
*/
@PostMapping("/sortMy")
public ResultModel<?> sortMySystem(@Valid @RequestBody SystemSortBO sortBO) {
systemService.sortMySystem(sortBO);
return ResultModel.success();
}
/**
* 系统平台详情
*
* @param sysCode
* @return 系统平台详情
*/
@GetMapping("/getDetailBySysCode")
@PreAuthorize("@ss.hasPermission('system:getDetailBySysCode')")
public ResultModel<SystemDetailVO> getDetailBySysCode(String sysCode) {
return ResultModel.success(systemService.getDetailBySysCode(sysCode));
}
/**
* 平台管理-列表
*
* @return 平台列表
*/
@GetMapping("/mgmtList")
@PreAuthorize("@ss.hasPermission('system:mgmtList')")
public ResultModel<?> list() {
return ResultModel.success(systemService.listMyMgmtSystem());
}
/**
* 新增-目标系统
*
* @param saveBO
*/
@PostMapping("/add")
@PreAuthorize("@ss.hasPermission('system:add')")
public ResultModel<?> addSystem(@Valid @RequestBody SystemSaveBO saveBO) {
saveBO.setOperateBy(SecurityUtils.getOperateName());
systemService.addSystem(saveBO);
return ResultModel.success();
}
/**
* 修改-目标系统
*
* @param updateBO
*/
@PutMapping("/update")
@PreAuthorize("@ss.hasPermission('system:update')")
public ResultModel<?> updateSystem(@Valid @RequestBody SystemUpdateBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
systemService.updateSystem(updateBO);
return ResultModel.success();
}
/**
* 添加或修改-秘钥
*
* @param updateBO
*/
@PutMapping("/updateSecret")
@PreAuthorize("@ss.hasPermission('system:updateSecret')")
public ResultModel<?> updateSecret(@Valid @RequestBody SystemUpdateSecretBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
systemService.updateSystemSecret(updateBO);
return ResultModel.success();
}
/**
* 修改系统图标
*/
@PostMapping("/uploadIcon/{sysId}")
public ResultModel<?> uploadIcon(@PathVariable("sysId") Long sysId, @RequestParam("iconFile") MultipartFile iconFile) {
String operateName = SecurityUtils.getOperateName();
return ResultModel.success(fileUploadService.uploadSystemIcon(sysId, operateName, iconFile));
}
/**
* 删除-目标系统
*
* @param sysId 系统ID
*/
@DeleteMapping("/delete/{sysId}")
@PreAuthorize("@ss.hasPermission('system:delete')")
public ResultModel<?> deleteSystem(@PathVariable Long sysId) {
SystemDeleteBO deptDeleteBO = new SystemDeleteBO();
deptDeleteBO.setSysId(sysId);
deptDeleteBO.setOperateBy(SecurityUtils.getOperateName());
systemService.deleteSystem(deptDeleteBO);
return ResultModel.success();
}
}

@ -0,0 +1,84 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.common.model.result.ResultPageModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.platform.SystemMgmtListPageBO;
import com.sso.model.bo.platform.SystemMgmtRemoveBO;
import com.sso.model.bo.platform.SystemMgmtSaveBO;
import com.sso.model.bo.platform.SystemMgmtStatusBO;
import com.sso.model.vo.platform.SystemMgmtPageVO;
import com.sso.service.admin.SystemMgmtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 系统管理员相关操作
*
* @author 程序员小强
*/
@RestController
@RequestMapping("/systemMgmt")
public class SystemMgmtController {
@Autowired
private SystemMgmtService systemMgmtService;
/**
* 系统管理员-用户分页列表
*
* @param pageBO
* @return 用户
*/
@RequestMapping("/listPage")
@PreAuthorize("@ss.hasPermission('systemMgmt:updateSystemMgmt')")
public ResultPageModel<SystemMgmtPageVO> listPage(@Valid SystemMgmtListPageBO pageBO) {
return systemMgmtService.listPageSysMgmtUser(pageBO);
}
/**
* 新增-管理员权限
*
* @param addBO
*/
@PostMapping("/add")
@PreAuthorize("@ss.hasPermission('systemMgmt:updateSystemMgmt')")
public ResultModel<?> addSystemMgmt(@Valid @RequestBody SystemMgmtSaveBO addBO) {
addBO.setOperateBy(SecurityUtils.getOperateName());
systemMgmtService.addSystemMgmt(addBO);
return ResultModel.success();
}
/**
* 修改-管理员权限账号状态
*
* @param addBO
*/
@PutMapping("/updateStatus")
@PreAuthorize("@ss.hasPermission('systemMgmt:updateSystemMgmt')")
public ResultModel<?> updateStatus(@Valid @RequestBody SystemMgmtStatusBO addBO) {
addBO.setOperateBy(SecurityUtils.getOperateName());
systemMgmtService.updateStatus(addBO);
return ResultModel.success();
}
/**
* 移除-用户管理员权限
*
* @param removeBO
*/
@RequestMapping("/remove")
@PreAuthorize("@ss.hasPermission('systemMgmt:updateSystemMgmt')")
public ResultModel<?> removeUserSystemMgmt(@Valid @RequestBody SystemMgmtRemoveBO removeBO) {
removeBO.setOperateBy(SecurityUtils.getOperateName());
systemMgmtService.removeUserSystemMgmt(removeBO);
return ResultModel.success();
}
}

@ -0,0 +1,196 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.login.LoginUserVO;
import com.sso.common.model.result.ResultModel;
import com.sso.common.model.result.ResultPageModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.user.*;
import com.sso.model.vo.user.UserDetailVO;
import com.sso.model.vo.user.UserOptionVO;
import com.sso.model.vo.user.UserPageVO;
import com.sso.model.vo.user.UserProfileVO;
import com.sso.service.admin.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* 用户管理接口
*
* @author 程序员小强
*/
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
/**
* 用户分页列表
*
* @param pageBO
*/
@PreAuthorize("@ss.hasPermission('user:listPage')")
@RequestMapping("/listPage")
public ResultPageModel<UserPageVO> listPage(@Valid UserListPageBO pageBO) {
return userService.listPageUser(pageBO);
}
/**
* 用户详情
*
* @param detailBO 用户ID
*/
@RequestMapping("/detail")
public ResultModel<UserDetailVO> getUserDetail(@Valid @RequestBody UserDetailBO detailBO) {
return ResultModel.success(userService.getUserDetail(detailBO));
}
/**
* 个人详情
*/
@RequestMapping("/profile")
public ResultModel<UserProfileVO> getUserProfile() {
LoginUserVO loginUser = SecurityUtils.getLoginUser();
return ResultModel.success(userService.getUserProfile(loginUser.getUserId()));
}
/**
* 根据手机号查询用户
*
* @param phone 手机号
*/
@RequestMapping("/getUserByPhone/{phone}")
public ResultModel<UserOptionVO> getUserByPhone(@PathVariable String phone) {
return ResultModel.success(userService.getUserByPhone(phone));
}
/**
* 根据用户名查询用户
*
* @param username 用户名
*/
@RequestMapping("/getUserByUserName/{username}")
public ResultModel<UserOptionVO> getByPhone(@PathVariable String username) {
return ResultModel.success(userService.getUserByUserName(username));
}
/**
* 根据-关键字搜索用户
*
* @param keywords 关键字模糊
*/
@RequestMapping("/listUserOption")
public ResultModel<?> listUserOption(@RequestParam(required = false) String keywords) {
return ResultModel.success(userService.listUserOption(keywords));
}
/**
* 添加用户
*
* @param addBO
*/
@PostMapping("/add")
@PreAuthorize("@ss.hasPermission('user:add')")
public ResultModel<?> addUser(@Valid @RequestBody UserAddBO addBO) {
addBO.setOperateBy(SecurityUtils.getOperateName());
userService.addUser(addBO);
return ResultModel.success();
}
/**
* 添加用户系统关系
*
* @param addBO
*/
@PostMapping("/addUserPlatformRelation")
public ResultModel<?> addUserPlatformRelation(@Valid @RequestBody UserPlatformAddBO addBO) {
addBO.setOperateBy(SecurityUtils.getOperateName());
userService.addUserPlatformRelation(addBO);
return ResultModel.success();
}
/**
* 修改用户
*
* @param updateBO
*/
@PutMapping("/update")
@PreAuthorize("@ss.hasPermission('user:update')")
public ResultModel<?> updateUser(@Valid @RequestBody UserUpdateBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
userService.updateUser(updateBO);
return ResultModel.success();
}
/**
* 移除用户与系统关系
*
* @param removeBO
*/
@RequestMapping("/removeUserSystem")
@PreAuthorize("@ss.hasPermission('user:removeUserSystem')")
public ResultModel<?> removeUserSystem(@Valid @RequestBody UserSystemRemoveBO removeBO) {
removeBO.setOperateBy(SecurityUtils.getOperateName());
userService.removeUserSystem(removeBO);
return ResultModel.success();
}
/**
* 修改个人信息
*
* @param updateBO
*/
@PutMapping("/updateProfile")
public ResultModel<?> updateProfile(@Valid @RequestBody UserUpdateProfileBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
userService.updateProfile(updateBO);
return ResultModel.success();
}
/**
* 修改个人密码
*
* @param updateBO
*/
@PutMapping("/updatePwd")
public ResultModel<?> updatePwd(@Valid @RequestBody UserUpdatePwdBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
userService.updatePwd(updateBO);
return ResultModel.success();
}
/**
* 重置密码
*
* @param restPwdBO
*/
@PutMapping("/resetPwd")
@PreAuthorize("@ss.hasPermission('user:resetPwd')")
public ResultModel<?> resetPwd(@Valid @RequestBody UserRestPwdBO restPwdBO) {
restPwdBO.setOperateBy(SecurityUtils.getOperateName());
userService.resetPwd(restPwdBO);
return ResultModel.success();
}
/**
* 删除用户
*
* @param deleteBO
*/
@RequestMapping("/delete")
@PreAuthorize("@ss.hasPermission('user:delete')")
public ResultModel<?> deleteUser(@Valid @RequestBody UserDeleteBO deleteBO) {
deleteBO.setOperateBy(SecurityUtils.getOperateName());
userService.deleteUser(deleteBO);
return ResultModel.success();
}
}

@ -0,0 +1,75 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.result.ResultModel;
import com.sso.common.model.result.ResultPageModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.user.UserOnlineListPageBO;
import com.sso.model.vo.user.UserOnlinePageVO;
import com.sso.model.vo.user.UserOnlineSysVO;
import com.sso.service.admin.UserOnlineService;
import com.sso.service.base.SsoTokenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* 在线用户管理接口
*
* @author 程序员小强
*/
@Slf4j
@RestController
@RequestMapping("/user/online")
public class UserOnlineController {
@Resource
private SsoTokenService ssoTokenService;
@Resource
private UserOnlineService userOnlineService;
/**
* 在线用户分页列表
*
* @param pageBO
*/
@PreAuthorize("@ss.hasPermission('user:online:listPage')")
@RequestMapping("/listPage")
public ResultPageModel<UserOnlinePageVO> listPage(@Valid UserOnlineListPageBO pageBO) {
return userOnlineService.listPageUser(pageBO);
}
/**
* 查看用户已登录的子系统
*
* @param userId 用户ID
*/
@PreAuthorize("@ss.hasPermission('user:online:listOnlineSys')")
@RequestMapping("/listOnlineSys/{userId}")
public ResultPageModel<UserOnlineSysVO> listOnlineSys(@PathVariable Long userId) {
return ResultPageModel.success(userOnlineService.listOnlineSys(userId));
}
/**
* 强退认证中心+所有已登录子系统
*
* @param userId 用户ID
*/
@PreAuthorize("@ss.hasPermission('user:online:retreatUser')")
@RequestMapping("/retreatUser/{userId}")
public ResultModel<UserOnlineSysVO> retreatUser(@PathVariable Long userId) {
ssoTokenService.logoOutUser(userId);
log.info("[ 强退用户 ] >> userId:{}, operateBy:{}", userId, SecurityUtils.getOperateName());
return ResultModel.success();
}
}

@ -0,0 +1,83 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.admin;
import com.sso.common.model.login.LoginUserVO;
import com.sso.common.model.result.ResultModel;
import com.sso.common.utils.SecurityUtils;
import com.sso.model.bo.user.UserUpdateProfileBO;
import com.sso.model.bo.user.UserUpdatePwdBO;
import com.sso.model.vo.user.UserProfileVO;
import com.sso.service.admin.FileUploadService;
import com.sso.service.admin.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
* 用户-个人详情接口
*
* @author 程序员小强
*/
@Slf4j
@RestController
@RequestMapping("/user/profile")
public class UserProfileController {
@Autowired
private UserService userService;
@Resource
private FileUploadService fileUploadService;
/**
* 个人详情
*/
@RequestMapping("/detail")
public ResultModel<UserProfileVO> getUserProfile() {
LoginUserVO loginUser = SecurityUtils.getLoginUser();
return ResultModel.success(userService.getUserProfile(loginUser.getUserId()));
}
/**
* 修改个人信息
*
* @param updateBO
*/
@PutMapping("/update")
public ResultModel<?> updateProfile(@Valid @RequestBody UserUpdateProfileBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
userService.updateProfile(updateBO);
return ResultModel.success();
}
/**
* 修改个人密码
*
* @param updateBO
*/
@PutMapping("/updatePwd")
public ResultModel<?> updatePwd(@Valid @RequestBody UserUpdatePwdBO updateBO) {
updateBO.setOperateBy(SecurityUtils.getOperateName());
userService.updatePwd(updateBO);
return ResultModel.success();
}
/**
* 个人-头像上传
*/
@PostMapping("/avatar")
public ResultModel<?> avatar(@RequestParam("avatarFile") MultipartFile avatarFile) {
LoginUserVO loginUser = SecurityUtils.getLoginUser();
String operateName = SecurityUtils.getOperateName();
return ResultModel.success(fileUploadService.uploadUserAvatar(loginUser.getUserId(), operateName, avatarFile));
}
}

@ -0,0 +1,65 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.controller.getway;
import com.alibaba.fastjson.JSON;
import com.sso.common.model.result.ResultModel;
import com.sso.common.utils.SystemClock;
import com.sso.model.bo.getway.GetWayReqBO;
import com.sso.service.getway.ApiClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.util.WebUtils;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Map;
/**
* 统一网关
*/
@Slf4j
@RestController
@RequestMapping("/open")
public class OpenApiController {
@Autowired
private ApiClient apiClient;
/**
* 统一网关入口
*
* @author 程序员小强
*/
@PostMapping("/gateway")
public ResultModel<?> gateway(@Valid GetWayReqBO reqBO,
HttpServletRequest request) throws Throwable {
Map<String, Object> mapParams = WebUtils.getParametersStartingWith(request, "");
//日志ID (请求的唯一标识+5位随机数)
MDC.put("logId", String.format("[%s-%s]", reqBO.getApiRequestId(), RandomStringUtils.randomAlphanumeric(5)));
log.info("[ 统一认证开放接口 start ] >> method={} mapParams = {}", reqBO.getMethod(), mapParams);
long start = SystemClock.millisClock().now();
//校验请求时间戳间隔
apiClient.checkTimestamp(reqBO, mapParams);
//验签
apiClient.checkSign(reqBO, mapParams);
//请求接口
ResultModel<?> result = apiClient.invoke(reqBO);
log.info("[ 统一认证开放接口 end ] >> method={},result = {}, times = {} ms", reqBO.getMethod(), JSON.toJSONString(result), (SystemClock.millisClock().now() - start));
return result;
}
}

@ -0,0 +1,147 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.security;
import com.sso.security.filter.TokenAuthenticationFilter;
import com.sso.security.handle.AuthenticationEntryPointImpl;
import com.sso.security.handle.LogoutSuccessHandlerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.web.filter.CorsFilter;
import javax.annotation.Resource;
/**
* spring security配置
*
* @author 程序员小强
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
/**
* 自定义用户认证逻辑
*/
@Resource
private UserDetailsService userDetailsService;
/**
* 认证失败处理类
*/
@Autowired
private AuthenticationEntryPointImpl unauthorizedHandler;
/**
* 退出处理类
*/
@Autowired
private LogoutSuccessHandlerImpl logoutSuccessHandler;
/**
* token认证过滤器
*/
@Autowired
private TokenAuthenticationFilter tokenAuthenticationFilter;
/**
* 跨域过滤器
*/
@Autowired
private CorsFilter corsFilter;
/**
* 解决 无法直接注入 AuthenticationManager
*
* @return
* @throws Exception
*/
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
/**
* Security 配置
* 规则如下
* anyRequest -> 匹配所有请求路径
* access -> SpringEl表达式结果为true时可以访问
* anonymous -> 匿名可以访问
* denyAll -> 用户不能访问
* fullyAuthenticated -> 用户完全认证可以访问非remember-me下自动登录
* hasAnyAuthority -> 如果有参数参数表示权限则其中任何一个权限可以访问
* hasAnyRole -> 如果有参数参数表示角色则其中任何一个角色可以访问
* hasAuthority -> 如果有参数参数表示权限则其权限可以访问
* hasIpAddress -> 如果有参数参数表示IP地址如果用户IP和参数匹配则可以访问
* hasRole -> 如果有参数参数表示角色则其角色可以访问
* permitAll -> 用户可以任意访问
* rememberMe -> 允许通过remember-me登录的用户访问
* authenticated -> 用户登录后可访问
*/
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity
// CSRF禁用,因为不使用session
.csrf().disable()
// 认证失败处理类
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
// 基于token,所以不需要session
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求
.authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问
.antMatchers("/**/login", "/**/captchaImage").anonymous()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js",
"/**/*.ico"
).permitAll()
.antMatchers("/profile/**").anonymous()
.antMatchers("/**/webjars/**").anonymous()
.antMatchers("/**/api-docs").anonymous()
.antMatchers("/**/druid/**").anonymous()
//开放接口不拦截-内部有验签
.antMatchers("/open/gateway").anonymous()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()
.headers().frameOptions().disable();
// 退出登录处理器
httpSecurity.logout().logoutUrl("/**/logout").logoutSuccessHandler(logoutSuccessHandler);
// 添加账号校验 filter
httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
// 添加CORS filter
httpSecurity.addFilterBefore(corsFilter, TokenAuthenticationFilter.class);
// 登出
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
}
/**
* 强散列哈希加密实现
*/
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
/**
* 身份-认证接口
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
}
}

@ -0,0 +1,47 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.security.filter;
import com.sso.common.model.login.LoginResultVO;
import com.sso.common.utils.ObjectUtils;
import com.sso.common.utils.SecurityUtils;
import com.sso.service.base.SsoTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* token过滤器 验证token有效性
*
* @author 程序员小强
*/
@Component
public class TokenAuthenticationFilter extends OncePerRequestFilter {
@Autowired
private SsoTokenService ssoTokenService;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException {
LoginResultVO loginResultVO = ssoTokenService.getLoginUser(request);
if (ObjectUtils.isNotNull(loginResultVO) && ObjectUtils.isNull(SecurityUtils.getAuthentication())) {
ssoTokenService.renewTokenByAdminWeb(loginResultVO);
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginResultVO, null, loginResultVO.getAuthorities());
authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authenticationToken);
}
chain.doFilter(request, response);
}
}

@ -0,0 +1,38 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.security.handle;
import com.alibaba.fastjson.JSON;
import com.sso.common.enums.exception.SysResStatusEnum;
import com.sso.common.model.result.ResultModel;
import com.sso.common.utils.ServletUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
/**
* 认证失败处理类 返回未授权
*
* @author 程序员小强
*/
@Slf4j
@Component
public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable {
private static final long serialVersionUID = -6355792444057575911L;
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
int code = SysResStatusEnum.UNAUTHORIZED.getCode();
String msg = String.format("请求访问:%s,认证失败,无法访问系统资源", request.getRequestURI());
log.error("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
ServletUtils.renderString(response, JSON.toJSONString(ResultModel.error(code, msg)));
}
}

@ -0,0 +1,45 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.security.handle;
import com.alibaba.fastjson.JSON;
import com.sso.common.enums.exception.SysResStatusEnum;
import com.sso.common.model.login.LoginResultVO;
import com.sso.common.model.result.ResultModel;
import com.sso.common.utils.ServletUtils;
import com.sso.service.base.SsoTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 自定义退出处理类 返回成功
*
* @author 程序员小强
*/
@Configuration
public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler {
@Autowired
private SsoTokenService ssoTokenService;
/**
* 用户退出处理
*/
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
LoginResultVO loginResultVO = ssoTokenService.getLoginUser(request);
if (!ObjectUtils.isEmpty(loginResultVO)) {
//用户退出处理
ssoTokenService.logoOutUser(loginResultVO);
}
ServletUtils.renderString(response, JSON.toJSONString(ResultModel.error(SysResStatusEnum.SUCCESS.getCode(), "退出成功")));
}
}

@ -0,0 +1,23 @@
${AnsiColor.BRIGHT_RED}
----------------------------------------
_______ _______ _______
( ____ \( ____ \( ___ )
| ( \/| ( \/| ( ) |
| (_____ | (_____ | | | |
(_____ )(_____ )| | | |
) | ) || | | |
/\____) |/\____) || (___) |
\_______)\_______)(_______)
----------------------------------------
${AnsiColor.GREEN}
Application Env: ${spring.profiles.active}
Application Port: ${server.port}
Root Log Level: ${logging.level.root}
Project Log Level: ${logging.level.com.sso}
Spring Boot Version: ${spring-boot.version}
${AnsiColor.BRIGHT_RED}
温馨提示:
编码千万行,注释第一行。
代码不规范,复盘两行泪。
${AnsiColor.GREEN}

@ -0,0 +1,104 @@
server.port=9901
#日志配置
logging.level.root=info
logging.level.com.sso=info
logging.level.org.springframework=warn
#日志文件路径
log.root.path=${user.home}/logs/sso-auth-center
# jackson时间格式化(解决时区问题)
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
#redis 基础配置
# Redis数据库索引(默认为0)
spring.redis.database=0
# Redis服务器地址
spring.redis.host=localhost
# Redis服务器连接密码(默认为空)
spring.redis.password=123456
# Redis服务器连接端口
spring.redis.port=6379
# 连接超时时间(毫秒)
spring.redis.timeout=0
#redis 连接池配置
#池中最大链接数
spring.redis.pool-config.max-total=256
# 连接池中的最大空闲连接
spring.redis.pool-config.max-idle=128
# 连接池中的最小空闲连接
spring.redis.pool-config.min-idle=8
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.pool-config.max-wait-millis=1000
# 调用者获取链接时,是否检测当前链接有效性
spring.redis.pool-config.test-on-borrow=false
# 向链接池中归还链接时,是否检测链接有效性
spring.redis.pool-config.test-on-return=false
# 调用者获取链接时,是否检测空闲超时, 如果超时,则会被移除-
spring.redis.pool-config.test-while-idle=true
# 空闲链接检测线程一次运行检测多少条链接
spring.redis.pool-config.num-tests-per-eviction-run=8
#空闲链接检测线程检测周期。如果为负值,表示不运行检测线程。(单位:毫秒,默认为-1)
spring.redis.pool-config.time-between-eviction-runs-millis=60000
#配置一个连接在池中最小生存的时间,单位是毫秒
spring.redis.pool-config.min-evictable-idle-time-millis=300000
# 管理后台系统模块数据源
spring.datasource.admin.url=jdbc:mysql://localhost:3306/my-sso?useUnicode=true&characterEncoding=utf8&autoReconnect=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true
spring.datasource.admin.username=root
spring.datasource.admin.password=123456
spring.datasource.admin.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.admin.initial-size=5
spring.datasource.admin.max-active=20
spring.datasource.admin.max-wait=60000
spring.datasource.admin.min-evictable-idle-time-millis=30000
spring.datasource.admin.min-idle=5
spring.datasource.admin.test-on-borrow=false
spring.datasource.admin.test-on-return=false
spring.datasource.admin.test-while-idle=true
spring.datasource.admin.time-between-eviction-runs-millis=60000
spring.datasource.admin.validation-query=SELECT 1 FROM DUAL
# 验证码类型: math-数组计算;char-字符验证
sys.config.captchaType=math
# token配置
# 令牌自定义标识
sys.config.tokenHeader=Authorization
# 令牌密钥
sys.config.tokenSecret=abcdefghijklmnopqrstuvwxyz
#认证中心系统编码
sys.config.authSsoSysCode=auth-test
# 超级管理员用户(用户ID|用户名)
sys.config.supperAdminUser=1000|admin
# 令牌有效期(默认180分钟)
sys.config.tokenExpireTime=180
#统一认证中心登录地址
sys.config.ssoLoginUrl=http://www.myauth.com:9528/login
#文件上传目录
# 文件路径 示例( Windows配置D:/xqiang/uploadPath,Linux配置 /home/xqiang/uploadPath)
sys.config.fileProfile=/Users/mengqiang/files/upload
# 开发环境配置
# 应用的访问路径
server.servlet.context-path=/api/
# tomcat的URI编码
server.tomcat.uri-encoding=UTF-8
# tomcat最大线程数,默认为200
server.tomcat.max-threads=800
# Tomcat启动初始化的线程数,默认值25
server.tomcat.min-spare-threads=30
# Spring配置
# 文件上传
# 单个文件大小
spring.servlet.multipart.max-file-size=10MB
# 设置总上传的文件大小
spring.servlet.multipart.max-request-size=20MB

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<springProperty scope="context" name="log.path" source="log.root.path"/>
<springProperty scope="context" name="log.level" source="logging.level.com.sso"/>
<!-- 日志输出格式 -->
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度,%msg:日志消息,%n是换行符-->
<property name="log.pattern"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %mdc{logId} [%thread] %logger{0} [%method:%line] - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="system_log" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sso-auth-center.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sso-auth-center.log.%d{yyyy-MM-dd}</fileNamePattern>
<!-- 日志最大的历史 40天 -->
<maxHistory>40</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>20MB</MaxFileSize>
</triggeringPolicy>
</appender>
<!--
&lt;!&ndash; 系统模块日志级别控制 trace<debug<info<warn<error &ndash;&gt;
<logger name="com.fast.admin" level="info"/>
&lt;!&ndash; Spring日志级别控制 &ndash;&gt;
<logger name="org.springframework" level="warn"/>
-->
<root level="${log.level}">
<appender-ref ref="console"/>
</root>
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn"/>
<!--系统操作日志-->
<root level="${log.level}">
<appender-ref ref="system_log"/>
</root>
</configuration>

@ -0,0 +1,34 @@
<?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>
<groupId>com.sso</groupId>
<artifactId>sso-auth-center-service</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sso-business</artifactId>
<description>
system系统模块
</description>
<dependencies>
<!-- 通用模块 -->
<dependency>
<groupId>com.sso</groupId>
<artifactId>sso-common</artifactId>
</dependency>
<!-- 核心配置模块 -->
<dependency>
<groupId>com.sso</groupId>
<artifactId>sso-framework</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,24 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 角色统计
*
* @author 程序员小强
*/
@Data
public class RoleCountDTO implements Serializable {
private static final long serialVersionUID = -9112752803214125220L;
private Long roleId;
private Integer count;
}

@ -0,0 +1,109 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 登录日志实体类
*
* @author 程序员小强
* @date 2021-01-23 10:45:22
*/
@Data
public class SsoOnlineUserDTO implements Serializable {
private static final long serialVersionUID = -8922037654548424632L;
/**
* 用户ID
*/
private Long userId;
/**
* 用户登录名
*/
private String username;
/**
* 手机号码
*/
private String phone;
/**
* 密码
*/
private String password;
/**
* 用户昵称
*/
private String nickName;
/**
* 真实姓名
*/
private String realName;
/**
* 请求标识
*/
private String requestId;
/**
* 来源IP
*/
private String sourceIp;
/**
* 来源地址
*/
private String sourceAddress;
/**
* 浏览器
*/
private String browserName;
/**
* 操作系统
*/
private String operateSystem;
/**
* 登录状态 0-成功;1-失败
*/
private Integer status;
/**
* 登录时间戳
*/
private Long loginTime;
/**
* 主动退出时间戳
*/
private Long loginOutTime;
/**
* 失效时间戳
*/
private Long expireTime;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,36 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 部门实体类
*
* @author 程序员小强
*/
@Data
public class SsoUserDeptDTO implements Serializable {
private static final long serialVersionUID = -2778006438843424841L;
/**
* 用户ID
*/
private Long userId;
/**
* 部门ID
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
}

@ -0,0 +1,91 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户-系统管理
*
* @author 程序员小强
* @date 2021-01-02 17:20:41
*/
@Data
public class SsoUserMgmtDTO implements Serializable {
private static final long serialVersionUID = -7065547317808718215L;
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 用户登录名
*/
private String username;
/**
* 用户昵称
*/
private String nickName;
/**
* 真实姓名
*/
private String realName;
/**
* 用户性别 0-;1-;2-未知
*/
private Integer sex;
/**
* 手机号码
*/
private String phone;
/**
* 邮箱
*/
private String email;
/**
* 用户状态 0-正常;1-停用
*/
private Integer userStatus;
/**
* 关系状态 0-正常;1-停用
*/
private Integer relationStatus;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,36 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 用户角色
*
* @author 程序员小强
* @date 2020-12-27 18:07:20
*/
@Data
public class SsoUserRoleDTO implements Serializable {
private static final long serialVersionUID = 219537171519448483L;
/**
* 用户ID
*/
private Long userId;
/**
* 角色id多个逗号分隔
*/
private String roleIds;
/**
* 角色名称多个逗号分隔
*/
private String roleNames;
}

@ -0,0 +1,84 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 部门实体类
*
* @author 程序员小强
* @date 2020-12-27 18:07:20
*/
@Data
public class SsoDept implements Serializable {
private static final long serialVersionUID = 4501341919143820458L;
/**
* 部门ID
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 系统编码
*/
private String sysCode;
/**
* 父部门ID
*/
private Long deptParentId;
/**
* 顺序
*/
private Integer sortNum;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
/**
* 备注
*/
private String remarks;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,34 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
/**
* 部门祖先/后代关系实体类
*
* @author 程序员小强
* @date 2020-12-27 18:07:20
*/
@Data
public class SsoDeptTreePath implements Serializable {
private static final long serialVersionUID = -8794488706755626248L;
/**
* 祖先
*/
private Long ancestor;
/**
* 后代
*/
private Long descendant;
}

@ -0,0 +1,84 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 登录日志实体类
*
* @author 程序员小强
* @date 2021-01-23 10:45:22
*/
@Data
public class SsoLoginLog implements Serializable {
private static final long serialVersionUID = -7814417622883518147L;
/**
* ID
*/
private Long id;
/**
* 请求标识
*/
private String requestId;
/**
* 用户登录名
*/
private String username;
/**
* 来源IP
*/
private String sourceIp;
/**
* 来源地址
*/
private String sourceAddress;
/**
* 浏览器
*/
private String browserName;
/**
* 操作系统
*/
private String operateSystem;
/**
* 登录状态 0-成功;1-失败
*/
private Integer status;
/**
* 登录时间戳
*/
private Long loginTime;
/**
* 返回结果
*/
private String operateMsg;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,119 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 菜单权限实体类
*
* @author 程序员小强
* @date 2021-01-08 18:01:08
*/
@Data
public class SsoMenu implements Serializable {
private static final long serialVersionUID = -1115470419419879842L;
/**
* 菜单ID
*/
private Long menuId;
/**
* 菜单名称
*/
private String menuName;
/**
* 系统编码
*/
private String sysCode;
/**
* 菜单类型M目录 C菜单 F按钮
*/
private String menuType;
/**
* 父菜单ID
*/
private Long menuParentId;
/**
* 显示顺序
*/
private Integer sortNum;
/**
* 菜单路由地址
*/
private String path;
/**
* 菜单图标
*/
private String icon;
/**
* 组件路径
*/
private String component;
/**
* 权限标识,多个|分隔
*/
private String permissions;
/**
* 使用类型 0-授权访问;1-开放访问;
*/
private Integer useType;
/**
* 是否显示 0-显示;1-隐藏
*/
private Integer visible;
/**
* 菜单状态 0-正常;1停用
*/
private Integer status;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
/**
* 备注
*/
private String remarks;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,87 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 在线用户实体类
*
* @author 程序员小强
*/
@Data
public class SsoOnlineUser implements Serializable {
private static final long serialVersionUID = 4271347681726609352L;
/**
* ID
*/
private Long id;
/**
* 请求标识
*/
private String requestId;
/**
* 用户ID
*/
private Long userId;
/**
* 来源IP
*/
private String sourceIp;
/**
* 来源地址
*/
private String sourceAddress;
/**
* 浏览器
*/
private String browserName;
/**
* 操作系统
*/
private String operateSystem;
/**
* 登录时间戳
*/
private Long loginTime;
/**
* 主动退出时间戳
*/
private Long loginOutTime;
/**
* 失效时间戳
*/
private Long expireTime;
/**
* 返回结果
*/
private String operateMsg;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,84 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 角色信息实体类
*
* @author 程序员小强
* @date 2021-01-07 15:56:40
*/
@Data
public class SsoRole implements Serializable {
private static final long serialVersionUID = -9193130704066823912L;
/**
* 角色ID
*/
private Long roleId;
/**
* 系统编码
*/
private String sysCode;
/**
* 角色名称
*/
private String roleName;
/**
* 角色标识key
*/
private String roleKey;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 显示顺序
*/
private Integer sortNum;
/**
* 备注
*/
private String remarks;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,50 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 角色和菜单关系实体类
*
* @author 程序员小强
* @date 2021-01-08 18:01:08
*/
@Data
public class SsoRoleMenu implements Serializable {
private static final long serialVersionUID = -8633658293267783613L;
/**
* 系统编码
*/
private String sysCode;
/**
* 角色ID
*/
private Long roleId;
/**
* 菜单ID
*/
private Long menuId;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,110 @@
/**
* haifenbb.com
* Copyright (C) 2019-2020 All Rights Reserved.
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
/**
* 目标系统实体类
*
* @author 程序员小强
* @date 2020-12-27 10:59:43
*/
@Data
public class SsoSystem implements Serializable {
private static final long serialVersionUID = -4911126816387035L;
/**
* 系统平台ID
*/
private Long sysId;
/**
* 系统编码
*/
private String sysCode;
/**
* 系统名称
*/
private String sysName;
/**
* 系统权限编码
*/
private String sysGrantCode;
/**
* 系统链接
*/
private String sysUrl;
/**
* 系统图标
*/
private String sysIcon;
/**
* 系统环境 0-测试 1-beta 2-生产
*/
private Integer sysEnv;
/**
* 排序数字越小排在越前面
*/
private Integer sortNum;
/**
* 签名类型 0-;1-MD5;2-RSA;
*/
private Integer signType;
/**
* 网关验签公钥
*/
private String publicKey;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 备注
*/
private String remarks;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private String createTime;
/**
* 更新时间
*/
private String updateTime;
}

@ -0,0 +1,69 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 平台管理员关系实体类
*
* @author 程序员小强
* @date 2021-01-16 10:22:57
*/
@Data
public class SsoSystemManager implements Serializable {
private static final long serialVersionUID = 8221382605127103730L;
/**
* ID
*/
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 系统编码
*/
private String sysCode;
/**
* 状态 0-启用;1-停用
*/
private Integer status;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,113 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户实体类
*
* @author 程序员小强
* @date 2021-01-02 17:20:41
*/
@Data
public class SsoUser implements Serializable {
private static final long serialVersionUID = -3634941666611687795L;
/**
* 用户ID
*/
private Long userId;
/**
* 用户登录名
*/
private String username;
/**
* 密码
*/
private String password;
/**
* 用户昵称
*/
private String nickName;
/**
* 真实姓名
*/
private String realName;
/**
* 用户性别 0-;1-;2-未知
*/
private Integer sex;
/**
* 手机号码
*/
private String phone;
/**
* 邮箱
*/
private String email;
/**
* 头像
*/
private String avatar;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 最后登录IP
*/
private String loginIp;
/**
* 最后登录时间
*/
private Date lastLoginTime;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
/**
* 备注
*/
private String remarks;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,49 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户部门关系实体类
*
* @author 程序员小强
* @date 2021-01-02 17:20:41
*/
@Data
public class SsoUserDept implements Serializable {
private static final long serialVersionUID = -8391256763118936557L;
/**
* 系统编码
*/
private String sysCode;
/**
* 用户ID
*/
private Long userId;
/**
* 部门ID
*/
private Long deptId;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,49 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户和角色关联实体类
*
* @author 程序员小强
* @date 2021-01-08 15:41:48
*/
@Data
public class SsoUserRole implements Serializable {
private static final long serialVersionUID = -3171194295603566556L;
/**
* 系统编码
*/
private String sysCode;
/**
* 用户ID
*/
private Long userId;
/**
* 角色ID
*/
private Long roleId;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,69 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户与目标系统关系实体类
*
* @author 程序员小强
* @date 2021-01-10 22:22:34
*/
@Data
public class SsoUserSystem implements Serializable {
private static final long serialVersionUID = -6154959745933571133L;
/**
* 自增ID
*/
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 系统编码
*/
private String sysCode;
/**
* 显示顺序
*/
private Integer sortNum;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
/**
* 创建者
*/
private String createBy;
/**
* 最后修改者
*/
private String updateBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
}

@ -0,0 +1,113 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.dto.SsoUserDeptDTO;
import com.sso.dao.entity.SsoDept;
import com.sso.dao.query.SsoDeptQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 部门基础mapper
*
* @author 程序员小强
* @date 2020-12-27 18:07:20
*/
public interface SsoDeptMapper {
/**
* 根据 部门ID 查询
*
* @param deptId 部门ID
* @return 部门实体
*/
SsoDept getByDeptId(Long deptId);
/**
* 根据 系统编码与用户ID 查询
*
* @param sysCode 用户ID
* @param userIdList 用户ID
* @return 部门实体
*/
List<SsoUserDeptDTO> getDeptBySysCodeAndUserIdList(@Param("sysCode") String sysCode, @Param("userIdList") List<Long> userIdList);
/**
* 新增
*
* @param ssoDept 部门实体
* @return 新增的行数
*/
int insert(SsoDept ssoDept);
/**
* 动态参数新增
*
* @param ssoDept 部门实体
* @return 新增的行数
*/
int insertSelective(SsoDept ssoDept);
/**
* 根据自增主键编辑
*
* @param ssoDept 部门实体
* @return 编辑的行数
*/
int updateByDeptId(SsoDept ssoDept);
/**
* 更新所有父级的状态
*
* @param ssoDept
* @return 编辑的行数
*/
int updateAllParentStatus(SsoDept ssoDept);
/**
* 根据自增主键动态参数编辑
*
* @param ssoDept 部门实体
* @return 编辑的行数
*/
int updateByDeptIdSelective(SsoDept ssoDept);
/**
* 根据条件-查询
*
* @param query 过滤条件
* @return 统计数
*/
List<SsoDept> listByCondition(SsoDeptQuery query);
/**
* 根据条件统计
*
* @param query 过滤条件
* @return 统计数
*/
int countByCondition(SsoDeptQuery query);
/**
* 根据父部门ID与状态统计
*
* @param deptParentId
* @param status
* @return 统计数
*/
int countByDeptParentIdAndStatus(@Param("deptParentId") Long deptParentId, @Param("status") Integer status);
/**
* 根据 系统编码 统计
*
* @param syCode
* @return 统计数
*/
int countBySysCode(@Param("sysCode") String syCode);
}

@ -0,0 +1,61 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoDept;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 部门祖先/后代关系
*
* @author 程序员小强
* @date 2020-12-27 18:07:20
*/
public interface SsoDeptTreePathMapper {
/**
* 插入新节点
*
* @param deptId
* @param deptParentId
* @return 行数
*/
int insertBatch(@Param("deptId") Long deptId, @Param("deptParentId") Long deptParentId);
/**
* 删除叶子节点
*
* @param deptId
* @return 行数
*/
int deleteLeaf(Long deptId);
/**
* 删除子树
*
* @param deptId
* @return 行数
*/
int deleteChildTree(Long deptId);
/**
* 查询所有祖先
*
* @param deptId
* @return 部门列表
*/
List<SsoDept> getAllParent(Long deptId);
/**
* 查询所有后代
*
* @param deptId
* @return 部门列表
*/
List<SsoDept> getAllChild(Long deptId);
}

@ -0,0 +1,91 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoLoginLog;
import com.sso.dao.query.LoginLogQuery;
import java.util.List;
/**
* 登录日志基础mapper接口
*
* @author 程序员小强
* @date 2021-01-23 10:45:22
*/
public interface SsoLoginLogMapper {
/**
* 根据 requestId 查询接口
*
* @param requestId 自增主键
* @return 登录日志实体
* @date 20-01-19 10:45:22
*/
SsoLoginLog getByRequestId(String requestId);
/**
* 统计
*
* @param query
* @return 统计值
*/
int countByCondition(LoginLogQuery query);
/**
* 查询列表
*
* @param query
* @return 日志列表
*/
List<SsoLoginLog> listPageByCondition(LoginLogQuery query);
/**
* 新增接口
*
* @param ssoLoginLog 登录日志实体
* @return 新增的行数
* @date 2021-01-23 10:45:22
*/
int insert(SsoLoginLog ssoLoginLog);
/**
* 动态参数新增接口
*
* @param ssoLoginLog 登录日志实体
* @return 新增的行数
* @date 2021-01-23 10:45:22
*/
int insertSelective(SsoLoginLog ssoLoginLog);
/**
* 根据自增主键删除接口
*
* @param id 自增主键主键
* @return 删除的行数
* @date 2021-01-23 10:45:22
*/
int deleteByPrimaryKey(Long id);
/**
* 根据自增主键编辑接口
*
* @param ssoLoginLog 登录日志实体
* @return 编辑的行数
* @date 2021-01-23 10:45:22
*/
int updateByPrimaryKey(SsoLoginLog ssoLoginLog);
/**
* 根据自增主键动态参数编辑接口
*
* @param ssoLoginLog 登录日志实体
* @return 编辑的行数
* @date 2021-01-23 10:45:22
*/
int updateByPrimaryKeySelective(SsoLoginLog ssoLoginLog);
}

@ -0,0 +1,112 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoMenu;
import com.sso.dao.query.SsoMenuQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 菜单权限基础mapper
*
* @author 程序员小强
* @date 2021-01-08 18:03:31
*/
public interface SsoMenuMapper {
/**
* 根据 menuId 查询
*
* @param menuId 自增主键
* @return 菜单权限
*/
SsoMenu getByMenuId(Long menuId);
/**
* 根据系统编码与角色名称查询
*
* @param sysCode 系统编码
* @param menuName 菜单名称
* @return 角色信息
*/
SsoMenu getBySysCodeAndName(@Param("sysCode") String sysCode, @Param("menuName") String menuName);
/**
* 根据系统编码查询-未删除-并且启用的菜单
*
* @param sysCode
* @return 权限集
*/
List<SsoMenu> getEnableMenuListBySysCode(@Param("sysCode") String sysCode);
/**
* 根据系统编码与用户ID查询权限查询-未删除-并且启用的菜单
*
* @param sysCode
* @param userId
* @return 权限集
*/
List<SsoMenu> getMenuListBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 根据条件统计
*
* @param query 过滤条件
* @return 统计数
*/
int countByCondition(SsoMenuQuery query);
/**
* 根据条件-查询
*
* @param query 过滤条件
* @return 统计数
*/
List<SsoMenu> listByCondition(SsoMenuQuery query);
/**
* 新增
*
* @param ssoMenu 菜单权限
* @return 新增的行数
*/
int insert(SsoMenu ssoMenu);
/**
* 动态参数新增
*
* @param ssoMenu 菜单权限
* @return 新增的行数
*/
int insertSelective(SsoMenu ssoMenu);
/**
* 根据 菜单ID 编辑
*
* @param ssoMenu 菜单权限
* @return 编辑的行数
*/
int updateByMenuId(SsoMenu ssoMenu);
/**
* 根据 菜单ID 动态参数编辑
*
* @param ssoMenu 菜单权限
* @return 编辑的行数
*/
int updateByMenuIdSelective(SsoMenu ssoMenu);
/**
* 根据 系统编码 统计
*
* @param syCode
* @return 统计数
*/
int countBySysCode(@Param("sysCode") String syCode);
}

@ -0,0 +1,111 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.dto.SsoOnlineUserDTO;
import com.sso.dao.entity.SsoOnlineUser;
import com.sso.dao.query.UserOnlineQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 在线用户基础mapper接口
*
* @author 程序员小强
* @date 2021-01-30
*/
public interface SsoOnlineUserMapper {
/**
* 根据 requestId 查询接口
*
* @param requestId 请求标识
* @return 在线用户实体
* @date 2021-01-30 11:47:18
*/
SsoOnlineUser getByRequestId(String requestId);
/**
* 新增接口
*
* @param ssoOnlineUser 在线用户实体
* @return 新增的行数
* @date 2021-01-30 11:47:18
*/
int insert(SsoOnlineUser ssoOnlineUser);
/**
* 动态参数新增接口
*
* @param ssoOnlineUser 在线用户实体
* @return 新增的行数
* @date 2021-01-30 11:47:18
*/
int insertSelective(SsoOnlineUser ssoOnlineUser);
/**
* 根据自增主键删除接口
*
* @param id 自增主键主键
* @return 删除的行数
* @date 2021-01-30 11:47:18
*/
int deleteByPrimaryKey(Long id);
/**
* 根据自增主键编辑接口
*
* @param ssoOnlineUser 在线用户实体
* @return 编辑的行数
* @date 2021-01-30 11:47:18
*/
int updateByPrimaryKey(SsoOnlineUser ssoOnlineUser);
/**
* 根据自增主键动态参数编辑接口
*
* @param ssoOnlineUser 在线用户实体
* @return 编辑的行数
* @date 2021-01-30 11:47:18
*/
int updateByPrimaryKeySelective(SsoOnlineUser ssoOnlineUser);
/**
* 统计
*
* @param query
* @return 统计值
*/
int countByCondition(UserOnlineQuery query);
/**
* 查询列表
*
* @param query
* @return 日志列表
*/
List<SsoOnlineUserDTO> listPageByCondition(UserOnlineQuery query);
/**
* 根据请求标识-刷新效期时间
*
* @param requestId
* @param expireTime
* @return
*/
int refreshExpireTimeByRequestId(@Param("requestId") String requestId, @Param("expireTime") Long expireTime);
/**
* 退出时-根据请求标识-更新效期时间
*
* @param requestId
* @param expireTime
* @param loginOutTime
* @return
*/
int updateByLogoOut(@Param("requestId") String requestId, @Param("expireTime") Long expireTime, @Param("loginOutTime") Long loginOutTime);
}

@ -0,0 +1,112 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoRole;
import com.sso.dao.query.SsoRoleQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 角色信息mapper
*
* @author 程序员小强
* @date 2021-01-07 15:56:40
*/
public interface SsoRoleMapper {
/**
* 根据 角色ID 查询
*
* @param roleId 角色ID
* @return 角色信息
*/
SsoRole getByRoleId(Long roleId);
/**
* 根据系统编码与角色名称查询
*
* @param sysCode 系统编码
* @param roleName 角色名称
* @return 角色信息
*/
SsoRole getBySysCodeAndName(@Param("sysCode") String sysCode, @Param("roleName") String roleName);
/**
* 根据系统编码与角色key查询
*
* @param sysCode 系统编码
* @param roleKey 角色名称
* @return 角色信息
*/
SsoRole getBySysCodeAndRoleKey(@Param("sysCode") String sysCode, @Param("roleKey") String roleKey);
/**
* 根据 系统编码 用户ID查询角色key
*
* @param sysCode 系统编码
* @param userId 用户ID
* @return 角色信息
*/
List<String> getRoleKeyBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 根据条件统计
*
* @param query 过滤条件
* @return 统计数
*/
int countByCondition(SsoRoleQuery query);
/**
* 根据条件-查询
*
* @param query 过滤条件
* @return 统计数
*/
List<SsoRole> listPageByCondition(SsoRoleQuery query);
/**
* 新增
*
* @param ssoRole 角色信息实体
* @return 新增的行数
*/
int insert(SsoRole ssoRole);
/**
* 动态参数新增
*
* @param ssoRole 角色信息实体
* @return 新增的行数
*/
int insertSelective(SsoRole ssoRole);
/**
* 根据自增主键编辑
*
* @param ssoRole 角色信息
* @return 编辑的行数
*/
int updateByRoleId(SsoRole ssoRole);
/**
* 根据自增主键动态参数编辑
*
* @param ssoRole 角色信息
* @return 编辑的行数
*/
int updateByRoleIdSelective(SsoRole ssoRole);
/**
* 根据 系统编码 统计
*
* @param syCode
* @return 统计数
*/
int countBySysCode(@Param("sysCode") String syCode);
}

@ -0,0 +1,86 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoRoleMenu;
import java.util.List;
/**
* 角色和菜单关系基础mapper
*
* @author 程序员小强
* @date 2021-01-08 18:03:32
*/
public interface SsoRoleMenuMapper {
/**
* 根据自增主键id查询
*
* @param roleId 角色ID
* @return 角色和菜单关系
*/
List<Long> getMenuIdListByRoleId(Long roleId);
/**
* 批量新增
*
* @param list
* @return 新增的行数
*/
int batchSave(List<SsoRoleMenu> list);
/**
* 新增
*
* @param ssoRoleMenu 角色和菜单关系
* @return 新增的行数
*/
int insert(SsoRoleMenu ssoRoleMenu);
/**
* 动态参数新增
*
* @param ssoRoleMenu 角色和菜单关系
* @return 新增的行数
*/
int insertSelective(SsoRoleMenu ssoRoleMenu);
/**
* 根据 roleId 删除
*
* @param roleId 角色ID
* @return 删除的行数
*/
int deleteByRoleId(Long roleId);
/**
* 根据 menuId 删除
*
* @param menuId 菜单ID
* @return 删除的行数
*/
int deleteByMenuId(Long menuId);
/**
* 根据自增主键编辑
*
* @param ssoRoleMenu 角色和菜单关系
* @return 编辑的行数
*/
int updateByPrimaryKey(SsoRoleMenu ssoRoleMenu);
/**
* 根据自增主键动态参数编辑
*
* @param ssoRoleMenu 角色和菜单关系
* @return 编辑的行数
*/
int updateByPrimaryKeySelective(SsoRoleMenu ssoRoleMenu);
}

@ -0,0 +1,100 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.dto.SsoUserMgmtDTO;
import com.sso.dao.entity.SsoSystemManager;
import com.sso.dao.query.SystemMgmtPageQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 平台管理员关系基础mapper
*
* @author 程序员小强
* @date 2021-01-16 10:22:57
*/
public interface SsoSystemManagerMapper {
/**
* 根据自增主键id查询
*
* @param id 自增主键
* @return SsoSystemManager
* @date 2021-01-16 10:22:57
*/
SsoSystemManager getById(Long id);
/**
* 根据-系统编码和用户ID查询
*
* @param sysCode 自增主键
* @param userId 自增主键
* @return SsoSystemManager
* @date 2021-01-16 10:22:57
*/
SsoSystemManager getBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 根据-自增主键id统计
*
* @param sysCode 自增主键
* @param userId 自增主键
* @return SsoSystemManager
* @date 2021-01-16 10:22:57
*/
int countBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 统计-平台管理员用户
*
* @param query 用户
* @return 用户集合
*/
int countSysMgmtUser(SystemMgmtPageQuery query);
/**
* 查询平台管理员用户列表
*
* @param query 用户
* @return 用户集合
*/
List<SsoUserMgmtDTO> listPageSysMgmtUser(SystemMgmtPageQuery query);
/**
* 新增
*
* @param ssoSystemManager
* @return 新增的行数
*/
int insert(SsoSystemManager ssoSystemManager);
/**
* 动态参数新增
*
* @param ssoSystemManager
* @return 新增的行数
*/
int insertSelective(SsoSystemManager ssoSystemManager);
/**
* 根据 自增ID 编辑
*
* @param ssoSystemManager
* @return 编辑的行数
*/
int updateById(SsoSystemManager ssoSystemManager);
/**
* 根据用户ID与系统编码更新
*
* @param ssoSystemManager
* @return 编辑的行数
*/
int updateBySysCodeAndUserId(SsoSystemManager ssoSystemManager);
}

@ -0,0 +1,128 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoSystem;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 目标系统基础mapper
*
* @author 程序员小强
* @date 2020-12-27 10:59:43
*/
public interface SsoSystemMapper {
/**
* 根据系统编码-查询
*
* @param sysId 系统ID
* @return 目标系统实体
*/
SsoSystem getBySysId(@Param("sysId") Long sysId);
/**
* 根据系统编码-查询
*
* @param sysCode 系统编码
* @return 目标系统实体
*/
SsoSystem getBySysCode(@Param("sysCode") String sysCode);
/**
* 根据系统编码集-查询
*
* @param sysCodeList 系统编码集
* @return 目标系统实体
*/
List<SsoSystem> getBySysCodeList(@Param("sysCodeList") List<String> sysCodeList);
/**
* 根据状态查询
*
* @param statusList
* @return 目标系统实体
*/
List<SsoSystem> listByStatusList(@Param("statusList") List<Integer> statusList);
/**
* 根据用户ID查询-管理员权限的系统
*
* @param userId
* @return 目标系统实体
*/
List<SsoSystem> listMySystemByAdmin(@Param("userId") Long userId, @Param("statusList") List<Integer> statusList);
/**
* 根据用户ID查询-拥有跳转权限的系统
*
* @param userId
* @return 目标系统实体
*/
List<SsoSystem> listMySystemByUserId(@Param("userId") Long userId);
/**
* 根据用户ID查询-拥有管理权限的系统平台
*
* @param userId
* @return 目标系统实体
*/
List<SsoSystem> listSystemMgmtByUserId(@Param("userId") Long userId);
/**
* 新增
*
* @param ssoSystem 目标系统实体
* @return 新增的行数
*/
int insert(SsoSystem ssoSystem);
/**
* 动态参数新增
*
* @param ssoSystem 目标系统实体
* @return 新增的行数
*/
int insertSelective(SsoSystem ssoSystem);
/**
* 根据 sysId 编辑
*
* @param ssoSystem 目标系统实体
* @return 编辑的行数
*/
int updateBySysId(SsoSystem ssoSystem);
/**
* 根据 sysId 修改秘钥属性
*
* @param ssoSystem 目标系统实体
* @return 编辑的行数
*/
int updateSecretBySysId(SsoSystem ssoSystem);
/**
* 修改图标
*
* @param sysId 系统ID
* @param sysIcon 头像地址
* @param updateBy 最后修改人
* @return 编辑的行数
*/
int updateIconBySysId(@Param("sysId") Long sysId, @Param("sysIcon") String sysIcon, @Param("updateBy") String updateBy);
/**
* 根据自增主键动态参数编辑
*
* @param ssoSystem 目标系统实体
* @return 编辑的行数
*/
int updateBySysIdSelective(SsoSystem ssoSystem);
}

@ -0,0 +1,85 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoUserDept;
import org.apache.ibatis.annotations.Param;
/**
* 用户部门关系基础mapper
*
* @author 程序员小强
* @date 2021-01-02 17:20:41
*/
public interface SsoUserDeptMapper {
/**
* 根据 系统编码与用户ID 查询
*
* @param sysCode 系统编码
* @param userId 用户ID
* @return 用户部门关系实体
*/
SsoUserDept getDeptBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 新增
*
* @param ssoUserDept 用户部门关系实体
* @return 新增的行数
*/
int insert(SsoUserDept ssoUserDept);
/**
* 动态参数新增
*
* @param ssoUserDept 用户部门关系实体
* @return 新增的行数
*/
int insertSelective(SsoUserDept ssoUserDept);
/**
* 根据 系统编码与 用户ID 删除
*
* @param sysCode 系统编码
* @param userId 用户ID
* @return 删除的行数
*/
int deleteBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 根据 系统编码与 部门ID 删除
*
* @param sysCode 系统编码
* @param deptId 部门ID
* @return 删除的行数
*/
int deleteBySysCodeAndDeptId(@Param("sysCode") String sysCode, @Param("deptId") Long deptId);
/**
* 根据自增主键编辑
*
* @param ssoUserDept 用户部门关系实体
* @return 编辑的行数
*/
int updateByPrimaryKey(SsoUserDept ssoUserDept);
/**
* 根据自增主键动态参数编辑
*
* @param ssoUserDept 用户部门关系实体
* @return 编辑的行数
*/
int updateByPrimaryKeySelective(SsoUserDept ssoUserDept);
/**
* 根据部门ID统计
*
* @param deptId
* @return 统计行数
*/
int countByDeptId(Long deptId);
}

@ -0,0 +1,159 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoUser;
import com.sso.dao.query.UserPageQuery;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 用户基础mapper
*
* @author 程序员小强
* @date 2021-01-02 17:20:41
*/
public interface SsoUserMapper {
/**
* 根据 userId 查询
*
* @param userId 用户ID
* @return 用户信息
*/
SsoUser getByUserId(Long userId);
/**
* 根据用户名-查询
*
* @param userName 用户
* @return 用户
*/
SsoUser getByUserName(String userName);
/**
* 根据手机号-查询
*
* @param phone 用户手机号
* @return 用户
*/
SsoUser getByPhone(String phone);
/**
* 根据邮箱-查询
*
* @param email 用户邮箱
* @return 用户
*/
SsoUser getByEmail(String email);
/**
* 根据手机号或用户名-查询
*
* @param keywords 关键字
* @param limit
* @return 用户
*/
List<SsoUser> listByPhoneOrUserNameLike(@Param("keywords") String keywords, @Param("limit") Integer limit);
/**
* 统计用户
*
* @param query 用户
* @return 用户集合
*/
int countByCondition(UserPageQuery query);
/**
* 查询用户列表
*
* @param query 用户
* @return 用户集合
*/
List<SsoUser> listPageByCondition(UserPageQuery query);
/**
* 根据自增主键id查询
*
* @param id 自增主键
* @return 用户实体
*/
SsoUser selectByPrimaryKey(Long id);
/**
* 新增
*
* @param ssoUser 用户实体
* @return 新增的行数
*/
int insert(SsoUser ssoUser);
/**
* 动态参数新增
*
* @param ssoUser 用户实体
* @return 新增的行数
*/
int insertSelective(SsoUser ssoUser);
/**
* 根据 用户ID 编辑
*
* @param ssoUser 用户实体
* @return 编辑的行数
*/
int updateByUserId(SsoUser ssoUser);
/**
* 修改个人信息
*
* @param ssoUser 用户实体
* @return 编辑的行数
*/
int updateProfileByUserId(SsoUser ssoUser);
/**
* 更新
*
* @param userId 用户userId
* @param loginIp 用户loginIp
* @param lastLoginTime 登录时间
* @return 编辑的行数
*/
int updateLastLogin(@Param("userId") Long userId, @Param("loginIp") String loginIp, @Param("lastLoginTime") Date lastLoginTime);
/**
* 修改密码
*
* @param userId 用户ID
* @param password 密码
* @param updateBy 最后修改人
* @return 编辑的行数
*/
int updatePwd(@Param("userId") Long userId, @Param("password") String password, @Param("updateBy") String updateBy);
/**
* 修改头像
*
* @param userId 用户ID
* @param avatar 头像地址
* @param updateBy 最后修改人
* @return 编辑的行数
*/
int updateAvatar(@Param("userId") Long userId, @Param("avatar") String avatar, @Param("updateBy") String updateBy);
/**
* 根据自增主键动态参数编辑
*
* @param ssoUser 用户实体
* @return 编辑的行数
*/
int updateByUserIdSelective(SsoUser ssoUser);
}

@ -0,0 +1,121 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.dto.RoleCountDTO;
import com.sso.dao.dto.SsoUserRoleDTO;
import com.sso.dao.entity.SsoUserRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户和角色关联基础mapper
*
* @author 程序员小强
* @date 2021-01-08 15:41:48
*/
public interface SsoUserRoleMapper {
/**
* 根据自增主键id查询
*
* @param id 自增主键
* @return 用户和角色关联实体
*/
SsoUserRole selectByPrimaryKey(Long id);
/**
* 根据系统编码 与用户ID 查询角色ID
*
* @param sysCode
* @param userId
* @return 角色ID集
*/
List<Long> getRoleIdListBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 根据 系统编码与用户ID 查询
*
* @param sysCode 用户ID
* @param userIdList 用户ID
* @return 部门实体
*/
List<SsoUserRoleDTO> getRoleBySysCodeAndUserIdList(@Param("sysCode") String sysCode, @Param("userIdList") List<Long> userIdList);
/**
* 新增
*
* @param ssoUserRole 用户和角色关联实体
* @return 新增的行数
*/
int insert(SsoUserRole ssoUserRole);
/**
* 动态参数新增
*
* @param ssoUserRole 用户和角色关联实体
* @return 新增的行数
*/
int insertSelective(SsoUserRole ssoUserRole);
/**
* 批量新增
*
* @param list
* @return
*/
int batchSave(List<SsoUserRole> list);
/**
* 根据用户ID删除
*
* @param sysCode 系统编码
* @param userId 用户ID
* @return 删除的行数
*/
int deleteBySysCodeAndUserId(@Param("sysCode") String sysCode, @Param("userId") Long userId);
/**
* 根据用户ID删除
*
* @param roleId 角色ID
* @param userId 用户ID
* @return 删除的行数
*/
int deleteByRoleIdAndUserId(@Param("roleId") Long roleId, @Param("userId") Long userId);
/**
* 根据自增主键编辑
*
* @param ssoUserRole 用户和角色关联实体
* @return 编辑的行数
*/
int updateByPrimaryKey(SsoUserRole ssoUserRole);
/**
* 根据自增主键动态参数编辑
*
* @param ssoUserRole 用户和角色关联实体
* @return 编辑的行数
*/
int updateByPrimaryKeySelective(SsoUserRole ssoUserRole);
/**
* 根据 角色ID 统计
*
* @param roleId 角色ID
* @return 统计数
*/
int countByRoleId(Long roleId);
/**
* 根据 角色ID 统计
*
* @param roleIdList 角色ID集
* @return 统计数
*/
List<RoleCountDTO> countByRoleIdList(@Param("roleIdList") List<Long> roleIdList);
}

@ -0,0 +1,95 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.mapper;
import com.sso.dao.entity.SsoUserSystem;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户与目标系统关系基础mapper接口
*
* @author 程序员小强
* @date 2021-01-10 22:22:34
*/
public interface SsoUserSystemMapper {
/**
* 根据用户ID与 系统编码查询
*
* @param userId 用户ID
* @param sysCode 系统编码
* @return 用户与目标系统关系实体
*/
SsoUserSystem getByUserIdAndSysCode(@Param("userId") Long userId, @Param("sysCode") String sysCode);
/**
* 根据用户ID集 系统编码查询
*
* @param userIdList 用户ID集
* @param sysCode 系统编码
* @return 用户与目标系统关系实体
*/
List<SsoUserSystem> listBySysCodeAndUserIdList(@Param("sysCode") String sysCode, @Param("userIdList") List<Long> userIdList);
/**
* 新增接口
*
* @param ssoUserSystem 用户与目标系统关系实体
* @return 新增的行数
*/
int insert(SsoUserSystem ssoUserSystem);
/**
* 动态参数新增接口
*
* @param ssoUserSystem 用户与目标系统关系实体
* @return 新增的行数
*/
int insertSelective(SsoUserSystem ssoUserSystem);
/**
* 根据自增主键删除接口
*
* @param id 自增主键主键
* @return 删除的行数
*/
int deleteByPrimaryKey(Long id);
/**
* 根据自增主键编辑接口
*
* @param ssoUserSystem 用户与目标系统关系实体
* @return 编辑的行数
*/
int updateById(SsoUserSystem ssoUserSystem);
/**
* 根据自增主键动态参数编辑接口
*
* @param ssoUserSystem 用户与目标系统关系实体
* @return 编辑的行数
*/
int updateByIdSelective(SsoUserSystem ssoUserSystem);
/**
* 根据自增主键动态参数编辑接口
*
* @param ssoUserSystem 用户与目标系统关系实体
* @return 编辑的行数
*/
int updateBySysCodeAndUserIdSelective(SsoUserSystem ssoUserSystem);
/**
* 根据 系统编码 统计
*
* @param syCode
* @return 统计数
*/
int countBySysCode(@Param("sysCode") String syCode);
}

@ -0,0 +1,89 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.query;
import com.sso.common.model.page.BasePageQuery;
/**
* 登录日志分页查询bo
*
* @author 程序员小强
*/
public class LoginLogQuery extends BasePageQuery {
private static final long serialVersionUID = -7137359307341275655L;
/**
* 系统编码
*/
private String sysCode;
/**
* 用户登录名
*/
private String usernameLike;
/**
* 登录状态 0-成功;1-失败
*/
private Integer status;
/**
* 登录开始时间
*/
private Long loginStartTime;
/**
* 登录截止时间
*/
private Long loginEndTime;
public String getSysCode() {
return sysCode;
}
public LoginLogQuery setSysCode(String sysCode) {
this.sysCode = sysCode;
return this;
}
public String getUsernameLike() {
return usernameLike;
}
public LoginLogQuery setUsernameLike(String usernameLike) {
this.usernameLike = usernameLike;
return this;
}
public Integer getStatus() {
return status;
}
public LoginLogQuery setStatus(Integer status) {
this.status = status;
return this;
}
public Long getLoginStartTime() {
return loginStartTime;
}
public LoginLogQuery setLoginStartTime(Long loginStartTime) {
this.loginStartTime = loginStartTime;
return this;
}
public Long getLoginEndTime() {
return loginEndTime;
}
public LoginLogQuery setLoginEndTime(Long loginEndTime) {
this.loginEndTime = loginEndTime;
return this;
}
}

@ -0,0 +1,117 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.query;
import com.sso.common.model.page.BasePageQuery;
/**
* 部门查询
* mapper xml 入参
*
* @author 程序员小强
*/
public class SsoDeptQuery extends BasePageQuery {
private static final long serialVersionUID = 9032669004611549658L;
/**
* 系统编码
*/
private String sysCode;
/**
* 父部门ID
*/
private Long deptParentId;
/**
* 需要排除的-部门ID
*/
private Long excludeDeptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门右模糊
*/
private String deptNameLike;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
public String getSysCode() {
return sysCode;
}
public SsoDeptQuery setSysCode(String sysCode) {
this.sysCode = sysCode;
return this;
}
public Long getDeptParentId() {
return deptParentId;
}
public SsoDeptQuery setDeptParentId(Long deptParentId) {
this.deptParentId = deptParentId;
return this;
}
public Long getExcludeDeptId() {
return excludeDeptId;
}
public SsoDeptQuery setExcludeDeptId(Long excludeDeptId) {
this.excludeDeptId = excludeDeptId;
return this;
}
public String getDeptName() {
return deptName;
}
public SsoDeptQuery setDeptName(String deptName) {
this.deptName = deptName;
return this;
}
public String getDeptNameLike() {
return deptNameLike;
}
public SsoDeptQuery setDeptNameLike(String deptNameLike) {
this.deptNameLike = deptNameLike;
return this;
}
public Integer getStatus() {
return status;
}
public SsoDeptQuery setStatus(Integer status) {
this.status = status;
return this;
}
public Integer getDelFlag() {
return delFlag;
}
public SsoDeptQuery setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
return this;
}
}

@ -0,0 +1,117 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.query;
import com.sso.common.model.page.BasePageQuery;
/**
* 菜单查询
* mapper xml 入参
*
* @author 程序员小强
*/
public class SsoMenuQuery extends BasePageQuery {
private static final long serialVersionUID = -4210187210718040578L;
/**
* 系统编码
*/
private String sysCode;
/**
* 父菜单ID
*/
private Long menuParentId;
/**
* 需要排除的-菜单ID
*/
private Long excludeMenuId;
/**
* 菜单名称
*/
private String menuName;
/**
* 菜单名称右模糊
*/
private String menuNameLike;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
public String getSysCode() {
return sysCode;
}
public SsoMenuQuery setSysCode(String sysCode) {
this.sysCode = sysCode;
return this;
}
public Long getMenuParentId() {
return menuParentId;
}
public SsoMenuQuery setMenuParentId(Long menuParentId) {
this.menuParentId = menuParentId;
return this;
}
public Long getExcludeMenuId() {
return excludeMenuId;
}
public SsoMenuQuery setExcludeMenuId(Long excludeMenuId) {
this.excludeMenuId = excludeMenuId;
return this;
}
public String getMenuName() {
return menuName;
}
public SsoMenuQuery setMenuName(String menuName) {
this.menuName = menuName;
return this;
}
public String getMenuNameLike() {
return menuNameLike;
}
public SsoMenuQuery setMenuNameLike(String menuNameLike) {
this.menuNameLike = menuNameLike;
return this;
}
public Integer getStatus() {
return status;
}
public SsoMenuQuery setStatus(Integer status) {
this.status = status;
return this;
}
public Integer getDelFlag() {
return delFlag;
}
public SsoMenuQuery setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
return this;
}
}

@ -0,0 +1,127 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.query;
import com.sso.common.model.page.BasePageModel;
import com.sso.common.model.page.BasePageQuery;
/**
* 角色查询
* mapper xml 入参
*
* @author 程序员小强
*/
public class SsoRoleQuery extends BasePageQuery {
private static final long serialVersionUID = 4663369561352780923L;
/**
* 系统编码
*/
private String sysCode;
/**
* 需要排除的角色ID
*/
private Long excludeRoleId;
/**
* 角色名称
*/
private String roleName;
/**
* 角色名称 右模糊
*/
private String roleNameLike;
/**
* 角色key 右模糊
*/
private String roleKeyLike;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
public SsoRoleQuery() {
}
public SsoRoleQuery(BasePageModel pageModel) {
this.setPage(pageModel.getPage());
this.setPageSize(pageModel.getPageSize());
}
public String getSysCode() {
return sysCode;
}
public SsoRoleQuery setSysCode(String sysCode) {
this.sysCode = sysCode;
return this;
}
public Long getExcludeRoleId() {
return excludeRoleId;
}
public SsoRoleQuery setExcludeRoleId(Long excludeRoleId) {
this.excludeRoleId = excludeRoleId;
return this;
}
public String getRoleName() {
return roleName;
}
public SsoRoleQuery setRoleName(String roleName) {
this.roleName = roleName;
return this;
}
public String getRoleNameLike() {
return roleNameLike;
}
public SsoRoleQuery setRoleNameLike(String roleNameLike) {
this.roleNameLike = roleNameLike;
return this;
}
public String getRoleKeyLike() {
return roleKeyLike;
}
public SsoRoleQuery setRoleKeyLike(String roleKeyLike) {
this.roleKeyLike = roleKeyLike;
return this;
}
public Integer getStatus() {
return status;
}
public SsoRoleQuery setStatus(Integer status) {
this.status = status;
return this;
}
public Integer getDelFlag() {
return delFlag;
}
public SsoRoleQuery setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
return this;
}
}

@ -0,0 +1,129 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.query;
import com.sso.common.model.page.BasePageQuery;
/**
* 系统管理员权限-分页查询bo
*
* @author 程序员小强
*/
public class SystemMgmtPageQuery extends BasePageQuery {
private static final long serialVersionUID = 7588427768619166745L;
/**
* 系统编码
*/
private String sysCode;
/**
* 用户登录名
*/
private String usernameLike;
/**
* 用户昵称
*/
private String nickNameLike;
/**
* 真实姓名
*/
private String realNameLike;
/**
* 手机号码
*/
private String phoneLike;
/**
* 用户状态 0-正常;1-停用
*/
private Integer userStatus;
/**
* 绑定关系状态 0-正常;1-停用
*/
private Integer relationStatus;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
public String getSysCode() {
return sysCode;
}
public SystemMgmtPageQuery setSysCode(String sysCode) {
this.sysCode = sysCode;
return this;
}
public String getUsernameLike() {
return usernameLike;
}
public SystemMgmtPageQuery setUsernameLike(String usernameLike) {
this.usernameLike = usernameLike;
return this;
}
public String getNickNameLike() {
return nickNameLike;
}
public SystemMgmtPageQuery setNickNameLike(String nickNameLike) {
this.nickNameLike = nickNameLike;
return this;
}
public String getRealNameLike() {
return realNameLike;
}
public SystemMgmtPageQuery setRealNameLike(String realNameLike) {
this.realNameLike = realNameLike;
return this;
}
public String getPhoneLike() {
return phoneLike;
}
public SystemMgmtPageQuery setPhoneLike(String phoneLike) {
this.phoneLike = phoneLike;
return this;
}
public Integer getUserStatus() {
return userStatus;
}
public SystemMgmtPageQuery setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
public Integer getRelationStatus() {
return relationStatus;
}
public SystemMgmtPageQuery setRelationStatus(Integer relationStatus) {
this.relationStatus = relationStatus;
return this;
}
public Integer getDelFlag() {
return delFlag;
}
public SystemMgmtPageQuery setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
return this;
}
}

@ -0,0 +1,87 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.query;
import com.sso.common.model.page.BasePageQuery;
/**
* 在线用户分页查询bo
*
* @author 程序员小强
*/
public class UserOnlineQuery extends BasePageQuery {
private static final long serialVersionUID = 6745860184771356374L;
/**
* 用户登录名
*/
private String usernameLike;
/**
* 手机号
*/
private String phoneLike;
/**
* 效期开始时间
*/
private Long expireStartTime;
/**
* 登录开始时间
*/
private Long loginStartTime;
/**
* 登录截止时间
*/
private Long loginEndTime;
public String getUsernameLike() {
return usernameLike;
}
public UserOnlineQuery setUsernameLike(String usernameLike) {
this.usernameLike = usernameLike;
return this;
}
public String getPhoneLike() {
return phoneLike;
}
public UserOnlineQuery setPhoneLike(String phoneLike) {
this.phoneLike = phoneLike;
return this;
}
public Long getExpireStartTime() {
return expireStartTime;
}
public UserOnlineQuery setExpireStartTime(Long expireStartTime) {
this.expireStartTime = expireStartTime;
return this;
}
public Long getLoginStartTime() {
return loginStartTime;
}
public UserOnlineQuery setLoginStartTime(Long loginStartTime) {
this.loginStartTime = loginStartTime;
return this;
}
public Long getLoginEndTime() {
return loginEndTime;
}
public UserOnlineQuery setLoginEndTime(Long loginEndTime) {
this.loginEndTime = loginEndTime;
return this;
}
}

@ -0,0 +1,129 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.dao.query;
import com.sso.common.model.page.BasePageQuery;
/**
* 用户分页查询bo
*
* @author 程序员小强
*/
public class UserPageQuery extends BasePageQuery {
private static final long serialVersionUID = -7892866355117742382L;
/**
* 用户登录名
*/
private String usernameLike;
/**
* 用户昵称
*/
private String nickNameLike;
/**
* 真实姓名
*/
private String realNameLike;
/**
* 手机号码
*/
private String phoneLike;
/**
* 所属部门ID
*/
private Long deptId;
/**
* 角色ID
*/
private Long roleId;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 删除标志 0-正常;1-删除
*/
private Integer delFlag;
public String getUsernameLike() {
return usernameLike;
}
public UserPageQuery setUsernameLike(String usernameLike) {
this.usernameLike = usernameLike;
return this;
}
public String getNickNameLike() {
return nickNameLike;
}
public UserPageQuery setNickNameLike(String nickNameLike) {
this.nickNameLike = nickNameLike;
return this;
}
public String getRealNameLike() {
return realNameLike;
}
public UserPageQuery setRealNameLike(String realNameLike) {
this.realNameLike = realNameLike;
return this;
}
public String getPhoneLike() {
return phoneLike;
}
public UserPageQuery setPhoneLike(String phoneLike) {
this.phoneLike = phoneLike;
return this;
}
public Long getDeptId() {
return deptId;
}
public UserPageQuery setDeptId(Long deptId) {
this.deptId = deptId;
return this;
}
public Long getRoleId() {
return roleId;
}
public UserPageQuery setRoleId(Long roleId) {
this.roleId = roleId;
return this;
}
public Integer getStatus() {
return status;
}
public UserPageQuery setStatus(Integer status) {
this.status = status;
return this;
}
public Integer getDelFlag() {
return delFlag;
}
public UserPageQuery setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
return this;
}
}

@ -0,0 +1,30 @@
/**
* Copyright ( @程序员小强 All Rights Reserved.
* 博客地址:https://blog.csdn.net/qq_38011415
*/
package com.sso.model.bo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 系统编码参数类
*
* @author 程序员小强
* @date 2020-12-27 10:59:43
*/
@Data
public class SysCodeBO implements Serializable {
private static final long serialVersionUID = -878095644963838466L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
}

@ -0,0 +1,29 @@
package com.sso.model.bo.dept;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 部门删除bo
*
* @author 程序员小强
*/
@Data
public class DeptDeleteBO extends BaseOperateBO {
private static final long serialVersionUID = 1912530599252047615L;
/**
* 部门ID
*/
@NotNull(message = "部门ID不为空")
private Long deptId;
public String getLogValue() {
return String.format(" deptId:%d , , operateBy:%s", this.deptId, this.getOperateBy());
}
}

@ -0,0 +1,24 @@
package com.sso.model.bo.dept;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 部门详情bo
*
* @author 程序员小强
*/
@Data
public class DeptIdQueryBO implements Serializable {
private static final long serialVersionUID = -5367920763344359224L;
/**
* 部门ID
*/
@NotNull(message = "部门ID不为空")
private Long deptId;
}

@ -0,0 +1,34 @@
package com.sso.model.bo.dept;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 部门树查询
*
* @author 程序员小强
*/
@Data
public class DeptMgmtTreeBO implements Serializable {
private static final long serialVersionUID = 1912530599252047615L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 部门名称
*/
private String deptNameLike;
/**
* 状态 -1全部 0-启用;1-停用
*/
private Integer status;
}

@ -0,0 +1,63 @@
package com.sso.model.bo.dept;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* 部门添加 bo
*
* @author 程序员小强
*/
@Data
public class DeptSaveBO extends BaseOperateBO {
private static final long serialVersionUID = 7434128948642870592L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 部门名称
*/
@NotBlank(message = "部门名称不能为空")
private String deptName;
/**
* 父部门ID
*/
@NotNull(message = "父部门ID不为空")
private Long deptParentId;
/**
* 顺序
*/
@NotNull(message = "顺序不为空")
@Max(value = 1000000000, message = "显示顺序最大长度不能超过{max}")
private Integer sortNum;
/**
* 状态 0-启用;1-停用
*/
@NotNull(message = "状态不为空")
private Integer status;
/**
* 备注
*/
@Size(max = 200, message = "备注最大长度不超{max}")
private String remarks;
public String getLogValue() {
return String.format("sysCode:%s , deptName:%s , operateBy:%s", this.sysCode, this.deptName, this.getOperateBy());
}
}

@ -0,0 +1,67 @@
package com.sso.model.bo.dept;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* 部门修改BO
*
* @author 程序员小强
*/
@Data
public class DeptUpdateBO extends BaseOperateBO {
private static final long serialVersionUID = 6373997550677086520L;
/**
* 部门ID
*/
@NotNull(message = "部门ID不为空")
private Long deptId;
/**
* 部门名称
*/
@NotBlank(message = "部门名称不能为空")
private String deptName;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 父部门ID
*/
@NotNull(message = "父部门ID不为空")
private Long deptParentId;
/**
* 顺序
*/
@NotNull(message = "顺序不为空")
private Integer sortNum;
/**
* 状态 0-启用;1-停用
*/
@NotNull(message = "状态不为空")
private Integer status;
/**
* 备注
*/
@Size(max = 200, message = "备注最大长度不超{max}")
private String remarks;
public String getLogValue() {
return String.format("sysCode:%s , deptId:%d , deptName:%s , operateBy:%s", this.sysCode, this.deptId, this.deptName, this.getOperateBy());
}
}

@ -0,0 +1,45 @@
package com.sso.model.bo.getway;
import lombok.Data;
import java.io.Serializable;
/**
* 申请认证参数
*
* @author 程序员小强
* @version ApplyAuthBO.java
*/
@Data
public class ApplyAuthBO implements Serializable {
private static final long serialVersionUID = -3755046680856409972L;
/**
* 退出登录访问地址
*/
private String loginOutUrl;
/**
* 菜单类型
* 1-列表; 2-树形列表
*/
private String menuType;
/**
* 跳转url
*/
private String redirectUrl;
/**
* 登录token
*/
private String ssoToken;
/**
* 来源IP
*/
private String sourceIp;
}

@ -0,0 +1,49 @@
package com.sso.model.bo.getway;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
/**
* GetWay 请求公共参数
*
* @author 程序员小强
* @version GetWayReqBO.java
*/
@Data
public class GetWayReqBO implements Serializable {
private static final long serialVersionUID = 2055965490262675225L;
/**
* 请求唯一标识
* 推荐使用UUID要求唯一性
*/
@NotBlank(message = "请求标识不能为空")
private String apiRequestId;
@NotBlank(message = "系统编码不能为空")
private String sysCode;
@NotBlank(message = "方法名不能为空")
private String method;
@NotBlank(message = "版本号不能为空")
private String version;
@NotBlank(message = "签名类型不能为空")
@Pattern(regexp = "[1-3]", message = "签名类型只能为1或2或3")
private String signType;
@NotBlank(message = "请求时间戳不能为空")
@Pattern(regexp = "^16\\d{11}$", message = "时间戳格式错误")
private String timestamp;
private String sign;
private String content;
}

@ -0,0 +1,42 @@
package com.sso.model.bo.login;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 用户登录对象
*
* @author 程序员小强
*/
@Data
public class LoginBO implements Serializable {
private static final long serialVersionUID = 3516676046779777417L;
/**
* 用户名
*/
@NotBlank(message = "用户名不为空")
private String username;
/**
* 用户密码
*/
@NotBlank(message = "用户密码不为空")
private String password;
/**
* 验证码
*/
@NotBlank(message = "验证码不为空")
private String captchaCode;
/**
* 请求唯一标识
*/
@NotBlank(message = "请求唯一标识不为空")
private String requestId;
}

@ -0,0 +1,41 @@
package com.sso.model.bo.login;
import com.sso.common.model.page.BasePageModel;
import lombok.Data;
/**
* 登录日志分页查询bo
*
* @author 程序员小强
*/
@Data
public class LoginLogListPageBO extends BasePageModel {
private static final long serialVersionUID = -3442414830796499182L;
/**
* 系统编码
*/
private String sysCode;
/**
* 用户登录名
*/
private String usernameLike;
/**
* 登录状态 0-成功;1-失败
*/
private Integer status;
/**
* 登录开始时间
*/
private String loginStartTime;
/**
* 登录截止时间
*/
private String loginEndTime;
}

@ -0,0 +1,30 @@
package com.sso.model.bo.menu;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 菜单删除 bo
*
* @author 程序员小强
*/
@Data
public class MenuDeleteBO extends BaseOperateBO {
private static final long serialVersionUID = -8354384638349511426L;
/**
* 菜单ID
*/
@NotNull(message = "菜单ID不能为空")
private Long menuId;
public String getLogValue() {
return String.format("menuId:%d, operateBy:%s",
this.menuId, this.getOperateBy());
}
}

@ -0,0 +1,102 @@
package com.sso.model.bo.menu;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
* 菜单添加 bo
*
* @author 程序员小强
*/
@Data
public class MenuSaveBO extends BaseOperateBO {
private static final long serialVersionUID = -2219298721551456293L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 菜单名称
*/
@NotBlank(message = "菜单名称不能为空")
private String menuName;
/**
* 菜单类型M目录 C菜单 F按钮
*/
@NotBlank(message = "菜单类型不能为空")
private String menuType;
/**
* 父菜单ID
*/
@NotNull(message = "父菜单ID不能为空")
private Long menuParentId;
/**
* 显示顺序
*/
@NotNull(message = "显示顺序不能为空")
@Digits(integer = 999999999, fraction = 0, message = "显示顺序最大长度不能超过{integer}")
private Integer sortNum;
/**
* 菜单路由地址
*/
private String path;
/**
* 菜单图标
*/
private String icon;
/**
* 组件路径
*/
private String component;
/**
* 权限标识,多个|分隔
*/
@Size(max = 10, message = "权限标识最多不超过{max}")
private List<String> permissionList;
/**
* 使用类型 0-授权访问;1-开放访问;
*/
private Integer useType;
/**
* 是否显示 0-显示;1-隐藏
*/
private Integer visible;
/**
* 菜单状态 0-正常;1停用
*/
private Integer status;
/**
* 备注
*/
@Size(max = 200, message = "备注最大长度不超{max}")
private String remarks;
public String getLogValue() {
return String.format("sysCode:%s , menuName:%s , menuParentId:%d ,permissionList:%s, operateBy:%s", this.sysCode, this.menuName, this.menuParentId,
this.permissionList, this.getOperateBy());
}
}

@ -0,0 +1,33 @@
package com.sso.model.bo.menu;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 菜单树查询BO
*
* @author 程序员小强
*/
@Data
public class MenuTreeBO implements Serializable {
private static final long serialVersionUID = -4094219434105471621L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 菜单名称
*/
private String menuNameLike;
/**
* 状态 -1全部 0-启用;1-停用
*/
private Integer status;
}

@ -0,0 +1,30 @@
package com.sso.model.bo.menu;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 菜单修改 bo
*
* @author 程序员小强
*/
@Data
public class MenuUpdateBO extends MenuSaveBO {
private static final long serialVersionUID = 6016756261051760463L;
/**
* 菜单ID
*/
@NotNull(message = "菜单ID不能为空")
private Long menuId;
@Override
public String getLogValue() {
return String.format("menuId:%d,sysCode:%s menuName:%s , menuParentId:%d ,permissionList:%s, operateBy:%s",
this.menuId, this.getSysCode(), this.getMenuName(), this.getMenuParentId(), this.getPermissionList(), this.getOperateBy());
}
}

@ -0,0 +1,26 @@
package com.sso.model.bo.platform;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
/**
* 修改平台新增bo
*
* @author 程序员小强
*/
@Data
public class SystemDeleteBO extends BaseOperateBO {
private static final long serialVersionUID = 4340162202000538970L;
/**
* 系统平台ID
*/
private Long sysId;
public String getLogValue() {
return String.format("sysId:%d, operateBy:%s", this.sysId, this.getOperateBy());
}
}

@ -0,0 +1,54 @@
package com.sso.model.bo.platform;
import com.sso.common.model.page.BasePageModel;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 用户-系统关系分页查询bo
*
* @author 程序员小强
*/
@Data
public class SystemMgmtListPageBO extends BasePageModel {
private static final long serialVersionUID = -27397984110384822L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 用户登录名
*/
private String usernameLike;
/**
* 用户昵称
*/
private String nickNameLike;
/**
* 真实姓名
*/
private String realNameLike;
/**
* 手机号码
*/
private String phoneLike;
/**
* 用户状态 0-正常;1-停用
*/
private Integer userStatus;
/**
* 绑定关系状态 0-正常;1-停用
*/
private Integer relationStatus;
}

@ -0,0 +1,35 @@
package com.sso.model.bo.platform;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 系统管理权限移除BO
*
* @author 程序员小强
*/
@Data
public class SystemMgmtRemoveBO extends BaseOperateBO {
private static final long serialVersionUID = 7991373166717611704L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不为空")
private String sysCode;
/**
* 用户ID
*/
@NotNull(message = "用户ID不为空")
private Long userId;
public String getLogValue() {
return String.format("sysCode:%s, userId:%s , operateBy:%s", this.sysCode, this.userId, this.getOperateBy());
}
}

@ -0,0 +1,41 @@
package com.sso.model.bo.platform;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 系统管理权限-新增BO
*
* @author 程序员小强
*/
@Data
public class SystemMgmtSaveBO extends BaseOperateBO {
private static final long serialVersionUID = -3496085022363517714L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不为空")
private String sysCode;
/**
* 用户ID
*/
@NotNull(message = "用户ID不为空")
private Long userId;
/**
* 状态
*/
@NotNull(message = "状态不为空")
private Integer status;
public String getLogValue() {
return String.format("userId:%d, sysCode:%s , operateBy:%s", this.userId, this.sysCode, this.getOperateBy());
}
}

@ -0,0 +1,33 @@
package com.sso.model.bo.platform;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 系统管理权限-新增BO
*
* @author 程序员小强
*/
@Data
public class SystemMgmtStatusBO extends BaseOperateBO {
private static final long serialVersionUID = -5187844120648189372L;
/**
* ID
*/
@NotNull(message = "ID不为空")
private Long id;
/**
* 状态
*/
@NotNull(message = "状态不为空")
private Integer status;
public String getLogValue() {
return String.format("sysId:%d, status:%s , operateBy:%s", this.id, this.status, this.getOperateBy());
}
}

@ -0,0 +1,62 @@
package com.sso.model.bo.platform;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 目标平台新增bo
*
* @author 程序员小强
*/
@Data
public class SystemSaveBO extends BaseOperateBO {
private static final long serialVersionUID = 1163633182173991403L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不为空")
private String sysCode;
/**
* 系统名称
*/
@NotBlank(message = "系统名称不为空")
private String sysName;
/**
* 系统链接
*/
@NotBlank(message = "系统跳转链接不为空")
private String sysUrl;
/**
* 系统图标
*/
private String sysIcon;
/**
* 系统环境 0-测试 1-beta 2-生产
*/
@NotNull(message = "系统环境不为空")
private Integer sysEnv;
/**
* 排序数字越小排在越前面
*/
@NotNull(message = "排序不为空")
private Integer sortNum;
/**
* 备注
*/
private String remarks;
public String getLogValue() {
return String.format("sysCode:%s , sysName:%s , operateBy:%s", this.sysCode, this.sysName, this.getOperateBy());
}
}

@ -0,0 +1,26 @@
package com.sso.model.bo.platform;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
/**
* 目标平台排序bo
*
* @author 程序员小强
*/
@Data
public class SystemSortBO implements Serializable {
private static final long serialVersionUID = 2105261198839002918L;
/**
* 系统编码集合
*/
@NotNull(message = "系统编码集不为空")
@Size(min = 1, message = "系统编码集不为空")
private List<String> sysCodeList;
}

@ -0,0 +1,33 @@
package com.sso.model.bo.platform;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 修改平台新增bo
*
* @author 程序员小强
*/
@Data
public class SystemUpdateBO extends SystemSaveBO {
private static final long serialVersionUID = 1163633182173991403L;
/**
* 系统平台ID
*/
@NotNull(message = "系统平台ID不为空")
private Long sysId;
/**
* 状态
*/
@NotNull(message = "状态不为空")
private Integer status;
@Override
public String getLogValue() {
return String.format("sysId:%d, sysCode:%s , sysName:%s , operateBy:%s", this.sysId, this.getSysCode(), this.getSysName(), this.getOperateBy());
}
}

@ -0,0 +1,40 @@
package com.sso.model.bo.platform;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 修改平台新增bo
*
* @author 程序员小强
*/
@Data
public class SystemUpdateSecretBO extends BaseOperateBO {
private static final long serialVersionUID = -7361402011394142030L;
/**
* 系统平台ID
*/
@NotNull(message = "系统平台ID不为空")
private Long sysId;
/**
* 签名类型 0-;1-MD5;2-RSA;
*/
@NotNull(message = "签名类型不为空")
private Integer signType;
/**
* 网关验签公钥
*/
private String publicKey;
public String getLogValue() {
return String.format("sysId:%d, signType:%s , operateBy:%s", this.sysId, this.signType, this.getOperateBy());
}
}

@ -0,0 +1,28 @@
package com.sso.model.bo.role;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 角色删除bo
*
* @author 程序员小强
*/
@Data
public class RoleDeleteBO extends BaseOperateBO {
private static final long serialVersionUID = -4350853964122690858L;
/**
* 角色ID
*/
@NotNull(message = "角色ID不为空")
private Long roleId;
public String getLogValue() {
return String.format("roleId:%d , operateBy:%s", this.roleId, this.getOperateBy());
}
}

@ -0,0 +1,30 @@
package com.sso.model.bo.role;
import com.sso.common.model.page.BasePageModel;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 角色-下拉选项查询bo
*
* @author 程序员小强
*/
@Data
public class RoleListOptionBO extends BasePageModel {
private static final long serialVersionUID = 8961034980910026149L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 角色名称右模糊
*/
private String roleNameLike;
}

@ -0,0 +1,40 @@
package com.sso.model.bo.role;
import com.sso.common.model.page.BasePageModel;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 角色分页查询bo
*
* @author 程序员小强
*/
@Data
public class RoleListPageBO extends BasePageModel {
private static final long serialVersionUID = -8206942361131504869L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 角色名称 右模糊
*/
private String roleNameLike;
/**
* 角色key 右模糊
*/
private String roleKeyLike;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
}

@ -0,0 +1,34 @@
package com.sso.model.bo.role;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 角色删除bo
*
* @author 程序员小强
*/
@Data
public class RoleRemoveUserBO extends BaseOperateBO {
private static final long serialVersionUID = -4350853964122690858L;
/**
* 角色ID
*/
@NotNull(message = "角色ID不为空")
private Long roleId;
/**
* 用户ID
*/
@NotNull(message = "用户ID不为空")
private Long userId;
public String getLogValue() {
return String.format("roleId:%d , userId:%d, operateBy:%s", this.roleId, this.userId, this.getOperateBy());
}
}

@ -0,0 +1,64 @@
package com.sso.model.bo.role;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
* 角色添加 bo
*
* @author 程序员小强
*/
@Data
public class RoleSaveBO extends BaseOperateBO {
private static final long serialVersionUID = -2662983486894971210L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 状态
*/
@NotNull(message = "状态不为空")
private Integer status;
/**
* 显示顺序
*/
@NotNull(message = "显示顺序不为空")
private Integer sortNum;
/**
* 角色名称
*/
@NotBlank(message = "角色名称不能为空")
private String roleName;
/**
* 角色key
*/
private String roleKey;
/**
* 备注
*/
@Size(max = 200, message = "备注最大长度不超{max}")
private String remarks;
/**
* 菜单ID集
*/
private List<Long> menuIdList;
public String getLogValue() {
return String.format("sysCode:%s , roleName:%s , roleKey:%s ,operateBy:%s", this.sysCode, this.roleName, this.roleKey, this.getOperateBy());
}
}

@ -0,0 +1,28 @@
package com.sso.model.bo.role;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 角色修改 bo
*
* @author 程序员小强
*/
@Data
public class RoleUpdateBO extends RoleSaveBO {
private static final long serialVersionUID = -7337969581151948190L;
/**
* 角色ID
*/
@NotNull(message = "角色ID")
private Long roleId;
@Override
public String getLogValue() {
return String.format("sysCode:%s , roleId:%d , roleName:%s , roleKey:%s ,operateBy:%s", this.getSysCode(), roleId, this.getRoleName(), this.getRoleKey(), this.getOperateBy());
}
}

@ -0,0 +1,90 @@
package com.sso.model.bo.user;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
/**
* 用户新增bo
*
* @author 程序员小强
*/
@Data
public class UserAddBO extends BaseOperateBO {
private static final long serialVersionUID = -8559961404756899677L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 用户登录名
*/
@NotBlank(message = "用户登录名不为空")
private String username;
/**
* 密码
*/
@NotBlank(message = "用户登录密码不为空")
@Size(max = 20, message = "密码最大长度{max}")
private String password;
/**
* 用户昵称
*/
private String nickName;
/**
* 真实姓名
*/
private String realName;
/**
* 所属部门
*/
private Long deptId;
/**
* 角色ID集
*/
private List<Long> roleIdList;
/**
* 用户性别 0-;1-;2-未知
*/
private Integer sex;
/**
* 手机号码
*/
private String phone;
/**
* 邮箱
*/
private String email;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
/**
* 备注
*/
private String remarks;
public String getLogValue() {
return String.format("sysCode:%s , username:%s , realName:%s , phone:%s, deptId:%d , roleIdList:%s , operateBy:%s",
this.sysCode, this.username, this.realName, this.phone, this.deptId, this.roleIdList, this.getOperateBy());
}
}

@ -0,0 +1,32 @@
package com.sso.model.bo.user;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
/**
* 用户删除bo
*
* @author 程序员小强
*/
@Data
public class UserBatchDeleteBO extends BaseOperateBO {
private static final long serialVersionUID = 6811621712453725799L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 用户ID
*/
@Size(min = 1, message = "用户ID不为空")
private List<Long> userIdList;
}

@ -0,0 +1,32 @@
package com.sso.model.bo.user;
import com.sso.common.model.BaseOperateBO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
/**
* 用户删除bo
*
* @author 程序员小强
*/
@Data
public class UserDeleteBO extends BaseOperateBO {
private static final long serialVersionUID = -6260789437671185007L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 用户ID
*/
@Size(min = 1, message = "用户ID不为空")
private List<Long> userIdList;
}

@ -0,0 +1,31 @@
package com.sso.model.bo.user;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 用户查询详情bo
*
* @author 程序员小强
*/
@Data
public class UserDetailBO implements Serializable {
private static final long serialVersionUID = 8048715426913745373L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 用户ID
*/
@NotNull(message = "用户ID不为空")
private Long userId;
}

@ -0,0 +1,60 @@
package com.sso.model.bo.user;
import com.sso.common.model.page.BasePageModel;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 用户分页查询bo
*
* @author 程序员小强
*/
@Data
public class UserListPageBO extends BasePageModel {
private static final long serialVersionUID = 4627460201144477292L;
/**
* 系统编码
*/
@NotBlank(message = "系统编码不能为空")
private String sysCode;
/**
* 用户登录名
*/
private String usernameLike;
/**
* 用户昵称
*/
private String nickNameLike;
/**
* 真实姓名
*/
private String realNameLike;
/**
* 手机号码
*/
private String phoneLike;
/**
* 所属部门ID
*/
private Long deptId;
/**
* 角色ID
*/
private Long roleId;
/**
* 状态 0-正常;1-停用
*/
private Integer status;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save