map : loginSystemMap.entrySet()) {
+ String key = map.getKey();
+ String value = map.getValue();
+ if (key.equals(token)) {
+ continue;
+ }
+ if (StringUtils.isBlank(value)) {
+ continue;
+ }
+ SysLoginCacheVO loginCache = JSON.parseObject(value, SysLoginCacheVO.class);
+ if (StringUtils.isBlank(loginCache.getLoginOutUrl())) {
+ continue;
+ }
+ log.info("[ 登出子系统 ] >> sysCode:{},logoOutUrl:{}", key, loginCache.getLoginOutUrl());
+ HttpUtil.get(loginCache.getLoginOutUrl());
+ }
+ }
+
+ /**
+ * 设置用户代理信息
+ *
+ * @param loginResultVO 登录信息
+ */
+ public void setUserAgent(LoginResultVO loginResultVO) {
+ //IP地址相关
+ String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
+ loginResultVO.setSourceIp(ip);
+ loginResultVO.setSourceAddress(IpAddressUtils.getRealAddressByIP(ip));
+
+ //登录浏览器相关
+ UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
+ //浏览器名称
+ loginResultVO.setBrowserName(userAgent.getBrowser().getName());
+ //操作系统名称
+ loginResultVO.setOperateSystem(userAgent.getOperatingSystem().getName());
+ }
+
+ /**
+ * 获取请求token
+ *
+ * @param request
+ * @return token
+ */
+ private String getTokenByHeader(HttpServletRequest request) {
+ String token = request.getHeader(sysConfigProperty.getTokenHeader());
+ if (StringUtils.isNotEmpty(token) && token.startsWith(UserLoginConstants.TOKEN_PREFIX)) {
+ token = token.replace(UserLoginConstants.TOKEN_PREFIX, "");
+ }
+ return token;
+ }
+}
diff --git a/sso-auth-center-service/sso-business/src/main/java/com/sso/service/base/SysConfigService.java b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/base/SysConfigService.java
new file mode 100644
index 0000000..40e1b77
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/base/SysConfigService.java
@@ -0,0 +1,37 @@
+package com.sso.service.base;
+
+import com.sso.common.constant.SsoConstants;
+import com.sso.common.utils.StringUtils;
+import com.sso.framework.config.property.SysConfigProperty;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+/**
+ * 获取配置参数公共接口
+ *
+ * @author 程序员小强
+ */
+@Slf4j
+@Component
+public class SysConfigService {
+
+ @Resource
+ private SysConfigProperty sysConfigProperty;
+
+ /**
+ * 获取系统管理员用户ID
+ */
+ public Long getSupperAdminUserId() {
+ String supperAdminUser = sysConfigProperty.getSupperAdminUser();
+ if (StringUtils.isBlank(supperAdminUser)) {
+ return null;
+ }
+ String[] splitUser = supperAdminUser.split(SsoConstants.SPLIT_ESCAPE);
+ if (splitUser.length < 1) {
+ return null;
+ }
+ return Long.parseLong(splitUser[0]);
+ }
+}
diff --git a/sso-auth-center-service/sso-business/src/main/java/com/sso/service/base/SystemCacheService.java b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/base/SystemCacheService.java
new file mode 100644
index 0000000..9c546be
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/base/SystemCacheService.java
@@ -0,0 +1,71 @@
+package com.sso.service.base;
+
+import com.sso.common.constant.CacheConstants;
+import com.sso.common.utils.StringUtils;
+import com.sso.dao.entity.SsoSystem;
+import com.sso.dao.mapper.SsoSystemMapper;
+import com.sso.framework.redis.RedisCache;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.concurrent.TimeUnit;
+
+@Service
+public class SystemCacheService {
+
+ @Autowired
+ private RedisCache redisCache;
+
+ @Resource
+ private SsoSystemMapper ssoSystemMapper;
+
+ /**
+ * 获取系统配置 - 有缓存,优先获取缓存内容
+ *
+ * @param sysCode
+ */
+ public SsoSystem getBySysCode(String sysCode) {
+ if (StringUtils.isBlank(sysCode)) {
+ return null;
+ }
+
+ String systemCaptchaKey = CacheConstants.getSystemCaptchaKey(sysCode);
+
+ //查询缓存
+ SsoSystem systemFromCache = redisCache.get(systemCaptchaKey, SsoSystem.class);
+ if (null != systemFromCache) {
+ return systemFromCache;
+ }
+
+ //默认720分钟=12小时(配置不经常改变)
+ int expireMinutes = CacheConstants.SYSTEM_CONFIG_CACHE_EXPIRE;
+
+ SsoSystem systemFromDb = ssoSystemMapper.getBySysCode(sysCode);
+ if (null == systemFromDb) {
+ //数据库不存在-也缓存 -> 防止缓存穿透
+ systemFromDb = new SsoSystem();
+ //失效时间设置短一点
+ expireMinutes = CacheConstants.CAPTCHA_EXPIRE_FIVE;
+ }
+ //缓存到redis
+ redisCache.set(systemCaptchaKey, systemFromDb, expireMinutes, TimeUnit.MINUTES);
+
+ return systemFromDb;
+ }
+
+ /**
+ * 移除配置缓存
+ *
+ * 使用场景-编辑系统配置之后
+ *
+ * @param sysCode
+ */
+ public void removeSystemCache(String sysCode) {
+ if (StringUtils.isBlank(sysCode)) {
+ return;
+ }
+ String systemCaptchaKey = CacheConstants.getSystemCaptchaKey(sysCode);
+ redisCache.del(systemCaptchaKey);
+ }
+}
diff --git a/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/ApiClient.java b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/ApiClient.java
new file mode 100644
index 0000000..e3f7eb5
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/ApiClient.java
@@ -0,0 +1,205 @@
+/**
+ * Copyright ( @程序员小强 ) All Rights Reserved.
+ * 博客地址:https://blog.csdn.net/qq_38011415
+ */
+package com.sso.service.getway;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sso.common.enums.SignTypeEnum;
+import com.sso.common.enums.exception.ApiExceptionEnum;
+import com.sso.common.exception.BusinessException;
+import com.sso.common.model.result.ResultModel;
+import com.sso.common.utils.SsoSignUtil;
+import com.sso.common.utils.ValidateUtils;
+import com.sso.common.utils.sign.RSASignUtils;
+import com.sso.common.utils.sign.SignContentUtil;
+import com.sso.dao.entity.SsoSystem;
+import com.sso.framework.context.ApplicationContextHelper;
+import com.sso.framework.gateway.ApiContainer;
+import com.sso.framework.gateway.ApiModel;
+import com.sso.model.bo.getway.GetWayReqBO;
+import com.sso.service.base.SystemCacheService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.lang.reflect.InvocationTargetException;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Map;
+
+/**
+ * Api请求客户端
+ *
+ * @author 程序员小强
+ */
+@Slf4j
+@Service
+public class ApiClient {
+
+ /**
+ * jackson 序列化工具类
+ */
+ private static final ObjectMapper JSON_MAPPER = new ObjectMapper();
+
+ /**
+ * 时间最大间隔毫秒数
+ * 5分钟
+ */
+ private static final Long TIMESTAMP_MAX_BETWEEN = 300000L;
+
+ /**
+ * Api本地容器
+ */
+ private final ApiContainer apiContainer;
+
+ public ApiClient(ApiContainer apiContainer) {
+ this.apiContainer = apiContainer;
+ }
+
+ @Autowired
+ private SystemCacheService systemCacheService;
+
+
+ /**
+ * 校验时间戳
+ *
+ * @param reqBO
+ * @param paramMap
+ */
+ public void checkTimestamp(GetWayReqBO reqBO, Map paramMap) {
+ long timestamp = Long.parseLong(reqBO.getTimestamp());
+ long betweenTime = System.currentTimeMillis() - timestamp;
+
+ //间隔不能超过5分钟
+ if (Math.abs(betweenTime) > TIMESTAMP_MAX_BETWEEN) {
+ throw new BusinessException("请求时间间隔超时");
+ }
+ }
+
+ /**
+ * 验签
+ *
+ * @author 程序员小强
+ */
+ public void checkSign(GetWayReqBO reqBO, Map paramMap) {
+ SsoSystem ssoSystem = systemCacheService.getBySysCode(reqBO.getSysCode());
+ if (null == ssoSystem) {
+ throw new BusinessException("系统不存在");
+ }
+
+ //未配置公钥-不验签
+ if (SignTypeEnum.EMPTY.getValue().equals(ssoSystem.getSignType()) ||
+ StringUtils.isBlank(ssoSystem.getPublicKey())) {
+ log.warn("[ 未配置公钥或已配置不验签 ] >> sysCode:{}", ssoSystem.getSysCode());
+ return;
+ }
+
+ SignTypeEnum signValueType = SignTypeEnum.getByValue(reqBO.getSignType());
+ if (null == signValueType) {
+ //签名类型不存在
+ throw new BusinessException(ApiExceptionEnum.SIGN_TYPE_NOT_EXIST);
+ }
+
+ log.info("signType:{}, 验签参数 {}", reqBO.getSignType(), paramMap);
+ switch (signValueType) {
+ case MD5:
+ //MD5 签名校验
+ this.checkMd5Sign(paramMap, ssoSystem.getPublicKey());
+ break;
+ case RSA:
+ //RSA 签名校验
+ this.checkRsaSign(paramMap, ssoSystem.getPublicKey());
+ break;
+ default:
+ throw new BusinessException(ApiExceptionEnum.SIGN_TYPE_NOT_EXIST);
+ }
+ }
+
+ /**
+ * Api调用方法
+ *
+ * @param reqBO 请求参数
+ * @author 程序员小强
+ */
+ public ResultModel> invoke(GetWayReqBO reqBO) throws Throwable {
+ //获取api方法
+ ApiModel apiModel = apiContainer.get(reqBO.getMethod());
+
+ if (null == apiModel) {
+ log.info("[ API方法不存在 ] >> method = {}", reqBO.getMethod());
+ throw new BusinessException(ApiExceptionEnum.API_NOT_EXIST);
+ }
+
+ //获得spring bean
+ Object bean = ApplicationContextHelper.getBean(apiModel.getBeanName());
+ if (null == bean) {
+ log.warn("[ API方法不存在 ] >> method = {}, beanName = {}", reqBO.getMethod(), apiModel.getBeanName());
+ throw new BusinessException(ApiExceptionEnum.API_NOT_EXIST);
+ }
+
+ // 处理业务参数
+ // 忽略JSON字符串中存在,而在Java中不存在的属性
+ JSON_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+ Object result = JSON_MAPPER.readValue(StringUtils.isBlank(reqBO.getContent()) ? "{}" : reqBO.getContent(), Class.forName(apiModel.getParamName()));
+
+ //校验业务参数
+ ValidateUtils.validate(result);
+
+ //执行对应方法
+ try {
+ Object obj = apiModel.getMethod().invoke(bean, reqBO.getSysCode(), result);
+ return ResultModel.success(obj);
+ } catch (Exception e) {
+ if (e instanceof InvocationTargetException) {
+ throw ((InvocationTargetException) e).getTargetException();
+ }
+ log.info("[ invoke ] 异常 ", e);
+ throw new BusinessException(ApiExceptionEnum.SYSTEM_ERROR);
+ }
+ }
+
+ /**
+ * 校验MD5签名
+ *
+ * @param paramMap
+ * @param publicKey
+ */
+ private void checkMd5Sign(Map paramMap, String publicKey) {
+ //生成Md5签名
+ String sign = SsoSignUtil.getMd5Sign(paramMap, Arrays.asList("signType", "sign"), publicKey);
+ //入参中的签名
+ String requestSign = (String) paramMap.get("sign");
+ if (!sign.equals(requestSign)) {
+ log.info("[ MD5验签失败 ] >> sign:{}, requestSign:{} , params = {}", sign, requestSign, paramMap);
+ throw new BusinessException(ApiExceptionEnum.INVALID_SIGN);
+ }
+ }
+
+ /**
+ * 校验RSA 签名
+ *
+ * @param paramMap
+ * @param publicKey
+ */
+ private void checkRsaSign(Map paramMap, String publicKey) {
+ try {
+ String sign = (String) paramMap.get("sign");
+ //拼接生成签名的参数
+ String signContent = SignContentUtil.getSignContent(paramMap, Arrays.asList("sign", "signType"));
+ log.info("[ RSA 验签内容 ] >> signContent:{},sign:{}", signContent, sign);
+ boolean verify = RSASignUtils.verify(signContent.getBytes(StandardCharsets.UTF_8), publicKey, sign);
+ if (!verify) {
+ log.info("[ RSA 验签失败 ] >> signContent:{},sign:{}", signContent, sign);
+ throw new BusinessException(ApiExceptionEnum.INVALID_SIGN);
+ }
+ } catch (Exception e) {
+ log.error("[ RSA 验签异常 ] >> paramMap = {}, error = {}", paramMap, ExceptionUtils.getStackTrace(e));
+ throw new BusinessException(ApiExceptionEnum.INVALID_SIGN);
+ }
+ }
+
+}
diff --git a/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/ApplyAuthService.java b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/ApplyAuthService.java
new file mode 100644
index 0000000..794da31
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/ApplyAuthService.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright ( @程序员小强 ) All Rights Reserved.
+ * 博客地址:https://blog.csdn.net/qq_38011415
+ */
+package com.sso.service.getway;
+
+import com.sso.common.annotation.OpenApi;
+import com.sso.model.bo.getway.ApplyAuthBO;
+import com.sso.model.vo.getway.ApplyAuthVO;
+
+/**
+ * 申请认证开放接口
+ *
+ * @author 程序员小强
+ */
+public interface ApplyAuthService {
+
+ /**
+ * 申请认证开放接口
+ *
+ * @param authBO
+ */
+ @OpenApi(method = "com.sso.applyAuth", desc = "申请认证")
+ ApplyAuthVO applyAuth(String sysCode, ApplyAuthBO authBO);
+}
diff --git a/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/impl/ApplyAuthServiceImpl.java b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/impl/ApplyAuthServiceImpl.java
new file mode 100644
index 0000000..287d41a
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/java/com/sso/service/getway/impl/ApplyAuthServiceImpl.java
@@ -0,0 +1,188 @@
+/**
+ * Copyright ( @程序员小强 ) All Rights Reserved.
+ * 博客地址:https://blog.csdn.net/qq_38011415
+ */
+package com.sso.service.getway.impl;
+
+import com.sso.common.annotation.OpenApiService;
+import com.sso.common.constant.CacheConstants;
+import com.sso.common.constant.SsoConstants;
+import com.sso.common.enums.MenuTypeEnum;
+import com.sso.common.exception.BusinessException;
+import com.sso.common.model.login.LoginResultVO;
+import com.sso.common.model.login.LoginUserVO;
+import com.sso.common.utils.StringUtils;
+import com.sso.common.utils.bean.BeanCopierUtil;
+import com.sso.common.utils.tree.ListToTreeUtil;
+import com.sso.dao.entity.SsoMenu;
+import com.sso.dao.entity.SsoSystem;
+import com.sso.dao.mapper.SsoMenuMapper;
+import com.sso.dao.mapper.SsoOnlineUserMapper;
+import com.sso.dao.mapper.SsoRoleMapper;
+import com.sso.framework.config.property.SysConfigProperty;
+import com.sso.framework.redis.RedisCache;
+import com.sso.model.bo.getway.ApplyAuthBO;
+import com.sso.model.vo.getway.ApplyAuthVO;
+import com.sso.model.vo.getway.MenuTreeAuthVO;
+import com.sso.model.vo.getway.SysLoginCacheVO;
+import com.sso.service.base.SystemCacheService;
+import com.sso.service.getway.ApplyAuthService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.math.NumberUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 申请认证开放接口
+ *
+ * @author 程序员小强
+ */
+@Slf4j
+@Service
+@OpenApiService
+public class ApplyAuthServiceImpl implements ApplyAuthService {
+
+ @Autowired
+ private RedisCache redisCache;
+ @Resource
+ private SsoMenuMapper ssoMenuMapper;
+ @Resource
+ private SsoRoleMapper ssoRoleMapper;
+ @Resource
+ private SsoOnlineUserMapper ssoOnlineUserMapper;
+ @Autowired
+ private SystemCacheService systemCacheService;
+ @Autowired
+ private SysConfigProperty sysConfigProperty;
+
+ private static final Integer MENU_TYPE_TREE = 2;
+
+ /**
+ * 申请认证开放接口
+ *
+ * @param authBO
+ */
+ @Override
+ public ApplyAuthVO applyAuth(String sysCode, ApplyAuthBO authBO) {
+ //根据sysCode查询目标系统跳转地址
+ SsoSystem system = systemCacheService.getBySysCode(sysCode);
+ if (system == null) {
+ throw new BusinessException("系统不存在");
+ }
+
+ //入参token为空,说明未登录,返回扫码授权url
+ if (StringUtils.isEmpty(authBO.getSsoToken())) {
+ log.info("[ 认证失败 ] >> token 为空 ,返回认证中心登录地址 ");
+ return ApplyAuthVO.authFailNeedLogin(sysConfigProperty.getSsoLoginUrl());
+ }
+
+ //toke缓存key
+ String tokenCacheKey = CacheConstants.getLoginUserTokenKey(authBO.getSsoToken());
+ LoginResultVO loginUserInfo = redisCache.hGet(tokenCacheKey, authBO.getSsoToken(), LoginResultVO.class);
+ //根据token获取redis缓存数据,取不到,说明token已经过期
+ if (loginUserInfo == null || ObjectUtils.isEmpty(loginUserInfo.getUser())) {
+ log.info("[ 认证失败 ] >> token 已失效或不存在 ,返回认证中心登录地址 ");
+ String targetRedirectUrl = StringUtils.isNoneBlank(authBO.getRedirectUrl()) ? authBO.getRedirectUrl() : system.getSysUrl();
+ return ApplyAuthVO.authFailNeedLogin(sysConfigProperty.getSsoLoginUrl(), targetRedirectUrl);
+ }
+
+ //构建返回信息
+ ApplyAuthVO result = this.buildApplyUserAuth(system, loginUserInfo);
+ //角色key标识集
+ result.setRoleKeyList(ssoRoleMapper.getRoleKeyBySysCodeAndUserId(sysCode, result.getUserId()));
+
+ //构建菜单与权限信息
+ this.buildMenuAndPermission(sysCode, result, authBO, result.getUserId());
+
+ //token有效-认证后 刷新token有效时间
+ String userIdCacheKey = CacheConstants.getLoginUserIdKey(result.getUserId());
+ loginUserInfo.setExpireTime(System.currentTimeMillis() + sysConfigProperty.getTokenExpireTime() * 1000);
+ //记录用户-注册的子系统
+ redisCache.hSet(tokenCacheKey, sysCode, new SysLoginCacheVO(sysCode, authBO.getLoginOutUrl(), System.currentTimeMillis()));
+ //刷新用户缓存有效期
+ redisCache.set(userIdCacheKey, loginUserInfo, sysConfigProperty.getTokenExpireTime(), TimeUnit.MINUTES);
+ //刷新token有效期
+ redisCache.hSet(tokenCacheKey, loginUserInfo.getToken(), loginUserInfo, sysConfigProperty.getTokenExpireTime(), TimeUnit.MINUTES);
+
+ //刷新登录记录表效期
+ if (StringUtils.isNotBlank(loginUserInfo.getRequestId())) {
+ ssoOnlineUserMapper.refreshExpireTimeByRequestId(loginUserInfo.getRequestId(), loginUserInfo.getExpireTime());
+ }
+
+ log.info("[ 认证成功 ] >> sysCode:{} , ssoToken:{} ", sysCode, authBO.getSsoToken());
+ return result;
+ }
+
+ /**
+ * 构建菜单与权限返回信息
+ *
+ * @param result
+ * @param authBO
+ * @param userId
+ */
+ private void buildMenuAndPermission(String sysCode, ApplyAuthVO result, ApplyAuthBO authBO, Long userId) {
+ //根据用户查询拥有的菜单权限
+ List menuList = ssoMenuMapper.getMenuListBySysCodeAndUserId(sysCode, userId);
+ if (CollectionUtils.isEmpty(menuList)) {
+ result.setMenuList(new ArrayList<>(0));
+ result.setPermissionList(new HashSet<>(0));
+ return;
+ }
+
+ MenuTreeAuthVO menuVO = null;
+ List menuResList = new ArrayList<>(menuList.size());
+ //权限标识集
+ Set permissionList = new HashSet<>(menuList.size());
+ for (SsoMenu menu : menuList) {
+ if (StringUtils.isNotBlank(menu.getPermissions())) {
+ permissionList.addAll(Arrays.asList(menu.getPermissions().split(SsoConstants.SPLIT_ESCAPE)));
+ }
+ //菜单
+ if (MenuTypeEnum.isMenu(menu.getMenuType())) {
+ menuVO = BeanCopierUtil.copy(menu, MenuTreeAuthVO.class);
+ menuResList.add(menuVO);
+ }
+ }
+
+ result.setMenuList(menuResList);
+ result.setPermissionList(permissionList);
+
+ //非树结构返回
+ if (!MENU_TYPE_TREE.equals(NumberUtils.toInt(authBO.getMenuType(), 0))) {
+ return;
+ }
+
+ //树结构返回 >> 转换成树返回
+ ListToTreeUtil treeUtil = new ListToTreeUtil<>();
+ result.setMenuList(treeUtil.getTreeListObject(result.getMenuList()));
+ }
+
+ /**
+ * 构建用户基本认证信息
+ *
+ * @param loginUserInfo
+ */
+ private ApplyAuthVO buildApplyUserAuth(SsoSystem system, LoginResultVO loginUserInfo) {
+ LoginUserVO user = loginUserInfo.getUser();
+ ApplyAuthVO result = new ApplyAuthVO();
+ result.setSysCode(system.getSysCode());
+ result.setSysName(system.getSysName());
+ result.setAuthResult(true);
+ result.setUserId(user.getUserId());
+ result.setUsername(user.getUsername());
+ result.setNickName(user.getNickName());
+ result.setRealName(user.getRealName());
+ result.setAvatar(user.getAvatar());
+ result.setSex(user.getSex());
+ result.setPhone(user.getPhone());
+ result.setEmail(user.getEmail());
+ return result;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoDeptMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoDeptMapper.xml
new file mode 100644
index 0000000..a65b291
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoDeptMapper.xml
@@ -0,0 +1,319 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dept_id,
+ dept_name,
+ sys_code,
+ dept_parent_id,
+ sort_num,
+ status,
+ del_flag,
+ remarks,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+
+
+
+ a.dept_id,
+ a.dept_name,
+ a.sys_code,
+ a.dept_parent_id,
+ a.sort_num,
+ a.status,
+ a.del_flag,
+ a.remarks,
+ a.create_by,
+ a.update_by,
+ a.create_time,
+ a.update_time
+
+
+
+
+
+
+
+ INSERT INTO sso_dept
+ (
+ dept_id,
+ dept_name,
+ sys_code,
+ dept_parent_id,
+ sort_num,
+ status,
+ del_flag,
+ remarks,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+ )
+ values
+ (
+ #{deptId,jdbcType=BIGINT},
+ #{deptName,jdbcType=VARCHAR},
+ #{sysCode,jdbcType=VARCHAR},
+ #{deptParentId,jdbcType=BIGINT},
+ #{sortNum,jdbcType=INTEGER},
+ #{status,jdbcType=INTEGER},
+ #{delFlag,jdbcType=INTEGER},
+ #{remarks,jdbcType=VARCHAR},
+ #{createBy,jdbcType=VARCHAR},
+ #{updateBy,jdbcType=VARCHAR},
+ #{createTime,jdbcType=TIMESTAMP},
+ #{updateTime,jdbcType=TIMESTAMP}
+ )
+
+
+
+ INSERT INTO sso_dept
+
+
+ dept_id,
+
+
+ dept_name,
+
+
+ sys_code,
+
+
+ dept_parent_id,
+
+
+ sort_num,
+
+
+ status,
+
+
+ del_flag,
+
+
+ remarks,
+
+
+ create_by,
+
+
+ update_by,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{deptId,jdbcType=BIGINT},
+
+
+ #{deptName,jdbcType=VARCHAR},
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{deptParentId,jdbcType=BIGINT},
+
+
+ #{sortNum,jdbcType=INTEGER},
+
+
+ #{status,jdbcType=INTEGER},
+
+
+ #{delFlag,jdbcType=INTEGER},
+
+
+ #{remarks,jdbcType=VARCHAR},
+
+
+ #{createBy,jdbcType=VARCHAR},
+
+
+ #{updateBy,jdbcType=VARCHAR},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+
+ UPDATE sso_dept
+ SET
+ dept_name = #{deptName,jdbcType=VARCHAR},
+ dept_parent_id = #{deptParentId,jdbcType=BIGINT},
+ sort_num = #{sortNum,jdbcType=INTEGER},
+ status = #{status,jdbcType=INTEGER},
+ remarks = #{remarks,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE dept_id = #{deptId,jdbcType=BIGINT}
+
+
+
+
+ UPDATE sso_dept a
+ INNER JOIN sso_dept_tree_path t ON a.dept_id = t.ancestor AND a.dept_id != #{deptId,jdbcType=BIGINT}
+ SET
+ status = #{status,jdbcType=INTEGER},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE t.descendant = #{deptId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_dept
+
+
+ dept_name = #{deptName,jdbcType=VARCHAR},
+
+
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+
+
+ dept_parent_id = #{deptParentId,jdbcType=BIGINT},
+
+
+ sort_num = #{sortNum,jdbcType=INTEGER},
+
+
+ status = #{status,jdbcType=INTEGER},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ remarks = #{remarks,jdbcType=VARCHAR},
+
+
+ create_by = #{createBy,jdbcType=VARCHAR},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE dept_id = #{deptId,jdbcType=BIGINT}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoDeptTreePathMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoDeptTreePathMapper.xml
new file mode 100644
index 0000000..6ebf400
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoDeptTreePathMapper.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+ ancestor,
+ descendant
+
+
+
+
+ INSERT INTO sso_dept_tree_path (ancestor,descendant)
+ SELECT t.ancestor,#{deptId,jdbcType=BIGINT} FROM sso_dept_tree_path AS t
+ WHERE t.descendant = #{deptParentId,jdbcType=BIGINT}
+ UNION ALL
+ SELECT #{deptId,jdbcType=BIGINT},#{deptId,jdbcType=BIGINT}
+
+
+
+
+ DELETE FROM
+ sso_dept_tree_path WHERE descendant = #{deptId,jdbcType=BIGINT}
+
+
+
+
+ DELETE FROM
+ sso_dept_tree_path
+ WHERE descendant
+ IN (SELECT a.dept_id from (SELECT descendant dept_id FROM sso_dept_tree_path WHERE ancestor =
+ #{deptId,jdbcType=BIGINT}) a )
+
+
+
+
+
+
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoLoginLogMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoLoginLogMapper.xml
new file mode 100644
index 0000000..a9a5663
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoLoginLogMapper.xml
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ id,
+ request_id,
+ username,
+ source_ip,
+ source_address,
+ browser_name,
+ operate_system,
+ status,
+ login_time,
+ operate_msg,
+ create_time,
+ update_time
+
+
+
+
+
+
+
+
+
+ INSERT INTO sso_login_log
+ (
+ id,
+ request_id,
+ username,
+ source_ip,
+ source_address,
+ browser_name,
+ operate_system,
+ status,
+ login_time,
+ operate_msg,
+ create_time,
+ update_time
+ )
+ values
+ (
+ #{id,jdbcType=BIGINT},
+ #{requestId,jdbcType=VARCHAR},
+ #{username,jdbcType=VARCHAR},
+ #{sourceIp,jdbcType=VARCHAR},
+ #{sourceAddress,jdbcType=VARCHAR},
+ #{browserName,jdbcType=VARCHAR},
+ #{operateSystem,jdbcType=VARCHAR},
+ #{status,jdbcType=INTEGER},
+ #{loginTime,jdbcType=BIGINT},
+ #{operateMsg,jdbcType=VARCHAR},
+ #{createTime,jdbcType=TIMESTAMP},
+ #{updateTime,jdbcType=TIMESTAMP}
+ )
+
+
+
+ INSERT INTO sso_login_log
+
+
+ id,
+
+
+ request_id,
+
+
+ username,
+
+
+ source_ip,
+
+
+ source_address,
+
+
+ browser_name,
+
+
+ operate_system,
+
+
+ status,
+
+
+ login_time,
+
+
+ operate_msg,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{id,jdbcType=BIGINT},
+
+
+ #{requestId,jdbcType=VARCHAR},
+
+
+ #{username,jdbcType=VARCHAR},
+
+
+ #{sourceIp,jdbcType=VARCHAR},
+
+
+ #{sourceAddress,jdbcType=VARCHAR},
+
+
+ #{browserName,jdbcType=VARCHAR},
+
+
+ #{operateSystem,jdbcType=VARCHAR},
+
+
+ #{status,jdbcType=INTEGER},
+
+
+ #{loginTime,jdbcType=BIGINT},
+
+
+ #{operateMsg,jdbcType=VARCHAR},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+ DELETE FROM sso_login_log
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_login_log
+ SET
+ request_id = #{requestId,jdbcType=VARCHAR},
+ username = #{username,jdbcType=VARCHAR},
+ source_ip = #{sourceIp,jdbcType=VARCHAR},
+ source_address = #{sourceAddress,jdbcType=VARCHAR},
+ browser_name = #{browserName,jdbcType=VARCHAR},
+ operate_system = #{operateSystem,jdbcType=VARCHAR},
+ status = #{status,jdbcType=INTEGER},
+ login_time = #{loginTime,jdbcType=BIGINT},
+ operate_msg = #{operateMsg,jdbcType=VARCHAR},
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ update_time = #{updateTime,jdbcType=TIMESTAMP}
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_login_log
+
+
+ request_id = #{requestId,jdbcType=VARCHAR},
+
+
+ username = #{username,jdbcType=VARCHAR},
+
+
+ source_ip = #{sourceIp,jdbcType=VARCHAR},
+
+
+ source_address = #{sourceAddress,jdbcType=VARCHAR},
+
+
+ browser_name = #{browserName,jdbcType=VARCHAR},
+
+
+ operate_system = #{operateSystem,jdbcType=VARCHAR},
+
+
+ status = #{status,jdbcType=INTEGER},
+
+
+ login_time = #{loginTime,jdbcType=BIGINT},
+
+
+ operate_msg = #{operateMsg,jdbcType=VARCHAR},
+
+
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoMenuMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoMenuMapper.xml
new file mode 100644
index 0000000..4d53909
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoMenuMapper.xml
@@ -0,0 +1,418 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ menu_id,
+ menu_name,
+ sys_code,
+ menu_type,
+ menu_parent_id,
+ sort_num,
+ path,
+ icon,
+ component,
+ permissions,
+ use_type,
+ visible,
+ status,
+ del_flag,
+ remarks,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+
+
+
+ a.menu_id,
+ a.menu_name,
+ a.sys_code,
+ a.menu_type,
+ a.menu_parent_id,
+ a.sort_num,
+ a.path,
+ a.icon,
+ a.component,
+ a.permissions,
+ a.use_type,
+ a.visible,
+ a.status,
+ a.del_flag,
+ a.remarks,
+ a.create_by,
+ a.update_by,
+ a.create_time,
+ a.update_time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO sso_menu
+ (
+ menu_id,
+ menu_name,
+ sys_code,
+ menu_type,
+ menu_parent_id,
+ sort_num,
+ path,
+ icon,
+ component,
+ permissions,
+ use_type,
+ visible,
+ status,
+ del_flag,
+ remarks,
+ create_by,
+ update_by
+ )
+ values
+ (
+ #{menuId,jdbcType=BIGINT},
+ #{menuName,jdbcType=VARCHAR},
+ #{sysCode,jdbcType=VARCHAR},
+ #{menuType,jdbcType=VARCHAR},
+ #{menuParentId,jdbcType=BIGINT},
+ #{sortNum,jdbcType=INTEGER},
+ #{path,jdbcType=VARCHAR},
+ #{icon,jdbcType=VARCHAR},
+ #{component,jdbcType=VARCHAR},
+ #{permissions,jdbcType=VARCHAR},
+ #{useType,jdbcType=INTEGER},
+ #{visible,jdbcType=INTEGER},
+ #{status,jdbcType=INTEGER},
+ #{delFlag,jdbcType=INTEGER},
+ #{remarks,jdbcType=VARCHAR},
+ #{createBy,jdbcType=VARCHAR},
+ #{updateBy,jdbcType=VARCHAR}
+ )
+
+
+
+ INSERT INTO sso_menu
+
+
+ menu_name,
+
+
+ sys_code,
+
+
+ menu_type,
+
+
+ menu_parent_id,
+
+
+ sort_num,
+
+
+ path,
+
+
+ icon,
+
+
+ component,
+
+
+ permissions,
+
+
+ use_type,
+
+
+ visible,
+
+
+ status,
+
+
+ del_flag,
+
+
+ remarks,
+
+
+ create_by,
+
+
+ update_by,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{menuName,jdbcType=VARCHAR},
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{menuType,jdbcType=VARCHAR},
+
+
+ #{menuParentId,jdbcType=BIGINT},
+
+
+ #{sortNum,jdbcType=INTEGER},
+
+
+ #{path,jdbcType=VARCHAR},
+
+
+ #{icon,jdbcType=VARCHAR},
+
+
+ #{component,jdbcType=VARCHAR},
+
+
+ #{permissions,jdbcType=VARCHAR},
+
+
+ #{useType,jdbcType=INTEGER},
+
+
+ #{visible,jdbcType=INTEGER},
+
+
+ #{status,jdbcType=INTEGER},
+
+
+ #{delFlag,jdbcType=INTEGER},
+
+
+ #{remarks,jdbcType=VARCHAR},
+
+
+ #{createBy,jdbcType=VARCHAR},
+
+
+ #{updateBy,jdbcType=VARCHAR},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoOnlineUserMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoOnlineUserMapper.xml
new file mode 100644
index 0000000..7f0623f
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoOnlineUserMapper.xml
@@ -0,0 +1,312 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ id,
+ request_id,
+ user_id,
+ source_ip,
+ source_address,
+ browser_name,
+ operate_system,
+ login_time,
+ login_out_time,
+ expire_time,
+ create_time,
+ update_time
+
+
+
+
+
+ INSERT INTO sso_online_user
+ (
+ id,
+ request_id,
+ user_id,
+ source_ip,
+ source_address,
+ browser_name,
+ operate_system,
+ login_time,
+ login_out_time,
+ expire_time,
+ create_time,
+ update_time
+ )
+ values
+ (
+ #{id,jdbcType=BIGINT},
+ #{requestId,jdbcType=VARCHAR},
+ #{userId,jdbcType=BIGINT},
+ #{sourceIp,jdbcType=VARCHAR},
+ #{sourceAddress,jdbcType=VARCHAR},
+ #{browserName,jdbcType=VARCHAR},
+ #{operateSystem,jdbcType=VARCHAR},
+ #{loginTime,jdbcType=BIGINT},
+ #{loginOutTime,jdbcType=BIGINT},
+ #{expireTime,jdbcType=BIGINT},
+ #{createTime,jdbcType=TIMESTAMP},
+ #{updateTime,jdbcType=TIMESTAMP}
+ )
+
+
+
+ INSERT INTO sso_online_user
+
+
+ id,
+
+
+ request_id,
+
+
+ user_id,
+
+
+ source_ip,
+
+
+ source_address,
+
+
+ browser_name,
+
+
+ operate_system,
+
+
+ login_time,
+
+
+ login_out_time,
+
+
+ expire_time,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{id,jdbcType=BIGINT},
+
+
+ #{requestId,jdbcType=VARCHAR},
+
+
+ #{userId,jdbcType=BIGINT},
+
+
+ #{sourceIp,jdbcType=VARCHAR},
+
+
+ #{sourceAddress,jdbcType=VARCHAR},
+
+
+ #{browserName,jdbcType=VARCHAR},
+
+
+ #{operateSystem,jdbcType=VARCHAR},
+
+
+ #{loginTime,jdbcType=BIGINT},
+
+
+ #{loginOutTime,jdbcType=BIGINT},
+
+
+ #{expireTime,jdbcType=BIGINT},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+ DELETE FROM sso_online_user
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_online_user
+ SET
+ request_id = #{requestId,jdbcType=VARCHAR},
+ user_id = #{userId,jdbcType=BIGINT},
+ source_ip = #{sourceIp,jdbcType=VARCHAR},
+ source_address = #{sourceAddress,jdbcType=VARCHAR},
+ browser_name = #{browserName,jdbcType=VARCHAR},
+ operate_system = #{operateSystem,jdbcType=VARCHAR},
+ login_time = #{loginTime,jdbcType=BIGINT},
+ login_out_time = #{loginOutTime,jdbcType=BIGINT},
+ expire_time = #{expireTime,jdbcType=BIGINT},
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ update_time = #{updateTime,jdbcType=TIMESTAMP}
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_online_user
+
+
+ request_id = #{requestId,jdbcType=VARCHAR},
+
+
+ user_id = #{userId,jdbcType=BIGINT},
+
+
+ source_ip = #{sourceIp,jdbcType=VARCHAR},
+
+
+ source_address = #{sourceAddress,jdbcType=VARCHAR},
+
+
+ browser_name = #{browserName,jdbcType=VARCHAR},
+
+
+ operate_system = #{operateSystem,jdbcType=VARCHAR},
+
+
+ login_time = #{loginTime,jdbcType=BIGINT},
+
+
+ login_out_time = #{loginOutTime,jdbcType=BIGINT},
+
+
+ expire_time = #{expireTime,jdbcType=BIGINT},
+
+
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+
+
+
+
+ UPDATE sso_online_user
+ SET
+ expire_time = #{expireTime,jdbcType=BIGINT}
+ WHERE request_id = #{requestId,jdbcType=VARCHAR}
+
+
+
+ UPDATE sso_online_user
+ SET
+ expire_time = #{expireTime,jdbcType=BIGINT},
+ login_out_time = #{loginOutTime,jdbcType=BIGINT}
+ WHERE request_id = #{requestId,jdbcType=VARCHAR}
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoRoleMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoRoleMapper.xml
new file mode 100644
index 0000000..9eea846
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoRoleMapper.xml
@@ -0,0 +1,297 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ role_id,
+ sys_code,
+ role_name,
+ role_key,
+ status,
+ sort_num,
+ del_flag,
+ remarks,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO sso_role
+ (
+ role_id,
+ sys_code,
+ role_name,
+ role_key,
+ status,
+ sort_num,
+ del_flag,
+ remarks,
+ create_by,
+ update_by
+ )
+ values
+ (
+ #{roleId,jdbcType=BIGINT},
+ #{sysCode,jdbcType=VARCHAR},
+ #{roleName,jdbcType=VARCHAR},
+ #{roleKey,jdbcType=VARCHAR},
+ #{status,jdbcType=INTEGER},
+ #{sortNum,jdbcType=INTEGER},
+ #{delFlag,jdbcType=INTEGER},
+ #{remarks,jdbcType=VARCHAR},
+ #{createBy,jdbcType=VARCHAR},
+ #{updateBy,jdbcType=VARCHAR}
+ )
+
+
+
+ INSERT INTO sso_role
+
+
+ role_id,
+
+
+ sys_code,
+
+
+ role_name,
+
+
+ role_key,
+
+
+ status,
+
+
+ sort_num,
+
+
+ del_flag,
+
+
+ remarks,
+
+
+ create_by,
+
+
+ update_by,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{roleId,jdbcType=BIGINT},
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{roleName,jdbcType=VARCHAR},
+
+
+ #{roleKey,jdbcType=VARCHAR},
+
+
+ #{status,jdbcType=INTEGER},
+
+
+ #{sortNum,jdbcType=INTEGER},
+
+
+ #{delFlag,jdbcType=INTEGER},
+
+
+ #{remarks,jdbcType=VARCHAR},
+
+
+ #{createBy,jdbcType=VARCHAR},
+
+
+ #{updateBy,jdbcType=VARCHAR},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+ UPDATE sso_role
+ SET
+ role_name = #{roleName,jdbcType=VARCHAR},
+ role_key = #{roleKey,jdbcType=VARCHAR},
+ status = #{status,jdbcType=INTEGER},
+ sort_num = #{sortNum,jdbcType=INTEGER},
+ remarks = #{remarks,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE role_id = #{roleId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_role
+
+
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+
+
+ role_name = #{roleName,jdbcType=VARCHAR},
+
+
+ role_key = #{roleKey,jdbcType=VARCHAR},
+
+
+ status = #{status,jdbcType=INTEGER},
+
+
+ sort_num = #{sortNum,jdbcType=INTEGER},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ remarks = #{remarks,jdbcType=VARCHAR},
+
+
+ create_by = #{createBy,jdbcType=VARCHAR},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE role_id = #{roleId,jdbcType=BIGINT}
+
+
+
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoRoleMenuMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoRoleMenuMapper.xml
new file mode 100644
index 0000000..84c19c3
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoRoleMenuMapper.xml
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sys_code,
+ role_id,
+ menu_id,
+ create_time,
+ update_time
+
+
+
+
+
+
+ INSERT INTO sso_role_menu
+ (
+ sys_code,
+ role_id,
+ menu_id
+ )
+ VALUES
+
+ (
+ #{item.sysCode,jdbcType=VARCHAR},
+ #{item.roleId,jdbcType=BIGINT},
+ #{item.menuId,jdbcType=BIGINT}
+ )
+
+
+
+
+ INSERT INTO sso_role_menu
+ (
+ sys_code,
+ role_id,
+ menu_id
+ )
+ values
+ (
+ #{sysCode,jdbcType=VARCHAR},
+ #{roleId,jdbcType=BIGINT},
+ #{menuId,jdbcType=BIGINT}
+ )
+
+
+
+ INSERT INTO sso_role_menu
+
+
+ sys_code,
+
+
+ role_id,
+
+
+ menu_id,
+
+
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{roleId,jdbcType=BIGINT},
+
+
+ #{menuId,jdbcType=BIGINT},
+
+
+
+
+
+ DELETE FROM sso_role_menu
+ WHERE role_id = #{roleId,jdbcType=BIGINT}
+
+
+
+
+
+ UPDATE sso_role_menu
+ SET
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+ role_id = #{roleId,jdbcType=BIGINT},
+ menu_id = #{menuId,jdbcType=BIGINT}
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_role_menu
+
+
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+
+
+ role_id = #{roleId,jdbcType=BIGINT},
+
+
+ menu_id = #{menuId,jdbcType=BIGINT},
+
+
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoSystemManagerMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoSystemManagerMapper.xml
new file mode 100644
index 0000000..1403a2e
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoSystemManagerMapper.xml
@@ -0,0 +1,276 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ id,
+ user_id,
+ sys_code,
+ status,
+ del_flag,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO sso_system_manager
+ (
+ id,
+ user_id,
+ sys_code,
+ status,
+ del_flag,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+ )
+ values
+ (
+ #{id,jdbcType=BIGINT},
+ #{userId,jdbcType=BIGINT},
+ #{sysCode,jdbcType=VARCHAR},
+ #{status,jdbcType=INTEGER},
+ #{delFlag,jdbcType=INTEGER},
+ #{createBy,jdbcType=VARCHAR},
+ #{updateBy,jdbcType=VARCHAR},
+ #{createTime,jdbcType=TIMESTAMP},
+ #{updateTime,jdbcType=TIMESTAMP}
+ )
+
+
+
+ INSERT INTO sso_system_manager
+
+
+ id,
+
+
+ user_id,
+
+
+ sys_code,
+
+
+ status,
+
+
+ del_flag,
+
+
+ create_by,
+
+
+ update_by,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{id,jdbcType=BIGINT},
+
+
+ #{userId,jdbcType=BIGINT},
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{status,jdbcType=INTEGER},
+
+
+ #{delFlag,jdbcType=INTEGER},
+
+
+ #{createBy,jdbcType=VARCHAR},
+
+
+ #{updateBy,jdbcType=VARCHAR},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+ UPDATE sso_system_manager
+
+
+ status = #{status,jdbcType=INTEGER},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_system_manager
+
+
+ status = #{status,jdbcType=INTEGER},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ WHERE del_flag = 0
+ AND user_id = #{userId,jdbcType=BIGINT}
+ AND sys_code = #{sysCode,jdbcType=VARCHAR}
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoSystemMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoSystemMapper.xml
new file mode 100644
index 0000000..1b13068
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoSystemMapper.xml
@@ -0,0 +1,394 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sys_id,
+ sys_code,
+ sys_name,
+ sys_grant_code,
+ sys_url,
+ sys_icon,
+ sys_env,
+ sort_num,
+ remarks,
+ sign_type,
+ public_key,
+ status,
+ del_flag,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+
+
+ a.sys_id,
+ a.sys_code,
+ a.sys_name,
+ a.sys_grant_code,
+ a.sys_url,
+ a.sys_icon,
+ a.sys_env,
+ a.sort_num,
+ a.remarks,
+ a.sign_type,
+ a.public_key,
+ a.status,
+ a.del_flag,
+ a.create_by,
+ a.update_by,
+ a.create_time,
+ a.update_time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO sso_system
+ (
+ sys_id,
+ sys_code,
+ sys_name,
+ sys_grant_code,
+ sys_url,
+ sys_icon,
+ sys_env,
+ sort_num,
+ remarks,
+ sign_type,
+ public_key,
+ status,
+ del_flag,
+ create_by,
+ update_by
+ )
+ values
+ (
+ #{sysId,jdbcType=BIGINT},
+ #{sysCode,jdbcType=VARCHAR},
+ #{sysName,jdbcType=VARCHAR},
+ #{sysGrantCode,jdbcType=VARCHAR},
+ #{sysUrl,jdbcType=VARCHAR},
+ #{sysIcon,jdbcType=VARCHAR},
+ #{sysEnv,jdbcType=INTEGER},
+ #{sortNum,jdbcType=INTEGER},
+ #{remarks,jdbcType=VARCHAR},
+ #{signType,jdbcType=INTEGER},
+ #{publicKey,jdbcType=VARCHAR},
+ #{status,jdbcType=INTEGER},
+ #{delFlag,jdbcType=INTEGER},
+ #{createBy,jdbcType=VARCHAR},
+ #{updateBy,jdbcType=VARCHAR}
+ )
+
+
+
+ INSERT INTO sso_system
+
+
+ sys_id,
+
+
+ sys_code,
+
+
+ sys_name,
+
+
+ sys_grant_code,
+
+
+ sys_url,
+
+
+ sys_icon,
+
+
+ sys_env,
+
+
+ sort_num,
+
+
+ remarks,
+
+
+ sign_type,
+
+
+ public_key,
+
+
+ status,
+
+
+ del_flag,
+
+
+ create_by,
+
+
+ update_by,
+
+
+
+
+ #{sysId,jdbcType=BIGINT},
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{sysName,jdbcType=VARCHAR},
+
+
+ #{sysGrantCode,jdbcType=VARCHAR},
+
+
+ #{sysUrl,jdbcType=VARCHAR},
+
+
+ #{sysIcon,jdbcType=VARCHAR},
+
+
+ #{sysEnv,jdbcType=INTEGER},
+
+
+ #{sortNum,jdbcType=INTEGER},
+
+
+ #{remarks,jdbcType=VARCHAR},
+
+
+ #{signType,jdbcType=INTEGER},
+
+
+ #{publicKey,jdbcType=VARCHAR},
+
+
+ #{status,jdbcType=INTEGER},
+
+
+ #{delFlag,jdbcType=INTEGER},
+
+
+ #{createBy,jdbcType=VARCHAR},
+
+
+ #{updateBy,jdbcType=VARCHAR},
+
+
+
+
+
+ UPDATE sso_system
+ SET
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+ sys_name = #{sysName,jdbcType=VARCHAR},
+ sys_grant_code = #{sysGrantCode,jdbcType=VARCHAR},
+ sys_url = #{sysUrl,jdbcType=VARCHAR},
+ sys_icon = #{sysIcon,jdbcType=VARCHAR},
+ sys_env = #{sysEnv,jdbcType=INTEGER},
+ sort_num = #{sortNum,jdbcType=INTEGER},
+ remarks = #{remarks,jdbcType=VARCHAR},
+ status = #{status,jdbcType=INTEGER},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE sys_id = #{sysId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_system
+ SET
+ sign_type = #{signType,jdbcType=INTEGER},
+ public_key = #{publicKey,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE sys_id = #{sysId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_system
+ SET
+ sys_icon = #{sysIcon,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE sys_id = #{sysId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_system
+
+
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+
+
+ sys_name = #{sysName,jdbcType=VARCHAR},
+
+
+ sys_grant_code = #{sysGrantCode,jdbcType=VARCHAR},
+
+
+ sys_url = #{sysUrl,jdbcType=VARCHAR},
+
+
+ sys_icon = #{sysIcon,jdbcType=VARCHAR},
+
+
+ sys_env = #{sysEnv,jdbcType=INTEGER},
+
+
+ sort_num = #{sort,jdbcType=INTEGER},
+
+
+ remarks = #{remarks,jdbcType=VARCHAR},
+
+
+ sign_type = #{signType,jdbcType=INTEGER},
+
+
+ public_key = #{publicKey,jdbcType=VARCHAR},
+
+
+ status = #{status,jdbcType=INTEGER},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ WHERE sys_id = #{sysId,jdbcType=BIGINT}
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserDeptMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserDeptMapper.xml
new file mode 100644
index 0000000..c01c120
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserDeptMapper.xml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sys_code,
+ user_id,
+ dept_id,
+ create_time,
+ update_time
+
+
+
+
+
+ INSERT INTO sso_user_dept
+ (
+ sys_code,
+ user_id,
+ dept_id
+ )
+ values
+ (
+ #{sysCode,jdbcType=VARCHAR},
+ #{userId,jdbcType=BIGINT},
+ #{deptId,jdbcType=BIGINT}
+ )
+
+
+
+ INSERT INTO sso_user_dept
+
+
+ sys_code,
+
+
+ user_id,
+
+
+ dept_id,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{userId,jdbcType=BIGINT},
+
+
+ #{deptId,jdbcType=BIGINT},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+ DELETE FROM sso_user_dept
+ WHERE sys_code = #{sysCode,jdbcType=VARCHAR}
+ AND user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ DELETE FROM sso_user_dept
+ WHERE sys_code = #{sysCode,jdbcType=VARCHAR}
+ AND dept_id = #{deptId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user_dept
+ SET
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+ user_id = #{userId,jdbcType=BIGINT},
+ dept_id = #{deptId,jdbcType=BIGINT},
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ update_time = #{updateTime,jdbcType=TIMESTAMP}
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user_dept
+
+
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+
+
+ user_id = #{userId,jdbcType=BIGINT},
+
+
+ dept_id = #{deptId,jdbcType=BIGINT},
+
+
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserMapper.xml
new file mode 100644
index 0000000..dc9c0dd
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserMapper.xml
@@ -0,0 +1,453 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ user_id,
+ username,
+ password,
+ nick_name,
+ real_name,
+ sex,
+ phone,
+ email,
+ avatar,
+ status,
+ login_ip,
+ last_login_time,
+ del_flag,
+ remarks,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+
+
+
+ a.user_id,
+ a.username,
+ a.password,
+ a.nick_name,
+ a.real_name,
+ a.sex,
+ a.phone,
+ a.email,
+ a.avatar,
+ a.status,
+ a.login_ip,
+ a.last_login_time,
+ a.del_flag,
+ a.remarks,
+ a.create_by,
+ a.update_by,
+ a.create_time,
+ a.update_time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO sso_user
+ (
+ user_id,
+ username,
+ password,
+ nick_name,
+ real_name,
+ sex,
+ phone,
+ email,
+ avatar,
+ status,
+ login_ip,
+ last_login_time,
+ del_flag,
+ remarks,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+ )
+ values
+ (
+ #{userId,jdbcType=BIGINT},
+ #{username,jdbcType=VARCHAR},
+ #{password,jdbcType=VARCHAR},
+ #{nickName,jdbcType=VARCHAR},
+ #{realName,jdbcType=VARCHAR},
+ #{sex,jdbcType=INTEGER},
+ #{phone,jdbcType=VARCHAR},
+ #{email,jdbcType=VARCHAR},
+ #{avatar,jdbcType=VARCHAR},
+ #{status,jdbcType=INTEGER},
+ #{loginIp,jdbcType=VARCHAR},
+ #{lastLoginTime,jdbcType=TIMESTAMP},
+ #{delFlag,jdbcType=INTEGER},
+ #{remarks,jdbcType=VARCHAR},
+ #{createBy,jdbcType=VARCHAR},
+ #{updateBy,jdbcType=VARCHAR},
+ #{createTime,jdbcType=TIMESTAMP},
+ #{updateTime,jdbcType=TIMESTAMP}
+ )
+
+
+
+ INSERT INTO sso_user
+
+
+ user_id,
+
+
+ username,
+
+
+ password,
+
+
+ nick_name,
+
+
+ real_name,
+
+
+ sex,
+
+
+ phone,
+
+
+ email,
+
+
+ avatar,
+
+
+ status,
+
+
+ login_ip,
+
+
+ last_login_time,
+
+
+ del_flag,
+
+
+ remarks,
+
+
+ create_by,
+
+
+ update_by,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{userId,jdbcType=BIGINT},
+
+
+ #{username,jdbcType=VARCHAR},
+
+
+ #{password,jdbcType=VARCHAR},
+
+
+ #{nickName,jdbcType=VARCHAR},
+
+
+ #{realName,jdbcType=VARCHAR},
+
+
+ #{sex,jdbcType=INTEGER},
+
+
+ #{phone,jdbcType=VARCHAR},
+
+
+ #{email,jdbcType=VARCHAR},
+
+
+ #{avatar,jdbcType=VARCHAR},
+
+
+ #{status,jdbcType=INTEGER},
+
+
+ #{loginIp,jdbcType=VARCHAR},
+
+
+ #{lastLoginTime,jdbcType=TIMESTAMP},
+
+
+ #{delFlag,jdbcType=INTEGER},
+
+
+ #{remarks,jdbcType=VARCHAR},
+
+
+ #{createBy,jdbcType=VARCHAR},
+
+
+ #{updateBy,jdbcType=VARCHAR},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+ UPDATE sso_user
+ SET
+ nick_name = #{nickName,jdbcType=VARCHAR},
+ real_name = #{realName,jdbcType=VARCHAR},
+ sex = #{sex,jdbcType=INTEGER},
+ phone = #{phone,jdbcType=VARCHAR},
+ email = #{email,jdbcType=VARCHAR},
+ status = #{status,jdbcType=INTEGER},
+ remarks = #{remarks,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user
+ SET
+ nick_name = #{nickName,jdbcType=VARCHAR},
+ real_name = #{realName,jdbcType=VARCHAR},
+ sex = #{sex,jdbcType=INTEGER},
+ phone = #{phone,jdbcType=VARCHAR},
+ email = #{email,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user
+ SET
+ login_ip = #{loginIp,jdbcType=VARCHAR},
+ last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}
+ WHERE user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user
+ SET
+ password = #{password,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR}
+ WHERE user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user
+ SET
+ avatar = #{avatar,jdbcType=VARCHAR}
+ WHERE user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user
+
+
+ username = #{username,jdbcType=VARCHAR},
+
+
+ password = #{password,jdbcType=VARCHAR},
+
+
+ nick_name = #{nickName,jdbcType=VARCHAR},
+
+
+ real_name = #{realName,jdbcType=VARCHAR},
+
+
+ sex = #{sex,jdbcType=INTEGER},
+
+
+ phone = #{phone,jdbcType=VARCHAR},
+
+
+ email = #{email,jdbcType=VARCHAR},
+
+
+ avatar = #{avatar,jdbcType=VARCHAR},
+
+
+ status = #{status,jdbcType=INTEGER},
+
+
+ login_ip = #{loginIp,jdbcType=VARCHAR},
+
+
+ last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ remarks = #{remarks,jdbcType=VARCHAR},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE user_id = #{userId,jdbcType=BIGINT}
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserRoleMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserRoleMapper.xml
new file mode 100644
index 0000000..2a5d7c7
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserRoleMapper.xml
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sys_code,
+ user_id,
+ role_id,
+ create_time,
+ update_time
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO sso_user_role
+ (
+ sys_code,
+ user_id,
+ role_id
+ )
+ values
+ (
+ #{sysCode,jdbcType=VARCHAR},
+ #{userId,jdbcType=BIGINT},
+ #{roleId,jdbcType=BIGINT}
+ )
+
+
+
+ INSERT INTO sso_user_role
+
+
+ sys_code,
+
+
+ user_id,
+
+
+ role_id,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{userId,jdbcType=BIGINT},
+
+
+ #{roleId,jdbcType=BIGINT},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+
+ INSERT INTO sso_user_role
+ (
+ sys_code,
+ user_id,
+ role_id
+ )
+ VALUES
+
+ (
+ #{item.sysCode,jdbcType=VARCHAR},
+ #{item.userId,jdbcType=BIGINT},
+ #{item.roleId,jdbcType=BIGINT}
+ )
+
+
+
+
+ DELETE FROM sso_user_role
+ WHERE sys_code = #{sysCode,jdbcType=VARCHAR}
+ AND user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ DELETE FROM sso_user_role
+ WHERE role_id = #{roleId,jdbcType=BIGINT}
+ AND user_id = #{userId,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user_role
+ SET
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+ user_id = #{userId,jdbcType=BIGINT},
+ role_id = #{roleId,jdbcType=BIGINT}
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user_role
+
+
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+
+
+ user_id = #{userId,jdbcType=BIGINT},
+
+
+ role_id = #{roleId,jdbcType=BIGINT},
+
+
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+
+
diff --git a/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserSystemMapper.xml b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserSystemMapper.xml
new file mode 100644
index 0000000..fd6114d
--- /dev/null
+++ b/sso-auth-center-service/sso-business/src/main/resources/mapper/mybatis/SsoUserSystemMapper.xml
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ id,
+ user_id,
+ sys_code,
+ sort_num,
+ del_flag,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+
+
+
+
+
+
+
+ INSERT INTO sso_user_system
+ (
+ id,
+ user_id,
+ sys_code,
+ sort_num,
+ del_flag,
+ create_by,
+ update_by,
+ create_time,
+ update_time
+ )
+ values
+ (
+ #{id,jdbcType=BIGINT},
+ #{userId,jdbcType=BIGINT},
+ #{sysCode,jdbcType=VARCHAR},
+ #{sortNum,jdbcType=INTEGER},
+ #{delFlag,jdbcType=INTEGER},
+ #{createBy,jdbcType=VARCHAR},
+ #{updateBy,jdbcType=VARCHAR},
+ #{createTime,jdbcType=TIMESTAMP},
+ #{updateTime,jdbcType=TIMESTAMP}
+ )
+
+
+
+ INSERT INTO sso_user_system
+
+
+ id,
+
+
+ user_id,
+
+
+ sys_code,
+
+
+ sort_num,
+
+
+ del_flag,
+
+
+ create_by,
+
+
+ update_by,
+
+
+ create_time,
+
+
+ update_time,
+
+
+
+
+ #{id,jdbcType=BIGINT},
+
+
+ #{userId,jdbcType=BIGINT},
+
+
+ #{sysCode,jdbcType=VARCHAR},
+
+
+ #{sortNum,jdbcType=INTEGER},
+
+
+ #{delFlag,jdbcType=INTEGER},
+
+
+ #{createBy,jdbcType=VARCHAR},
+
+
+ #{updateBy,jdbcType=VARCHAR},
+
+
+ #{createTime,jdbcType=TIMESTAMP},
+
+
+ #{updateTime,jdbcType=TIMESTAMP},
+
+
+
+
+
+ DELETE FROM sso_user_system
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user_system
+ SET
+ user_id = #{userId,jdbcType=BIGINT},
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+ sort_num = #{sortNum,jdbcType=INTEGER},
+ del_flag = #{delFlag,jdbcType=INTEGER},
+ create_by = #{createBy,jdbcType=VARCHAR},
+ update_by = #{updateBy,jdbcType=VARCHAR},
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+ update_time = #{updateTime,jdbcType=TIMESTAMP}
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user_system
+
+
+ user_id = #{userId,jdbcType=BIGINT},
+
+
+ sys_code = #{sysCode,jdbcType=VARCHAR},
+
+
+ sort_num = #{sortNum,jdbcType=INTEGER},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ create_by = #{createBy,jdbcType=VARCHAR},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE id = #{id,jdbcType=BIGINT}
+
+
+
+ UPDATE sso_user_system
+
+
+ sort_num = #{sortNum,jdbcType=INTEGER},
+
+
+ del_flag = #{delFlag,jdbcType=INTEGER},
+
+
+ create_by = #{createBy,jdbcType=VARCHAR},
+
+
+ update_by = #{updateBy,jdbcType=VARCHAR},
+
+
+ create_time = #{createTime,jdbcType=TIMESTAMP},
+
+
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
+
+
+ WHERE del_flag = 0
+ AND sys_code = #{sysCode,jdbcType=VARCHAR}
+ AND user_id = #{userId,jdbcType=BIGINT}
+
+
+
+
+
+
diff --git a/sso-auth-center-service/sso-common/pom.xml b/sso-auth-center-service/sso-common/pom.xml
new file mode 100755
index 0000000..2d4a71b
--- /dev/null
+++ b/sso-auth-center-service/sso-common/pom.xml
@@ -0,0 +1,120 @@
+
+
+
+ com.sso
+ sso-auth-center-service
+ 1.0.0
+
+ 4.0.0
+
+ sso-common
+
+
+ common通用工具
+
+
+
+
+
+
+ org.springframework
+ spring-context-support
+
+
+
+
+ org.springframework
+ spring-web
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+
+
+ javax.validation
+ validation-api
+
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+
+ com.alibaba
+ fastjson
+
+
+
+
+ com.google.guava
+ guava
+
+
+
+
+ commons-io
+ commons-io
+
+
+
+
+ commons-fileupload
+ commons-fileupload
+
+
+
+
+ org.apache.poi
+ poi-ooxml
+
+
+
+
+
+ io.jsonwebtoken
+ jjwt
+
+
+
+
+ eu.bitwalker
+ UserAgentUtils
+
+
+
+
+ javax.servlet
+ javax.servlet-api
+
+
+
+ cn.hutool
+ hutool-all
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+ org.hibernate
+ hibernate-validator
+
+
+
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/annotation/OpenApi.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/annotation/OpenApi.java
new file mode 100644
index 0000000..b3d8dbb
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/annotation/OpenApi.java
@@ -0,0 +1,25 @@
+package com.sso.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 开放接口注解
+ *
+ * @author 程序员小强
+ */
+@Documented
+@Inherited
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface OpenApi {
+
+ /**
+ * api 方法名
+ */
+ String method();
+
+ /**
+ * 方法描述
+ */
+ String desc() default "";
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/annotation/OpenApiService.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/annotation/OpenApiService.java
new file mode 100644
index 0000000..81c2284
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/annotation/OpenApiService.java
@@ -0,0 +1,14 @@
+package com.sso.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 开放接口实现类注解
+ *
+ * @author 程序员小强
+ */
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface OpenApiService {
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/CacheConstants.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/CacheConstants.java
new file mode 100755
index 0000000..cdabb75
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/CacheConstants.java
@@ -0,0 +1,65 @@
+package com.sso.common.constant;
+
+/**
+ * 通用常量信息
+ *
+ * @author 程序员小强
+ */
+public class CacheConstants {
+
+ /**
+ * 验证码 redis key
+ */
+ private static final String CAPTCHA_CODE_KEY = "captcha_cache_key:";
+
+ /**
+ * 验证码有效期(5分钟)
+ */
+ public static final Integer CAPTCHA_EXPIRE = 5;
+
+ /**
+ * 验证码有效期(5分钟)
+ */
+ public static final Integer CAPTCHA_EXPIRE_FIVE = 5;
+
+ /**
+ * 登录用户 redis key
+ */
+ private static final String LOGIN_TOKEN_CACHE_KEY = "login_tokens:";
+
+ /**
+ * 登录用户 redis key
+ */
+ private static final String LOGIN_USER_ID_CACHE_KEY = "login_user_id:";
+
+ /**
+ * 系统平台配置 缓存key
+ */
+ private static final String SYSTEM_CONFIG_CACHE_KEY = "sso_admin_system_cache_key:";
+
+ /**
+ * 注册子系统缓存key
+ */
+ private static final String REGISTER_SYS_CACHE_KEY = "register_sys:";
+
+ /**
+ * 系统平台-缓存有效期(720分钟)12小时
+ */
+ public static final Integer SYSTEM_CONFIG_CACHE_EXPIRE = 720;
+
+ public static String getCaptchaCodeKey(String requestId) {
+ return CacheConstants.CAPTCHA_CODE_KEY + requestId;
+ }
+
+ public static String getSystemCaptchaKey(String sysCode) {
+ return CacheConstants.SYSTEM_CONFIG_CACHE_KEY + sysCode;
+ }
+
+ public static String getLoginUserIdKey(Long userId) {
+ return CacheConstants.LOGIN_USER_ID_CACHE_KEY + userId;
+ }
+
+ public static String getLoginUserTokenKey(String token) {
+ return CacheConstants.LOGIN_TOKEN_CACHE_KEY + token;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/MimeTypeConstant.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/MimeTypeConstant.java
new file mode 100755
index 0000000..9928cdc
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/MimeTypeConstant.java
@@ -0,0 +1,53 @@
+package com.sso.common.constant;
+
+/**
+ * 媒体类型工具类
+ *
+ * @author 程序员小强
+ */
+public class MimeTypeConstant {
+
+ public static final String IMAGE_PNG = "image/png";
+
+ public static final String IMAGE_JPG = "image/jpg";
+
+ public static final String IMAGE_JPEG = "image/jpeg";
+
+ public static final String IMAGE_BMP = "image/bmp";
+
+ public static final String IMAGE_GIF = "image/gif";
+
+ public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
+
+ public static final String[] FLASH_EXTENSION = {"swf", "flv"};
+
+ public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
+ "asf", "rm", "rmvb"};
+
+ public static final String[] DEFAULT_ALLOWED_EXTENSION = {
+ // 图片
+ "bmp", "gif", "jpg", "jpeg", "png",
+ // word excel powerpoint
+ "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
+ // 压缩文件
+ "rar", "zip", "gz", "bz2",
+ // pdf
+ "pdf"};
+
+ public static String geByPrefix(String prefix) {
+ switch (prefix) {
+ case IMAGE_PNG:
+ return "png";
+ case IMAGE_JPG:
+ return "jpg";
+ case IMAGE_JPEG:
+ return "jpeg";
+ case IMAGE_BMP:
+ return "bmp";
+ case IMAGE_GIF:
+ return "gif";
+ default:
+ return "";
+ }
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/NumberConstant.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/NumberConstant.java
new file mode 100644
index 0000000..c1f8200
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/NumberConstant.java
@@ -0,0 +1,17 @@
+package com.sso.common.constant;
+
+
+/**
+ * 数字常量
+ *
+ * @author 程序员小强
+ */
+public class NumberConstant {
+
+ public static final Integer ZERO = 0;
+ public static final Integer ONE = 1;
+ public static final Integer TWO = 2;
+ public static final Integer THREE = 3;
+ public static final Integer THEN = 10;
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/SsoConstants.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/SsoConstants.java
new file mode 100755
index 0000000..b104091
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/SsoConstants.java
@@ -0,0 +1,80 @@
+package com.sso.common.constant;
+
+/**
+ * 通用常量信息
+ *
+ * @author 程序员小强
+ */
+public class SsoConstants {
+
+ /**
+ * 下拉选项,默认限制长度
+ */
+ public static final Integer OPTION_LIMIT = 10;
+
+ /**
+ * 分隔符 |
+ */
+ public static final String SPLIT_ESCAPE = "\\|";
+
+ /**
+ * 分隔符 |
+ */
+ public static final String PERMISSIONS_SPLIT = "|";
+
+ /**
+ * 验证码类型-math
+ */
+ public static final String CAPTCHA_TYPE_MATH = "math";
+
+ /**
+ * 验证码类型-char
+ */
+ public static final String CAPTCHA_TYPE_CHAR = "char";
+
+ /**
+ * UTF-8 字符集
+ */
+ public static final String UTF8 = "UTF-8";
+
+ /**
+ * GBK 字符集
+ */
+ public static final String GBK = "GBK";
+
+ /**
+ * http请求
+ */
+ public static final String HTTP = "http://";
+
+ /**
+ * https请求
+ */
+ public static final String HTTPS = "https://";
+
+ /**
+ * 通用成功标识
+ */
+ public static final String SUCCESS = "0";
+
+ /**
+ * 修改秘钥权限 key
+ */
+ public static final String UPDATE_SECRET_KEY = "system:updateSecret";
+
+ /**
+ * 资源映射路径 前缀
+ */
+ public static final String RESOURCE_PREFIX = "/profile";
+
+ /**
+ * 获取头像上传路径
+ */
+ public static final String AVATAR_PATH = "/avatar";
+
+ /**
+ * 平台头像上传路径
+ */
+ public static final String SYSTEM_ICON_PATH = "/sysIcon";
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/SsoPermissionConstants.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/SsoPermissionConstants.java
new file mode 100755
index 0000000..cefddce
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/SsoPermissionConstants.java
@@ -0,0 +1,29 @@
+package com.sso.common.constant;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * 权限相关常量信息
+ *
+ * @author 程序员小强
+ */
+public class SsoPermissionConstants {
+
+ /**
+ * 所有权限标识
+ */
+ public static final String ALL_PERMISSION = "**";
+
+ /**
+ * 认证中心管理员角色-权限标识
+ */
+ public static final String ADMIN_ROLE_KEY = "admin";
+
+ /**
+ * 管理员账户名
+ */
+ public static final Set ADMIN_USER_SET = new HashSet<>(Collections.singletonList("admin"));
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/UserLoginConstants.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/UserLoginConstants.java
new file mode 100755
index 0000000..c95dea6
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/constant/UserLoginConstants.java
@@ -0,0 +1,27 @@
+package com.sso.common.constant;
+
+/**
+ * 通用常量信息
+ *
+ * @author 程序员小强
+ */
+public class UserLoginConstants {
+
+
+ /**
+ * 令牌
+ */
+ public static final String TOKEN = "token";
+
+ /**
+ * 令牌前缀
+ */
+ public static final String TOKEN_PREFIX = "Bearer ";
+
+ /**
+ * 令牌前缀
+ */
+ public static final String LOGIN_USER_KEY = "login_user_key";
+
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/DelFlagEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/DelFlagEnum.java
new file mode 100755
index 0000000..fc82313
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/DelFlagEnum.java
@@ -0,0 +1,24 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 数据删除状态
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum DelFlagEnum {
+
+ OK(0, "正常"),
+ DELETED(1, "删除");
+
+ private Integer status;
+ private String desc;
+
+ DelFlagEnum(Integer status, String desc) {
+ this.status = status;
+ this.desc = desc;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/DeptStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/DeptStatusEnum.java
new file mode 100755
index 0000000..b89289e
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/DeptStatusEnum.java
@@ -0,0 +1,24 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 部门状态-枚举
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum DeptStatusEnum {
+
+ OK(0, "正常"),
+ DISABLE(1, "停用");
+
+ private Integer status;
+ private String desc;
+
+ DeptStatusEnum(Integer status, String desc) {
+ this.status = status;
+ this.desc = desc;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/LoginStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/LoginStatusEnum.java
new file mode 100755
index 0000000..c050e99
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/LoginStatusEnum.java
@@ -0,0 +1,26 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 登录状态枚举
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum LoginStatusEnum {
+
+ /**
+ * 系统状态
+ */
+ SUCCESS(0, "成功"),
+ FAIL(1, "失败");
+
+ private final Integer status;
+ private final String desc;
+
+ LoginStatusEnum(Integer status, String desc) {
+ this.status = status;
+ this.desc = desc;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/MenuStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/MenuStatusEnum.java
new file mode 100755
index 0000000..fb1febb
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/MenuStatusEnum.java
@@ -0,0 +1,24 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 菜单状态-枚举
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum MenuStatusEnum {
+
+ OK(0, "正常"),
+ DISABLE(1, "停用");
+
+ private Integer status;
+ private String desc;
+
+ MenuStatusEnum(Integer status, String desc) {
+ this.status = status;
+ this.desc = desc;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/MenuTypeEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/MenuTypeEnum.java
new file mode 100755
index 0000000..0f23ef6
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/MenuTypeEnum.java
@@ -0,0 +1,35 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 菜单类型-枚举
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum MenuTypeEnum {
+
+ /**
+ * 菜单类型枚举
+ */
+ FOLDER("M", "目录"),
+ MENU("C", "菜单"),
+ FUNCTION("F", "按钮");
+
+ private final String type;
+ private final String desc;
+
+ MenuTypeEnum(String type, String desc) {
+ this.type = type;
+ this.desc = desc;
+ }
+
+ public static boolean isMenu(String type) {
+ if (FOLDER.type.equals(type)) {
+ return true;
+ }
+ return MENU.type.equals(type);
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SignTypeEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SignTypeEnum.java
new file mode 100755
index 0000000..621e64d
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SignTypeEnum.java
@@ -0,0 +1,49 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+import org.apache.commons.lang3.math.NumberUtils;
+
+/**
+ * 签名类型
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum SignTypeEnum {
+
+ /**
+ * 无
+ */
+ EMPTY(0),
+ /**
+ * md5
+ */
+ MD5(1),
+ /**
+ * rsa
+ */
+ RSA(2),
+ ;
+ private final Integer value;
+
+ SignTypeEnum(Integer value) {
+ this.value = value;
+ }
+
+ public static SignTypeEnum getByValue(String value) {
+ int intValue = NumberUtils.toInt(value);
+ if (intValue == 0) {
+ return null;
+ }
+ return getByValue(intValue);
+ }
+
+ public static SignTypeEnum getByValue(Integer value) {
+ for (SignTypeEnum signTypeEnum : SignTypeEnum.values()) {
+ if (value.equals(signTypeEnum.getValue())) {
+ return signTypeEnum;
+ }
+ }
+ return EMPTY;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SystemManagerStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SystemManagerStatusEnum.java
new file mode 100755
index 0000000..a1d8ed0
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SystemManagerStatusEnum.java
@@ -0,0 +1,24 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 平台管理员关系表-枚举
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum SystemManagerStatusEnum {
+
+ OK(0, "正常"),
+ DISABLE(1, "停用");
+
+ private Integer status;
+ private String desc;
+
+ SystemManagerStatusEnum(Integer status, String desc) {
+ this.status = status;
+ this.desc = desc;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SystemStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SystemStatusEnum.java
new file mode 100755
index 0000000..2cf470b
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/SystemStatusEnum.java
@@ -0,0 +1,49 @@
+package com.sso.common.enums;
+
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 系统状态枚举
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum SystemStatusEnum {
+
+ /**
+ * 系统状态
+ */
+ ENABLE(0, "正常"),
+ DISABLE(1, "停用");
+
+ private Integer status;
+ private String desc;
+
+ SystemStatusEnum(Integer status, String desc) {
+ this.status = status;
+ this.desc = desc;
+ }
+
+ /**
+ * 启用的状态集
+ */
+ public static List getEnableStatusList() {
+ List statusList = new ArrayList<>();
+ statusList.add(ENABLE.getStatus());
+ return statusList;
+ }
+
+ /**
+ * 所有状态集
+ */
+ public static List getAllStatusList() {
+ List statusList = new ArrayList<>();
+ for (SystemStatusEnum statusEnum : SystemStatusEnum.values()) {
+ statusList.add(statusEnum.getStatus());
+ }
+ return statusList;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/ApiExceptionEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/ApiExceptionEnum.java
new file mode 100644
index 0000000..8f48fcd
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/ApiExceptionEnum.java
@@ -0,0 +1,41 @@
+package com.sso.common.enums.exception;
+
+/**
+ * 异常枚举
+ *
+ * @author 程序员小强
+ */
+public enum ApiExceptionEnum implements EnumInterface {
+
+ /**
+ * api异常枚举
+ */
+ API_NOT_EXIST(9001, "API方法不存在"),
+ INVALID_PUBLIC_PARAM(9002, "无效公共参数 >> {0}"),
+ INVALID_REQUEST_ERROR(9003, " 请求方式 {0} 错误 ! 请使用 {1} 方式"),
+ INVALID_PARAM(9004, "无效参数 >> 参数[{0}] >> 原因[{1}]"),
+ INVALID_SIGN(9005, "无效签名"),
+ SIGN_TYPE_NOT_EXIST(9001, "签名类型不存在"),
+ SYSTEM_ERROR(9999, "系统繁忙请稍后再试!"),
+ ;
+
+ ApiExceptionEnum(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private Integer code;
+
+ private String msg;
+
+ @Override
+ public Integer getCode() {
+ return code;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/DeptResStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/DeptResStatusEnum.java
new file mode 100644
index 0000000..183d016
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/DeptResStatusEnum.java
@@ -0,0 +1,46 @@
+package com.sso.common.enums.exception;
+
+/**
+ * 部门返回相关
+ * 编号300xx
+ *
+ * @author 程序员小强
+ */
+public enum DeptResStatusEnum implements EnumInterface {
+
+ /**
+ * 部门操作状态枚举
+ */
+ REPEAT_NAME(3000, "部门名称{0}已存在"),
+ ALREADY_DELETE(3001, "部门已删除"),
+ HASH_CHILD_USER(3002, "部门下存在用户"),
+ HASH_CHILD_DEPT(3003, "部门下存在子部门"),
+ DEPT_NOT_EXISTS(3004, "部门不存在"),
+ PARENT_NOT_EXISTS(3005, "父部门不存在"),
+ PARENT_IS_DELETE(3006, "父部门已删除"),
+ NOT_EXISTS_OR_DELETE(3007, "部门不存在或者已删除"),
+ PARENT_IS_DISABLE(3008, "父部门已停用"),
+ HASH_ENABLE_CHILD(3009, "该部门包含未停用的子部门"),
+ PARENT_CANNOT_SELF(3010, "父部门不能选自己"),
+ ;
+
+
+ DeptResStatusEnum(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private Integer code;
+
+ private String msg;
+
+ @Override
+ public Integer getCode() {
+ return code;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/EnumInterface.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/EnumInterface.java
new file mode 100644
index 0000000..db3a36e
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/EnumInterface.java
@@ -0,0 +1,21 @@
+package com.sso.common.enums.exception;
+
+/**
+ * @author 程序员小强
+ * @version EnumInterface.java, v 0.1 2019-01-15 20:54
+ */
+public interface EnumInterface {
+ /**
+ * 获取key
+ *
+ * @return
+ */
+ Integer getCode();
+
+ /**
+ * 获取value
+ *
+ * @return
+ */
+ String getMsg();
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/MenuResStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/MenuResStatusEnum.java
new file mode 100644
index 0000000..89e7177
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/MenuResStatusEnum.java
@@ -0,0 +1,39 @@
+package com.sso.common.enums.exception;
+
+/**
+ * 菜单返回相关
+ * 编号500xx
+ *
+ * @author 程序员小强
+ */
+public enum MenuResStatusEnum implements EnumInterface {
+
+ /**
+ * 菜单操作状态枚举
+ */
+ ALREADY_DELETE(5001, "菜单已删除"),
+ HASH_CHILD_DEPT(5003, "菜单下存在未删除的子菜单"),
+ MENU_NAME_EXISTS_IN_SAME_PARENT(5004, "同上级下菜单名称{0}已经存在"),
+ PARENT_CANNOT_SELF(5005, "父菜单不能选自己"),
+ ;
+
+
+ MenuResStatusEnum(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private Integer code;
+
+ private String msg;
+
+ @Override
+ public Integer getCode() {
+ return code;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/RoleResStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/RoleResStatusEnum.java
new file mode 100644
index 0000000..71b56ec
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/RoleResStatusEnum.java
@@ -0,0 +1,41 @@
+package com.sso.common.enums.exception;
+
+/**
+ * 角色返回相关
+ * 编号600xx
+ *
+ * @author 程序员小强
+ */
+public enum RoleResStatusEnum implements EnumInterface {
+
+ /**
+ * 角色操作状态枚举
+ */
+ ALREADY_DELETE(6001, "角色已删除"),
+ ROLE_NAME_EXISTS(6002, "角色名称{0}已经存在"),
+ KEY_NAME_EXISTS(6002, "角色标识{0}已经存在"),
+ ROLE_NOT_EXISTS(6003, "该角色不存在"),
+ ALREADY_BIND_USER(6004, "该角色已被用户使用"),
+
+ ;
+
+
+ RoleResStatusEnum(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private Integer code;
+
+ private String msg;
+
+ @Override
+ public Integer getCode() {
+ return code;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/SysResStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/SysResStatusEnum.java
new file mode 100644
index 0000000..bef7529
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/SysResStatusEnum.java
@@ -0,0 +1,49 @@
+package com.sso.common.enums.exception;
+
+/**
+ * @author 程序员小强
+ */
+public enum SysResStatusEnum implements EnumInterface {
+
+ /**
+ * 系统状态枚举
+ */
+ SUCCESS(200, "操作成功"),
+ ERROR(500, "操作失败"),
+ UNAUTHORIZED(401, "Unauthorized"),
+
+ ADD_FAIL(1000, "新增失败"),
+ UPDATE_FAIL(1001, "修改失败"),
+ DELETE_FAIL(1002, "删除失败"),
+
+ LOGIN_SUCCESS(2000, "登录成功"),
+ CAPTCHA_EXPIRE(2001, "验证码已失效"),
+ CAPTCHA_ERROR(2002, "验证码错误"),
+ SYS_NOT_FOUND(2003, "系统不存在"),
+ USER_PASSWORD_NOT_MATCH(2004, "用户名或密码错误"),
+ USER_NAME_NOT_EXISTS(2005, "用户名不存在"),
+ USER_DISABLE(2006, "用户已停用"),
+
+ SYSTEM_ERROR(6000, "网络繁忙,请稍后再试"),
+ ;
+
+
+ SysResStatusEnum(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private Integer code;
+
+ private String msg;
+
+ @Override
+ public Integer getCode() {
+ return code;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/SystemResStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/SystemResStatusEnum.java
new file mode 100644
index 0000000..c863276
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/SystemResStatusEnum.java
@@ -0,0 +1,42 @@
+package com.sso.common.enums.exception;
+
+/**
+ * 目标系统返回相关
+ * 编号700xx
+ *
+ * @author 程序员小强
+ */
+public enum SystemResStatusEnum implements EnumInterface {
+
+ /**
+ * 目标系统 操作状态枚举
+ */
+ ALREADY_DELETE(7001, "系统{0}已删除"),
+ SYS_CODE_EXISTS(7002, "系统编码{0}已经存在"),
+ SYS_NOT_EXISTS(7003, "该系统不存在"),
+ ALREADY_BIND_USER(7004, "该系统已被用户引用,不可修改系统编码"),
+ ALREADY_BIND_DEPT(7005, "该系统已被部门引用,不可修改系统编码"),
+ ALREADY_BIND_MENU(7006, "该系统已被菜单引用,不可修改系统编码"),
+ ALREADY_BIND_ROLE(7007, "该系统已被角色引用,不可修改系统编码"),
+ ;
+
+
+ SystemResStatusEnum(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private Integer code;
+
+ private String msg;
+
+ @Override
+ public Integer getCode() {
+ return code;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/UserResStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/UserResStatusEnum.java
new file mode 100644
index 0000000..5539b46
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/exception/UserResStatusEnum.java
@@ -0,0 +1,44 @@
+package com.sso.common.enums.exception;
+
+/**
+ * 用户返回相关
+ * 编号400xx
+ *
+ * @author 程序员小强
+ */
+public enum UserResStatusEnum implements EnumInterface {
+
+ /**
+ * 用户操作状态枚举
+ */
+ ALREADY_DELETE(4001, "用户已删除"),
+ USER_NAME_EXISTS(4002, "登录名{0}已经存在"),
+ PHONE_EXISTS(4003, "手机号{0}已经存在"),
+ EMAIL_EXISTS(4004, "邮箱{0}已经存在"),
+ USER_NOT_EXISTS(4005, "用户不存在"),
+ OLD_PWD_ERROR(4006, "修改密码失败,旧密码错误"),
+ OLD_PWD_EVAL_NEW_PWD(4007, "新密码不能与旧密码相同"),
+ SUPPER_ADMIN_USER(4008, "超级管理员账号不可操作"),
+
+ ;
+
+
+ UserResStatusEnum(Integer code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ private Integer code;
+
+ private String msg;
+
+ @Override
+ public Integer getCode() {
+ return code;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/BusinessStatus.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/BusinessStatus.java
new file mode 100755
index 0000000..14d81ac
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/BusinessStatus.java
@@ -0,0 +1,18 @@
+package com.sso.common.enums.system;
+
+/**
+ * 操作状态
+ *
+ * @author 程序员小强
+ */
+public enum BusinessStatus {
+ /**
+ * 成功
+ */
+ SUCCESS,
+
+ /**
+ * 失败
+ */
+ FAIL,
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/BusinessType.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/BusinessType.java
new file mode 100755
index 0000000..2e750c3
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/BusinessType.java
@@ -0,0 +1,58 @@
+package com.sso.common.enums.system;
+
+/**
+ * 业务操作类型
+ *
+ * @author 程序员小强
+ */
+public enum BusinessType {
+ /**
+ * 其它
+ */
+ OTHER,
+
+ /**
+ * 新增
+ */
+ INSERT,
+
+ /**
+ * 修改
+ */
+ UPDATE,
+
+ /**
+ * 删除
+ */
+ DELETE,
+
+ /**
+ * 授权
+ */
+ GRANT,
+
+ /**
+ * 导出
+ */
+ EXPORT,
+
+ /**
+ * 导入
+ */
+ IMPORT,
+
+ /**
+ * 强退
+ */
+ FORCE,
+
+ /**
+ * 生成代码
+ */
+ GENCODE,
+
+ /**
+ * 清空数据
+ */
+ CLEAN,
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/OperatorType.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/OperatorType.java
new file mode 100755
index 0000000..2e3fdc9
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/OperatorType.java
@@ -0,0 +1,23 @@
+package com.sso.common.enums.system;
+
+/**
+ * 操作人类别
+ *
+ * @author 程序员小强
+ */
+public enum OperatorType {
+ /**
+ * 其它
+ */
+ OTHER,
+
+ /**
+ * 后台用户
+ */
+ MANAGE,
+
+ /**
+ * 手机端用户
+ */
+ MOBILE
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/RoleStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/RoleStatusEnum.java
new file mode 100755
index 0000000..91a08c5
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/RoleStatusEnum.java
@@ -0,0 +1,24 @@
+package com.sso.common.enums.system;
+
+import lombok.Getter;
+
+/**
+ * 角色状态-枚举
+ *
+ * @author 程序员小强
+ */
+@Getter
+public enum RoleStatusEnum {
+
+ OK(0, "正常"),
+ DISABLE(1, "停用");
+
+ private Integer status;
+ private String desc;
+
+ RoleStatusEnum(Integer status, String desc) {
+ this.status = status;
+ this.desc = desc;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/UserStatusEnum.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/UserStatusEnum.java
new file mode 100755
index 0000000..9630374
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/enums/system/UserStatusEnum.java
@@ -0,0 +1,31 @@
+package com.sso.common.enums.system;
+
+/**
+ * 用户状态
+ *
+ * @author 程序员小强
+ */
+public enum UserStatusEnum {
+
+ /**
+ * 用户状态
+ */
+ OK(0, "正常"),
+ DISABLE(1, "停用");
+
+ private Integer status;
+ private String info;
+
+ UserStatusEnum(int status, String info) {
+ this.status = status;
+ this.info = info;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public String getInfo() {
+ return info;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/exception/BaseException.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/exception/BaseException.java
new file mode 100644
index 0000000..a5d2342
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/exception/BaseException.java
@@ -0,0 +1,36 @@
+package com.sso.common.exception;
+
+import java.text.MessageFormat;
+
+/**
+ * 基础异常
+ *
+ * @author 程序员小强iang
+ */
+public class BaseException extends RuntimeException {
+
+ protected Integer code;
+ protected String msg;
+
+ public BaseException() {
+ super();
+ }
+
+ protected BaseException(String message) {
+ super(message);
+ }
+
+ protected BaseException(Integer code, String msgFormat, Object... args) {
+ super(MessageFormat.format(msgFormat, args));
+ this.code = code;
+ this.msg = MessageFormat.format(msgFormat, args);
+ }
+
+ public String getMsg() {
+ return this.msg;
+ }
+
+ public Integer getCode() {
+ return this.code;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/exception/BusinessException.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/exception/BusinessException.java
new file mode 100644
index 0000000..1793095
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/exception/BusinessException.java
@@ -0,0 +1,37 @@
+package com.sso.common.exception;
+
+
+import com.sso.common.enums.exception.EnumInterface;
+
+import java.text.MessageFormat;
+
+/**
+ * 业务异常
+ *
+ * @author 程序员小强iang
+ * @version BusinessException.java
+ */
+public class BusinessException extends BaseException {
+
+ public BusinessException(String message) {
+ super(message);
+ }
+
+ public BusinessException(Integer code, String message) {
+ super(code, message);
+ }
+
+ public static BaseException newInstance(String msgFormat, Object... args) {
+ return new BusinessException(MessageFormat.format(msgFormat, args));
+ }
+
+ public BusinessException(EnumInterface enumInterface) {
+ super(enumInterface.getCode(), enumInterface.getMsg());
+ }
+
+ public BusinessException(EnumInterface enumInterface, Object... args) {
+ super(enumInterface.getCode(), MessageFormat.format(enumInterface.getMsg(), args));
+ }
+
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/BaseOperateBO.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/BaseOperateBO.java
new file mode 100755
index 0000000..c9f6dd7
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/BaseOperateBO.java
@@ -0,0 +1,19 @@
+package com.sso.common.model;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 操作基础BO
+ *
+ * @author 程序员小强
+ */
+@Data
+public class BaseOperateBO implements Serializable {
+
+ private static final long serialVersionUID = 4316038518168512167L;
+
+ private String operateBy;
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/login/LoginResultVO.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/login/LoginResultVO.java
new file mode 100755
index 0000000..9e75f09
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/login/LoginResultVO.java
@@ -0,0 +1,169 @@
+/**
+ * Copyright ( @程序员小强 ) All Rights Reserved.
+ * 博客地址:https://blog.csdn.net/qq_38011415
+ */
+package com.sso.common.model.login;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * 用户登录信息
+ *
+ * @author 程序员小强
+ */
+@Getter
+@Setter
+@ToString
+public class LoginResultVO implements UserDetails {
+
+ private static final long serialVersionUID = 8497926226669977207L;
+
+ /**
+ * 请求唯一标识
+ */
+ private String requestId;
+
+ /**
+ * 用户唯一标识
+ */
+ private String token;
+
+ /**
+ * 登录时间
+ */
+ private Long loginTime;
+
+ /**
+ * 过期时间
+ */
+ private Long expireTime;
+
+ /**
+ * 来源IP
+ */
+ private String sourceIp;
+
+ /**
+ * 来源地址
+ */
+ private String sourceAddress;
+
+ /**
+ * 浏览器
+ */
+ private String browserName;
+
+ /**
+ * 操作系统
+ */
+ private String operateSystem;
+
+ /**
+ * 权限列表
+ */
+ private Set permissionList;
+
+ /**
+ * 角色标识
+ */
+ private Set roleKeyList;
+
+ /**
+ * 用户信息
+ */
+ private LoginUserVO user;
+
+ public LoginResultVO() {
+ }
+
+ public LoginResultVO(LoginUserVO user, Set permissionList) {
+ this.user = user;
+ this.permissionList = permissionList;
+ }
+
+ /**
+ * 获取操作人名称
+ */
+ public String getOperateName() {
+ if (null == this.user) {
+ return "";
+ }
+ if (StringUtils.isNotBlank(this.user.getRealName())) {
+ return this.user.getRealName();
+ }
+ if (StringUtils.isNotBlank(this.user.getUsername())) {
+ return this.user.getUsername();
+ }
+ if (StringUtils.isNotBlank(this.user.getNickName())) {
+ return this.user.getNickName();
+ }
+ return "";
+ }
+
+ @JsonIgnore
+ @Override
+ public String getPassword() {
+ return user.getPassword();
+ }
+
+ @Override
+ public String getUsername() {
+ return user.getUsername();
+ }
+
+ /**
+ * 账户是否未过期,过期无法验证
+ */
+ @JsonIgnore
+ @Override
+ public boolean isAccountNonExpired() {
+ return true;
+ }
+
+ /**
+ * 指定用户是否解锁,锁定的用户无法进行身份验证
+ *
+ * @return
+ */
+ @JsonIgnore
+ @Override
+ public boolean isAccountNonLocked() {
+ return true;
+ }
+
+ /**
+ * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
+ *
+ * @return
+ */
+ @JsonIgnore
+ @Override
+ public boolean isCredentialsNonExpired() {
+ return true;
+ }
+
+ /**
+ * 是否可用 ,禁用的用户不能身份验证
+ *
+ * @return
+ */
+ @JsonIgnore
+ @Override
+ public boolean isEnabled() {
+ return true;
+ }
+
+ @Override
+ public Collection extends GrantedAuthority> getAuthorities() {
+ return null;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/login/LoginUserVO.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/login/LoginUserVO.java
new file mode 100644
index 0000000..ad32a78
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/login/LoginUserVO.java
@@ -0,0 +1,71 @@
+package com.sso.common.model.login;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * 用户对象 sys_user
+ *
+ * @author 程序员小强
+ */
+@Getter
+@Setter
+@ToString
+public class LoginUserVO implements Serializable {
+
+ private static final long serialVersionUID = 7849003000148433962L;
+
+ /**
+ * 用户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;
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/page/BasePageModel.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/page/BasePageModel.java
new file mode 100755
index 0000000..3ec8a53
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/page/BasePageModel.java
@@ -0,0 +1,66 @@
+package com.sso.common.model.page;
+
+import java.io.Serializable;
+
+/**
+ * 分页数据
+ *
+ * @author 程序员小强
+ */
+public class BasePageModel implements Serializable {
+
+ private static final long serialVersionUID = -7185356231617358802L;
+
+ /**
+ * 当前页
+ */
+ private Integer page;
+
+ /**
+ * 页容量
+ */
+ private Integer pageSize;
+
+ /**
+ * 排序列名
+ */
+ private String sortName;
+
+ /**
+ * 排序的方向desc或者asc
+ */
+ private String sortBy = "asc";
+
+ public Integer getPage() {
+ return page;
+ }
+
+ public void setPage(Integer page) {
+ this.page = page == null ? 1 : page;
+ }
+
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(Integer pageSize) {
+ this.pageSize = pageSize == null ? 10 : pageSize;
+ }
+
+ public String getSortName() {
+ return sortName;
+ }
+
+ public void setSortName(String sortName) {
+ this.sortName = sortName;
+ }
+
+ public String getSortBy() {
+ return sortBy;
+ }
+
+ public void setSortBy(String sortBy) {
+ this.sortBy = sortBy;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/page/BasePageQuery.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/page/BasePageQuery.java
new file mode 100755
index 0000000..b99d59d
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/page/BasePageQuery.java
@@ -0,0 +1,89 @@
+package com.sso.common.model.page;
+
+import java.io.Serializable;
+
+/**
+ * 分页数据
+ *
+ * @author 程序员小强
+ */
+public class BasePageQuery implements Serializable {
+
+ private static final long serialVersionUID = 6467187852112192806L;
+
+ /**
+ * 当前页
+ */
+ private Integer page;
+
+ /**
+ * 页容量
+ */
+ private Integer pageSize;
+
+ /**
+ * 开始行
+ */
+ private Integer startRow;
+
+ /**
+ * 排序列名
+ */
+ private String sortName;
+
+ /**
+ * 排序的方向desc或者asc
+ */
+ private String sortBy = "asc";
+
+ /**
+ * 获取开始行
+ */
+ public Integer getStartRow() {
+ if (null == page) {
+ page = 1;
+ }
+ if (null == pageSize) {
+ pageSize = 10;
+ }
+ this.startRow = pageSize * (page - 1);
+ return startRow;
+ }
+
+ public Integer getPage() {
+ return page;
+ }
+
+ public void setPage(Integer page) {
+ this.page = page == null ? 1 : page;
+ }
+
+ public Integer getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(Integer pageSize) {
+ this.pageSize = pageSize == null ? 10 : pageSize;
+ }
+
+ public void setStartRow(Integer startRow) {
+ this.startRow = startRow;
+ }
+
+ public String getSortName() {
+ return sortName;
+ }
+
+ public void setSortName(String sortName) {
+ this.sortName = sortName;
+ }
+
+ public String getSortBy() {
+ return sortBy;
+ }
+
+ public void setSortBy(String sortBy) {
+ this.sortBy = sortBy;
+ }
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/result/ResultModel.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/result/ResultModel.java
new file mode 100644
index 0000000..397af1f
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/result/ResultModel.java
@@ -0,0 +1,77 @@
+package com.sso.common.model.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.sso.common.enums.exception.SysResStatusEnum;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * 返回统一对象
+ *
+ * @author 程序员小强
+ */
+@Getter
+@Setter
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResultModel implements Serializable {
+
+ private static final long serialVersionUID = -296683281215956785L;
+
+ /**
+ * 状态码
+ */
+ private Integer code;
+
+ /**
+ * 返回的的数据
+ */
+ private T data;
+
+ /**
+ * 描述
+ */
+ private String msg;
+
+
+ public static ResultModel success() {
+ return new ResultModel<>(SysResStatusEnum.SUCCESS.getCode(), null, "操作成功");
+ }
+
+ /**
+ * 成功请求
+ * code : 200
+ * msg : 默认 ""
+ */
+ public static ResultModel success(T data) {
+ return new ResultModel<>(SysResStatusEnum.SUCCESS.getCode(), data, "操作成功");
+ }
+
+ public static ResultModel success(Integer code, T data) {
+ return new ResultModel<>(code, data, "操作失败");
+ }
+
+ public static ResultModel error(SysResStatusEnum exceptionEnum) {
+ return new ResultModel<>(exceptionEnum.getCode(), null, exceptionEnum.getMsg());
+ }
+
+ public static ResultModel error(Integer code, String msg) {
+ return new ResultModel<>(code, null, msg);
+ }
+
+ public static ResultModel error(String msg) {
+ return new ResultModel<>(SysResStatusEnum.ERROR.getCode(), null, msg);
+ }
+
+ private ResultModel() {
+ }
+
+ private ResultModel(Integer code, T data, String msg) {
+ this.code = code;
+ this.data = data;
+ this.msg = msg;
+ }
+
+
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/result/ResultPageModel.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/result/ResultPageModel.java
new file mode 100755
index 0000000..bdf0fd4
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/model/result/ResultPageModel.java
@@ -0,0 +1,94 @@
+package com.sso.common.model.result;
+
+import com.sso.common.enums.exception.SysResStatusEnum;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 表格分页数据对象
+ *
+ * @author 程序员小强
+ */
+@Getter
+@Setter
+public class ResultPageModel implements Serializable {
+
+ private static final long serialVersionUID = -5317828223300876518L;
+
+ /**
+ * 消息状态码
+ */
+ private Integer code;
+
+ /**
+ * 总记录数
+ */
+ private long total;
+
+ /**
+ * 列表数据
+ */
+ private List data;
+
+ /**
+ * 消息内容
+ */
+ private String msg;
+
+ /**
+ * 表格数据对象
+ */
+ public ResultPageModel() {
+ }
+
+ /**
+ * 分页
+ *
+ * @param list 列表数据
+ * @param total 总记录数
+ */
+ public ResultPageModel(List list, int total) {
+ this.data = list;
+ this.total = total;
+ }
+
+
+ /**
+ * 响应请求分页数据
+ */
+ public static ResultPageModel defaultValue() {
+ return success(new ArrayList<>(0), 0);
+ }
+
+ /**
+ * 响应请求分页数据
+ */
+ public static ResultPageModel success(List list) {
+ return success(list, list.size());
+ }
+
+ /**
+ * 响应请求分页数据
+ */
+ public static ResultPageModel success(List list, int total) {
+ ResultPageModel rspData = new ResultPageModel<>();
+ rspData.setCode(SysResStatusEnum.SUCCESS.getCode());
+ rspData.setMsg("操作成功");
+ rspData.setData(list);
+ rspData.setTotal(total);
+ return rspData;
+ }
+
+ public static ResultPageModel error(String msg) {
+ ResultPageModel rspData = new ResultPageModel();
+ rspData.setCode(SysResStatusEnum.ERROR.getCode());
+ rspData.setMsg(msg);
+ rspData.setData(new ArrayList<>(0));
+ rspData.setTotal(0);
+ return rspData;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/utils/FileUploadUtils.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/utils/FileUploadUtils.java
new file mode 100644
index 0000000..d8affd9
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/utils/FileUploadUtils.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright ( @程序员小强 ) All Rights Reserved.
+ * 博客地址:https://blog.csdn.net/qq_38011415
+ */
+package com.sso.common.utils;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import com.sso.common.constant.MimeTypeConstant;
+import com.sso.common.constant.SsoConstants;
+import com.sso.common.exception.BusinessException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.FilenameUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ * 文件上传工具类
+ *
+ * @author 程序员小强
+ */
+@Slf4j
+public class FileUploadUtils {
+
+ /**
+ * 默认大小 50M
+ */
+ public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
+
+ /**
+ * 默认的文件名最大长度 100
+ */
+ public static final int DEFAULT_FILE_NAME_LENGTH = 100;
+
+ /**
+ * 上传
+ *
+ * @param rootPath 文件顶级附录
+ * @param bizPath 二级业务文件夹
+ * @param file 文件内容
+ * @return 文件地址
+ * @throws IOException
+ */
+ public static String upload(String rootPath, String bizPath, MultipartFile file) throws IOException {
+ if (null == file) {
+ throw new BusinessException("文件不为空!");
+ }
+ String originalFilename = file.getOriginalFilename();
+ if (StringUtils.isBlank(originalFilename)) {
+ throw new BusinessException("获取文件名失败!");
+ }
+ int fileNameLength = originalFilename.length();
+ if (fileNameLength > DEFAULT_FILE_NAME_LENGTH) {
+ throw new BusinessException("超过最大长度");
+ }
+ if (file.getSize() > DEFAULT_MAX_SIZE) {
+ throw new BusinessException("文件大小不能超过 50M");
+ }
+
+ //文件后缀
+ String fileType = getExtension(file);
+ String date = DateUtil.format(new Date(), "yyyyMMdd");
+ String filePath = String.format("%s%s/%s", rootPath, bizPath, date);
+ if (!FileUtil.exist(filePath)) {
+ FileUtil.mkdir(filePath);
+ }
+ //文件名
+ String fileName = String.format("%s.%s", UUIDUtil.getUUID(), fileType);
+ //文件全路径名
+ String fileFullName = String.format("%s/%s", filePath, fileName);
+
+ log.info("[ 文件上传 ] originalFilename:{} , uploadFileName:{}", originalFilename, fileFullName);
+ File desc = new File(fileFullName);
+ file.transferTo(desc);
+ return String.format("%s%s", SsoConstants.RESOURCE_PREFIX, fileFullName.replace(rootPath, ""));
+ }
+
+ /**
+ * 获取文件名的后缀
+ *
+ * @param file 表单文件
+ * @return 后缀名
+ */
+ public static String getExtension(MultipartFile file) {
+ if (null == file) {
+ return "";
+ }
+ String extension = FilenameUtils.getExtension(file.getOriginalFilename());
+ if (StringUtils.isEmpty(extension) && StringUtils.isNotBlank(file.getContentType())) {
+ extension = MimeTypeConstant.geByPrefix(file.getContentType());
+ }
+ return extension;
+ }
+}
diff --git a/sso-auth-center-service/sso-common/src/main/java/com/sso/common/utils/JsonSerializer.java b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/utils/JsonSerializer.java
new file mode 100644
index 0000000..d66513a
--- /dev/null
+++ b/sso-auth-center-service/sso-common/src/main/java/com/sso/common/utils/JsonSerializer.java
@@ -0,0 +1,44 @@
+package com.sso.common.utils;
+
+import com.alibaba.fastjson.JSON;
+
+import java.nio.charset.Charset;
+import java.util.List;
+
+/**
+ * json Serializer util
+ */
+public class JsonSerializer {
+
+ public static final String UTF_8 = "UTF-8";
+
+ /**
+ * @param obj
+ * @param
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ public static byte[] serialize(T obj) {
+ return JSON.toJSONString(obj).getBytes(Charset.forName(UTF_8));
+ }
+
+ /**
+ * @param data
+ * @param clazz
+ * @param
+ * @return
+ */
+ public static T deserialize(byte[] data, Class clazz) {
+ return JSON.parseObject(data, clazz);
+ }
+
+ /**
+ * @param data
+ * @param clazz
+ * @param
+ * @return
+ */
+ public static