Browse Source

优化 精简usky-cloud容易模块

guoenzhou 5 months ago
parent
commit
72b213c37b
20 changed files with 22 additions and 855 deletions
  1. 3 4
      base-common/pom.xml
  2. 0 26
      base-common/ruoyi-common-log/pom.xml
  3. 0 46
      base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/annotation/Log.java
  4. 0 212
      base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java
  5. 0 20
      base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessStatus.java
  6. 0 59
      base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java
  7. 0 24
      base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/OperatorType.java
  8. 0 29
      base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/service/AsyncLogService.java
  9. 0 3
      base-common/ruoyi-common-log/src/main/resources/META-INF/spring.factories
  10. 0 33
      base-common/ruoyi-common-redis/pom.xml
  11. 0 71
      base-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/FastJson2JsonRedisSerializer.java
  12. 0 50
      base-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/RedisConfig.java
  13. 0 256
      base-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java
  14. 0 5
      base-common/ruoyi-common-redis/src/main/resources/META-INF/spring.factories
  15. 4 4
      base-components/gateway/pom.xml
  16. 1 1
      base-components/gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java
  17. 5 1
      base-modules/service-gen/pom.xml
  18. 1 2
      base-modules/service-gen/src/main/java/com/ruoyi/gen/controller/GenController.java
  19. 4 4
      pom.xml
  20. 4 5
      usky-common/common-cloud-starter/pom.xml

+ 3 - 4
base-common/pom.xml

@@ -49,11 +49,10 @@
     </dependencies>
 
     <modules>
-        <module>ruoyi-common-log</module>
-        <module>ruoyi-common-core</module>
-        <module>ruoyi-common-redis</module>
+<!--        <module>ruoyi-common-core</module>-->
+<!--        <module>ruoyi-common-redis</module>-->
         <module>ruoyi-common-swagger</module>
-        <module>ruoyi-common-security</module>
+<!--        <module>ruoyi-common-security</module>-->
         <module>ruoyi-common-datascope</module>
 		<module>ruoyi-common-datasource</module>
     </modules>

+ 0 - 26
base-common/ruoyi-common-log/pom.xml

@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xmlns="http://maven.apache.org/POM/4.0.0"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.usky</groupId>
-        <artifactId>base-common</artifactId>
-        <version>0.0.1</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>ruoyi-common-log</artifactId>
-	
-    <description>
-        base-common-log日志记录
-    </description>
-
-    <dependencies>
-        <!-- RuoYi Common Security -->
-        <dependency>
-            <groupId>com.usky</groupId>
-            <artifactId>ruoyi-common-security</artifactId>
-        </dependency>
-        
-    </dependencies>
-</project>

+ 0 - 46
base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/annotation/Log.java

@@ -1,46 +0,0 @@
-package com.ruoyi.common.log.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import com.ruoyi.common.log.enums.BusinessType;
-import com.ruoyi.common.log.enums.OperatorType;
-
-/**
- * 自定义操作日志记录注解
- * 
- * @author ruoyi
- *
- */
-@Target({ ElementType.PARAMETER, ElementType.METHOD })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Log
-{
-    /**
-     * 模块
-     */
-    public String title() default "";
-
-    /**
-     * 功能
-     */
-    public BusinessType businessType() default BusinessType.OTHER;
-
-    /**
-     * 操作人类别
-     */
-    public OperatorType operatorType() default OperatorType.MANAGE;
-
-    /**
-     * 是否保存请求的参数
-     */
-    public boolean isSaveRequestData() default true;
-
-    /**
-     * 是否保存响应的参数
-     */
-    public boolean isSaveResponseData() default true;
-}

+ 0 - 212
base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java

@@ -1,212 +0,0 @@
-//package com.ruoyi.common.log.aspect;
-//
-//import java.util.Collection;
-//import java.util.Map;
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//
-//import com.usky.system.domain.SysOperLogVO;
-//import org.aspectj.lang.JoinPoint;
-//import org.aspectj.lang.annotation.AfterReturning;
-//import org.aspectj.lang.annotation.AfterThrowing;
-//import org.aspectj.lang.annotation.Aspect;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.http.HttpMethod;
-//import org.springframework.stereotype.Component;
-//import org.springframework.validation.BindingResult;
-//import org.springframework.web.multipart.MultipartFile;
-//import com.alibaba.fastjson.JSON;
-//import com.ruoyi.common.core.utils.ServletUtils;
-//import com.ruoyi.common.core.utils.StringUtils;
-//import com.ruoyi.common.core.utils.ip.IpUtils;
-//import com.ruoyi.common.log.annotation.Log;
-//import com.ruoyi.common.log.enums.BusinessStatus;
-//import com.ruoyi.common.log.service.AsyncLogService;
-//import com.ruoyi.common.security.utils.SecurityUtils;
-//
-///**
-// * 操作日志记录处理
-// *
-// * @author ruoyi
-// */
-//@Aspect
-//@Component
-//public class LogAspect
-//{
-//    private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
-//
-//    @Autowired
-//    private AsyncLogService asyncLogService;
-//
-//    /**
-//     * 处理完请求后执行
-//     *
-//     * @param joinPoint 切点
-//     */
-//    @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
-//    public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult)
-//    {
-//        handleLog(joinPoint, controllerLog, null, jsonResult);
-//    }
-//
-//    /**
-//     * 拦截异常操作
-//     *
-//     * @param joinPoint 切点
-//     * @param e 异常
-//     */
-//    @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e")
-//    public void doAfterThrowing(JoinPoint joinPoint, Log controllerLog, Exception e)
-//    {
-//        handleLog(joinPoint, controllerLog, e, null);
-//    }
-//
-//    protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult)
-//    {
-//        try
-//        {
-//            // *========数据库日志=========*//
-//            SysOperLogVO operLog = new SysOperLogVO();
-//            operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
-//            // 请求的地址
-//            String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
-//            operLog.setOperIp(ip);
-//            operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
-//            String username = SecurityUtils.getUsername();
-//            if (StringUtils.isNotBlank(username))
-//            {
-//                operLog.setOperName(username);
-//            }
-//
-//            if (e != null)
-//            {
-//                operLog.setStatus(BusinessStatus.FAIL.ordinal());
-//                operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
-//            }
-//            // 设置方法名称
-//            String className = joinPoint.getTarget().getClass().getName();
-//            String methodName = joinPoint.getSignature().getName();
-//            operLog.setMethod(className + "." + methodName + "()");
-//            // 设置请求方式
-//            operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
-//            // 处理设置注解上的参数
-//            getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
-//            // 保存数据库
-//            asyncLogService.saveSysLog(operLog);
-//        }
-//        catch (Exception exp)
-//        {
-//            // 记录本地异常日志
-//            log.error("==前置通知异常==");
-//            log.error("异常信息:{}", exp.getMessage());
-//            exp.printStackTrace();
-//        }
-//    }
-//
-//    /**
-//     * 获取注解中对方法的描述信息 用于Controller层注解
-//     *
-//     * @param log 日志
-//     * @param operLog 操作日志
-//     * @throws Exception
-//     */
-//    public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLogVO operLog, Object jsonResult) throws Exception
-//    {
-//        // 设置action动作
-//        operLog.setBusinessType(log.businessType().ordinal());
-//        // 设置标题
-//        operLog.setTitle(log.title());
-//        // 设置操作人类别
-//        operLog.setOperatorType(log.operatorType().ordinal());
-//        // 是否需要保存request,参数和值
-//        if (log.isSaveRequestData())
-//        {
-//            // 获取参数的信息,传入到数据库中。
-//            setRequestValue(joinPoint, operLog);
-//        }
-//        // 是否需要保存response,参数和值
-//        if (log.isSaveResponseData() && StringUtils.isNotNull(jsonResult))
-//        {
-//            operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
-//        }
-//    }
-//
-//    /**
-//     * 获取请求的参数,放到log中
-//     *
-//     * @param operLog 操作日志
-//     * @throws Exception 异常
-//     */
-//    private void setRequestValue(JoinPoint joinPoint, SysOperLogVO operLog) throws Exception
-//    {
-//        String requestMethod = operLog.getRequestMethod();
-//        if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))
-//        {
-//            String params = argsArrayToString(joinPoint.getArgs());
-//            operLog.setOperParam(StringUtils.substring(params, 0, 2000));
-//        }
-//    }
-//
-//    /**
-//     * 参数拼装
-//     */
-//    private String argsArrayToString(Object[] paramsArray)
-//    {
-//        String params = "";
-//        if (paramsArray != null && paramsArray.length > 0)
-//        {
-//            for (Object o : paramsArray)
-//            {
-//                if (StringUtils.isNotNull(o) && !isFilterObject(o))
-//                {
-//                    try
-//                    {
-//                        Object jsonObj = JSON.toJSON(o);
-//                        params += jsonObj.toString() + " ";
-//                    }
-//                    catch (Exception e)
-//                    {
-//                    }
-//                }
-//            }
-//        }
-//        return params.trim();
-//    }
-//
-//    /**
-//     * 判断是否需要过滤的对象。
-//     *
-//     * @param o 对象信息。
-//     * @return 如果是需要过滤的对象,则返回true;否则返回false。
-//     */
-//    @SuppressWarnings("rawtypes")
-//    public boolean isFilterObject(final Object o)
-//    {
-//        Class<?> clazz = o.getClass();
-//        if (clazz.isArray())
-//        {
-//            return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
-//        }
-//        else if (Collection.class.isAssignableFrom(clazz))
-//        {
-//            Collection collection = (Collection) o;
-//            for (Object value : collection)
-//            {
-//                return value instanceof MultipartFile;
-//            }
-//        }
-//        else if (Map.class.isAssignableFrom(clazz))
-//        {
-//            Map map = (Map) o;
-//            for (Object value : map.entrySet())
-//            {
-//                Map.Entry entry = (Map.Entry) value;
-//                return entry.getValue() instanceof MultipartFile;
-//            }
-//        }
-//        return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
-//                || o instanceof BindingResult;
-//    }
-//}

+ 0 - 20
base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessStatus.java

@@ -1,20 +0,0 @@
-package com.ruoyi.common.log.enums;
-
-/**
- * 操作状态
- * 
- * @author ruoyi
- *
- */
-public enum BusinessStatus
-{
-    /**
-     * 成功
-     */
-    SUCCESS,
-
-    /**
-     * 失败
-     */
-    FAIL,
-}

+ 0 - 59
base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/BusinessType.java

@@ -1,59 +0,0 @@
-package com.ruoyi.common.log.enums;
-
-/**
- * 业务操作类型
- * 
- * @author ruoyi
- */
-public enum BusinessType
-{
-    /**
-     * 其它
-     */
-    OTHER,
-
-    /**
-     * 新增
-     */
-    INSERT,
-
-    /**
-     * 修改
-     */
-    UPDATE,
-
-    /**
-     * 删除
-     */
-    DELETE,
-
-    /**
-     * 授权
-     */
-    GRANT,
-
-    /**
-     * 导出
-     */
-    EXPORT,
-
-    /**
-     * 导入
-     */
-    IMPORT,
-
-    /**
-     * 强退
-     */
-    FORCE,
-
-    /**
-     * 生成代码
-     */
-    GENCODE,
-
-    /**
-     * 清空数据
-     */
-    CLEAN,
-}

+ 0 - 24
base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/enums/OperatorType.java

@@ -1,24 +0,0 @@
-package com.ruoyi.common.log.enums;
-
-/**
- * 操作人类别
- * 
- * @author ruoyi
- */
-public enum OperatorType
-{
-    /**
-     * 其它
-     */
-    OTHER,
-
-    /**
-     * 后台用户
-     */
-    MANAGE,
-
-    /**
-     * 手机端用户
-     */
-    MOBILE
-}

+ 0 - 29
base-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/service/AsyncLogService.java

@@ -1,29 +0,0 @@
-//package com.ruoyi.common.log.service;
-//
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.scheduling.annotation.Async;
-//import org.springframework.stereotype.Service;
-//import com.ruoyi.common.core.constant.SecurityConstants;
-//import com.ruoyi.system.api.RemoteLogService;
-//import com.ruoyi.system.api.domain.SysOperLog;
-//
-///**
-// * 异步调用日志服务
-// *
-// * @author ruoyi
-// */
-//@Service
-//public class AsyncLogService
-//{
-//    @Autowired
-//    private RemoteLogService remoteLogService;
-//
-//    /**
-//     * 保存系统日志记录
-//     */
-//    @Async
-//    public void saveSysLog(SysOperLog sysOperLog)
-//    {
-//        remoteLogService.saveLog(sysOperLog, SecurityConstants.INNER);
-//    }
-//}

+ 0 - 3
base-common/ruoyi-common-log/src/main/resources/META-INF/spring.factories

@@ -1,3 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  com.ruoyi.common.log.service.AsyncLogService,\
-  com.ruoyi.common.log.aspect.LogAspect

+ 0 - 33
base-common/ruoyi-common-redis/pom.xml

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xmlns="http://maven.apache.org/POM/4.0.0"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>com.usky</groupId>
-        <artifactId>base-common</artifactId>
-        <version>0.0.1</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>ruoyi-common-redis</artifactId>
-	
-    <description>
-        ruoyi-common-redis缓存服务
-    </description>
-
-    <dependencies>
-		
-        <!-- SpringBoot Boot Redis -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-        </dependency>
-        
-        <!-- RuoYi Common Core-->
-        <dependency>
-            <groupId>com.usky</groupId>
-            <artifactId>ruoyi-common-core</artifactId>
-        </dependency>
-        
-    </dependencies>
-</project>

+ 0 - 71
base-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/FastJson2JsonRedisSerializer.java

@@ -1,71 +0,0 @@
-package com.ruoyi.common.redis.configure;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.fasterxml.jackson.databind.JavaType;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import org.springframework.data.redis.serializer.RedisSerializer;
-import org.springframework.data.redis.serializer.SerializationException;
-import com.alibaba.fastjson.parser.ParserConfig;
-import org.springframework.util.Assert;
-import java.nio.charset.Charset;
-
-/**
- * Redis使用FastJson序列化
- *
- * @author ruoyi
- */
-public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
-{
-    @SuppressWarnings("unused")
-    private ObjectMapper objectMapper = new ObjectMapper();
-
-    public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
-
-    private Class<T> clazz;
-
-    static
-    {
-        ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
-    }
-
-    public FastJson2JsonRedisSerializer(Class<T> clazz)
-    {
-        super();
-        this.clazz = clazz;
-    }
-
-    @Override
-    public byte[] serialize(T t) throws SerializationException
-    {
-        if (t == null)
-        {
-            return new byte[0];
-        }
-        return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
-    }
-
-    @Override
-    public T deserialize(byte[] bytes) throws SerializationException
-    {
-        if (bytes == null || bytes.length <= 0)
-        {
-            return null;
-        }
-        String str = new String(bytes, DEFAULT_CHARSET);
-
-        return JSON.parseObject(str, clazz);
-    }
-
-    public void setObjectMapper(ObjectMapper objectMapper)
-    {
-        Assert.notNull(objectMapper, "'objectMapper' must not be null");
-        this.objectMapper = objectMapper;
-    }
-
-    protected JavaType getJavaType(Class<?> clazz)
-    {
-        return TypeFactory.defaultInstance().constructType(clazz);
-    }
-}

+ 0 - 50
base-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/RedisConfig.java

@@ -1,50 +0,0 @@
-package com.ruoyi.common.redis.configure;
-
-import org.springframework.cache.annotation.CachingConfigurerSupport;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
-
-/**
- * redis配置
- *
- * @author ruoyi
- */
-@Configuration
-@EnableCaching
-public class RedisConfig extends CachingConfigurerSupport
-{
-    @Bean
-    @SuppressWarnings(value = { "unchecked", "rawtypes" })
-    public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
-    {
-        RedisTemplate<Object, Object> template = new RedisTemplate<>();
-        template.setConnectionFactory(connectionFactory);
-
-        FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
-        mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
-        serializer.setObjectMapper(mapper);
-
-        // 使用StringRedisSerializer来序列化和反序列化redis的key值
-        template.setKeySerializer(new StringRedisSerializer());
-        template.setValueSerializer(serializer);
-
-        // Hash的key也采用StringRedisSerializer的序列化方式
-        template.setHashKeySerializer(new StringRedisSerializer());
-        template.setHashValueSerializer(serializer);
-
-        template.afterPropertiesSet();
-        return template;
-    }
-}

+ 0 - 256
base-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java

@@ -1,256 +0,0 @@
-package com.ruoyi.common.redis.service;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.BoundSetOperations;
-import org.springframework.data.redis.core.HashOperations;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.ValueOperations;
-import org.springframework.stereotype.Component;
-
-/**
- * spring redis 工具类
- *
- * @author ruoyi
- **/
-@SuppressWarnings(value = { "unchecked", "rawtypes" })
-@Component
-public class RedisService
-{
-    @Autowired
-    public RedisTemplate redisTemplate;
-
-    /**
-     * 缓存基本的对象,Integer、String、实体类等
-     *
-     * @param key 缓存的键值
-     * @param value 缓存的值
-     */
-    public <T> void setCacheObject(final String key, final T value)
-    {
-        redisTemplate.opsForValue().set(key, value);
-    }
-
-    /**
-     * 缓存基本的对象,Integer、String、实体类等
-     *
-     * @param key 缓存的键值
-     * @param value 缓存的值
-     * @param timeout 时间
-     * @param timeUnit 时间颗粒度
-     */
-    public <T> void setCacheObject(final String key, final T value, final Long timeout, final TimeUnit timeUnit)
-    {
-        redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
-    }
-
-    /**
-     * 设置有效时间
-     *
-     * @param key Redis键
-     * @param timeout 超时时间
-     * @return true=设置成功;false=设置失败
-     */
-    public boolean expire(final String key, final long timeout)
-    {
-        return expire(key, timeout, TimeUnit.SECONDS);
-    }
-
-    /**
-     * 设置有效时间
-     *
-     * @param key Redis键
-     * @param timeout 超时时间
-     * @param unit 时间单位
-     * @return true=设置成功;false=设置失败
-     */
-    public boolean expire(final String key, final long timeout, final TimeUnit unit)
-    {
-        return redisTemplate.expire(key, timeout, unit);
-    }
-
-    /**
-     * 获取有效时间
-     *
-     * @param key Redis键
-     * @return 有效时间
-     */
-    public long getExpire(final String key)
-    {
-        return redisTemplate.getExpire(key);
-    }
-
-    /**
-     * 判断 key是否存在
-     *
-     * @param key 键
-     * @return true 存在 false不存在
-     */
-    public Boolean hasKey(String key)
-    {
-        return redisTemplate.hasKey(key);
-    }
-
-    /**
-     * 获得缓存的基本对象。
-     *
-     * @param key 缓存键值
-     * @return 缓存键值对应的数据
-     */
-    public <T> T getCacheObject(final String key)
-    {
-        ValueOperations<String, T> operation = redisTemplate.opsForValue();
-        return operation.get(key);
-    }
-
-    /**
-     * 删除单个对象
-     *
-     * @param key
-     */
-    public boolean deleteObject(final String key)
-    {
-        return redisTemplate.delete(key);
-    }
-
-    /**
-     * 删除集合对象
-     *
-     * @param collection 多个对象
-     * @return
-     */
-    public long deleteObject(final Collection collection)
-    {
-        return redisTemplate.delete(collection);
-    }
-
-    /**
-     * 缓存List数据
-     *
-     * @param key 缓存的键值
-     * @param dataList 待缓存的List数据
-     * @return 缓存的对象
-     */
-    public <T> long setCacheList(final String key, final List<T> dataList)
-    {
-        Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
-        return count == null ? 0 : count;
-    }
-
-    /**
-     * 获得缓存的list对象
-     *
-     * @param key 缓存的键值
-     * @return 缓存键值对应的数据
-     */
-    public <T> List<T> getCacheList(final String key)
-    {
-        return redisTemplate.opsForList().range(key, 0, -1);
-    }
-
-    /**
-     * 缓存Set
-     *
-     * @param key 缓存键值
-     * @param dataSet 缓存的数据
-     * @return 缓存数据的对象
-     */
-    public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
-    {
-        BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
-        Iterator<T> it = dataSet.iterator();
-        while (it.hasNext())
-        {
-            setOperation.add(it.next());
-        }
-        return setOperation;
-    }
-
-    /**
-     * 获得缓存的set
-     *
-     * @param key
-     * @return
-     */
-    public <T> Set<T> getCacheSet(final String key)
-    {
-        return redisTemplate.opsForSet().members(key);
-    }
-
-    /**
-     * 缓存Map
-     *
-     * @param key
-     * @param dataMap
-     */
-    public <T> void setCacheMap(final String key, final Map<String, T> dataMap)
-    {
-        if (dataMap != null) {
-            redisTemplate.opsForHash().putAll(key, dataMap);
-        }
-    }
-
-    /**
-     * 获得缓存的Map
-     *
-     * @param key
-     * @return
-     */
-    public <T> Map<String, T> getCacheMap(final String key)
-    {
-        return redisTemplate.opsForHash().entries(key);
-    }
-
-    /**
-     * 往Hash中存入数据
-     *
-     * @param key Redis键
-     * @param hKey Hash键
-     * @param value 值
-     */
-    public <T> void setCacheMapValue(final String key, final String hKey, final T value)
-    {
-        redisTemplate.opsForHash().put(key, hKey, value);
-    }
-
-    /**
-     * 获取Hash中的数据
-     *
-     * @param key Redis键
-     * @param hKey Hash键
-     * @return Hash中的对象
-     */
-    public <T> T getCacheMapValue(final String key, final String hKey)
-    {
-        HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
-        return opsForHash.get(key, hKey);
-    }
-
-    /**
-     * 获取多个Hash中的数据
-     *
-     * @param key Redis键
-     * @param hKeys Hash键集合
-     * @return Hash对象集合
-     */
-    public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys)
-    {
-        return redisTemplate.opsForHash().multiGet(key, hKeys);
-    }
-
-    /**
-     * 获得缓存的基本对象列表
-     *
-     * @param pattern 字符串前缀
-     * @return 对象列表
-     */
-    public Collection<String> keys(final String pattern)
-    {
-        return redisTemplate.keys(pattern);
-    }
-}

+ 0 - 5
base-common/ruoyi-common-redis/src/main/resources/META-INF/spring.factories

@@ -1,5 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  com.ruoyi.common.redis.configure.RedisConfig,\
-  com.ruoyi.common.redis.service.RedisService
-
-

+ 4 - 4
base-components/gateway/pom.xml

@@ -71,10 +71,10 @@
         </dependency>
 
         <!-- RuoYi Common Redis-->
-        <dependency>
-            <groupId>com.usky</groupId>
-            <artifactId>ruoyi-common-redis</artifactId>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.usky</groupId>-->
+<!--            <artifactId>ruoyi-common-redis</artifactId>-->
+<!--        </dependency>-->
 
         <!-- Swagger -->
         <dependency>

+ 1 - 1
base-components/gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java

@@ -15,7 +15,7 @@ import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.sign.Base64;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.ruoyi.common.redis.service.RedisService;
+import com.usky.common.redis.service.RedisService;
 import com.ruoyi.gateway.config.properties.CaptchaProperties;
 import com.ruoyi.gateway.service.ValidateCodeService;
 

+ 5 - 1
base-modules/service-gen/pom.xml

@@ -69,7 +69,7 @@
         <!-- RuoYi Common Log -->
         <dependency>
             <groupId>com.usky</groupId>
-            <artifactId>ruoyi-common-log</artifactId>
+            <artifactId>usky-common-log</artifactId>
         </dependency>
         
         <!-- RuoYi Common Swagger -->
@@ -77,6 +77,10 @@
             <groupId>com.usky</groupId>
             <artifactId>ruoyi-common-swagger</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>usky-common-log</artifactId>
+        </dependency>
 
     </dependencies>
 

+ 1 - 2
base-modules/service-gen/src/main/java/com/ruoyi/gen/controller/GenController.java

@@ -5,6 +5,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -20,8 +21,6 @@ import com.ruoyi.common.core.text.Convert;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
-import com.ruoyi.common.log.annotation.Log;
-import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.gen.domain.GenTable;
 import com.ruoyi.gen.domain.GenTableColumn;

+ 4 - 4
pom.xml

@@ -257,15 +257,15 @@
             <!-- 日志记录 -->
             <dependency>
                 <groupId>com.usky</groupId>
-                <artifactId>ruoyi-common-log</artifactId>
-                <version>${ruoyi.version}</version>
+                <artifactId>usky-common-log</artifactId>
+                <version>${usky.version}</version>
             </dependency>
 
             <!-- 缓存服务 -->
             <dependency>
                 <groupId>com.usky</groupId>
-                <artifactId>ruoyi-common-redis</artifactId>
-                <version>${ruoyi.version}</version>
+                <artifactId>usky-common-redis</artifactId>
+                <version>${usky.version}</version>
             </dependency>
 
             <!-- cloud启动器 -->

+ 4 - 5
usky-common/common-cloud-starter/pom.xml

@@ -84,11 +84,10 @@
             <artifactId>ruoyi-common-datascope</artifactId>
         </dependency>
 
-<!--       <dependency>-->
-<!--           <groupId>com.usky</groupId>-->
-<!--           <artifactId>ruoyi-common-swagger</artifactId>-->
-<!--       </dependency>-->
-
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>ruoyi-common-swagger</artifactId>
+        </dependency>
 
     </dependencies>
 </project>