韦二铭 5 年 前
コミット
21b56a8a90
19 ファイル変更348 行追加158 行削除
  1. 0 36
      base-springframework-starter/pom.xml
  2. 5 4
      base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/swagger/Swagger3Config.java
  3. 6 0
      base-springframework/base-springframework-mysql/pom.xml
  4. 0 24
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/config/MybatisPlusConfig.java
  5. 17 0
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/config/CustomMybatisPlusProperties.java
  6. 57 0
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/config/MybatisPlusConfig.java
  7. 36 0
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/BaseIService.java
  8. 25 0
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/BaseMapper.java
  9. 60 0
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/BaseServiceImpl.java
  10. 25 0
      base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/injector/CustomSqlInjector.java
  11. 4 1
      base-springframework/base-springframework-mysql/src/main/resources/META-INF/spring.factories
  12. 2 1
      base-springframework/base-springframework-mysql/src/main/resources/application-mysql.yml
  13. 24 0
      base-springframework/base-springframework-mysql/src/main/resources/spy.properties
  14. 4 3
      base-springframework/base-springframework-redis/pom.xml
  15. 5 0
      base-springframework/base-springframework-redis/src/main/java/com/wei/base/springframework/redis/config/RedisProperties.java
  16. 57 17
      base-springframework/base-springframework-redis/src/main/java/com/wei/base/springframework/redis/utils/RedisLock.java
  17. 21 0
      base-springframework/base-springframework-redis/src/main/java/com/wei/base/springframework/redis/vo/LockContent.java
  18. 0 36
      base-springframework/pom.xml
  19. 0 36
      pom.xml

+ 0 - 36
base-springframework-starter/pom.xml

@@ -23,7 +23,6 @@
         <lombok.version>1.18.12</lombok.version>
         <spring-boot-starter.version>2.3.1.RELEASE</spring-boot-starter.version>
         <spring.version>5.2.7.RELEASE</spring.version>
-        <kotlin.version>1.4.10</kotlin.version>
     </properties>
 
     <dependencies>
@@ -37,17 +36,6 @@
             <artifactId>base-springframework-cloud</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.jetbrains.kotlin</groupId>
-            <artifactId>kotlin-stdlib-jdk8</artifactId>
-            <version>${kotlin.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jetbrains.kotlin</groupId>
-            <artifactId>kotlin-test</artifactId>
-            <version>${kotlin.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <dependencyManagement>
@@ -81,30 +69,6 @@
                     <target>${maven.compiler.target}</target>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.jetbrains.kotlin</groupId>
-                <artifactId>kotlin-maven-plugin</artifactId>
-                <version>${kotlin.version}</version>
-                <executions>
-                    <execution>
-                        <id>compile</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>compile</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>test-compile</id>
-                        <phase>test-compile</phase>
-                        <goals>
-                            <goal>test-compile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <jvmTarget>1.8</jvmTarget>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 

+ 5 - 4
base-springframework/base-springframework-core/src/main/java/com/wei/base/springframework/core/swagger/Swagger3Config.java

@@ -1,9 +1,10 @@
 package com.wei.base.springframework.core.swagger;
 
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.ConfigurableEnvironment;
 import springfox.documentation.builders.ApiInfoBuilder;
 import springfox.documentation.builders.PathSelectors;
 import springfox.documentation.builders.RequestHandlerSelectors;
@@ -24,8 +25,8 @@ import springfox.documentation.spring.web.plugins.Docket;
 @Configuration
 public class Swagger3Config {
 
-    @Value("${spring.application.name}")
-    private String applicationName;
+    @Autowired
+    private ConfigurableEnvironment env;
 
     @Bean
     public Docket createRestApi() {
@@ -39,7 +40,7 @@ public class Swagger3Config {
 
     private ApiInfo apiInfo() {
         return new ApiInfoBuilder()
-                .title(applicationName + "接口文档")
+                .title(env.getProperty("spring.application.name") + "接口文档")
                 .description("所有返回数据都会包含{\"code\" : 200, \"message\" : \"test\", \"data\": Responses}")
                 .contact(new Contact("prinz wei",
                         "https://github.com/weiem/base-framework",

+ 6 - 0
base-springframework/base-springframework-mysql/pom.xml

@@ -20,6 +20,7 @@
         <mysql-connector-java.version>8.0.21</mysql-connector-java.version>
         <mybatis-plus.version>3.3.2</mybatis-plus.version>
         <freemarker.version>2.3.30</freemarker.version>
+        <p6spy.version>3.9.1</p6spy.version>
     </properties>
 
     <dependencies>
@@ -53,6 +54,11 @@
             <artifactId>freemarker</artifactId>
             <version>${freemarker.version}</version>
         </dependency>
+        <dependency>
+            <groupId>p6spy</groupId>
+            <artifactId>p6spy</artifactId>
+            <version>${p6spy.version}</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 0 - 24
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/config/MybatisPlusConfig.java

@@ -1,24 +0,0 @@
-package com.wei.base.springframework.mysql.config;
-
-import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-@EnableTransactionManagement
-@MapperScan("com.wei.**.mapper")
-@Configuration
-public class MybatisPlusConfig {
-
-    /**
-     * 设置分页能够查询总条数
-     *
-     * @return
-     */
-    @Bean
-    public PaginationInterceptor paginationInterceptor() {
-        PaginationInterceptor page = new PaginationInterceptor();
-        return page;
-    }
-}

+ 17 - 0
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/config/CustomMybatisPlusProperties.java

@@ -0,0 +1,17 @@
+package com.wei.base.springframework.mysql.mybatisplus.config;
+
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Data
+@Configuration
+@ConfigurationProperties(prefix = Constants.MYBATIS_PLUS)
+public class CustomMybatisPlusProperties {
+
+    /**
+     * 每次插入的大小
+     */
+    private Integer batchSize;
+}

+ 57 - 0
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/config/MybatisPlusConfig.java

@@ -0,0 +1,57 @@
+package com.wei.base.springframework.mysql.mybatisplus.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.core.parser.ISqlParser;
+import com.baomidou.mybatisplus.extension.parsers.BlockAttackSqlParser;
+import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
+import com.google.common.collect.Lists;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import java.util.List;
+
+@EnableTransactionManagement
+@MapperScan("com.wei.**.mapper")
+@Configuration
+public class MybatisPlusConfig {
+
+    /**
+     * 分页插件
+     *
+     * @return ignore
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
+        // 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求  默认false
+        // paginationInterceptor.setOverflow(false);
+
+        // 设置最大单页限制数量,默认 500 条,-1 不受限制
+        // paginationInterceptor.setLimit(500);
+
+        // 开启 count 的 join 优化,只针对部分 left join
+        paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
+
+        // 对于单一数据库类型来说,都建议配置该值,避免每次分页都去抓取数据库类型
+        paginationInterceptor.setDbType(DbType.MYSQL);
+
+        // 攻击 SQL 阻断解析器、加入解析链
+        List<ISqlParser> sqlParserList = Lists.newArrayList(new BlockAttackSqlParser());
+        paginationInterceptor.setSqlParserList(sqlParserList);
+        return paginationInterceptor;
+    }
+
+    /**
+     * 乐观锁插件
+     *
+     * @return ignore
+     */
+    @Bean
+    public OptimisticLockerInterceptor optimisticLockerInterceptor() {
+        return new OptimisticLockerInterceptor();
+    }
+}

+ 36 - 0
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/BaseIService.java

@@ -0,0 +1,36 @@
+package com.wei.base.springframework.mysql.mybatisplus.core;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+public interface BaseIService<T> extends IService<T> {
+
+    /**
+     * 批量插入,如果插入字段为null不会取数据库里配置的默认值
+     *
+     * @param entityList ignore
+     * @return ignore
+     */
+    int insertBatchSomeColumn(List<T> entityList);
+
+    /**
+     * 批量插入,如果插入字段为null不会取数据库里配置的默认值
+     *
+     * @param entityList ignore
+     * @param batchSize  ignore
+     * @return ignore
+     */
+    int insertBatchSomeColumn(List<T> entityList, int batchSize);
+
+    /**
+     * 逻辑删除 需要在实体里逻辑删除的字段上添加@TableLogic注解
+     * 根据 id 逻辑删除数据,并带字段填充功能
+     * 如果要更新更新时间的话需要在更新时间字段上带上 @TableField(fill = FieldFill.INSERT_UPDATE, update = "now()")
+     * 注解 具体的查看注解内的注释
+     *
+     * @param entity ignore
+     * @return ignore
+     */
+    int deleteByIdWithFill(T entity);
+}

+ 25 - 0
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/BaseMapper.java

@@ -0,0 +1,25 @@
+package com.wei.base.springframework.mysql.mybatisplus.core;
+
+import java.util.List;
+
+public interface BaseMapper<T> extends com.baomidou.mybatisplus.core.mapper.BaseMapper<T> {
+
+    /**
+     * 批量插入,如果插入字段为null不会取数据库里配置的默认值
+     *
+     * @param entityList
+     * @return
+     */
+    int insertBatchSomeColumn(List<T> entityList);
+    
+    /**
+     * 逻辑删除 需要在实体里逻辑删除的字段上添加@TableLogic注解
+     * 根据 id 逻辑删除数据,并带字段填充功能
+     * 如果要更新更新时间的话需要在更新时间字段上带上 @TableField(fill = FieldFill.INSERT_UPDATE, update = "now()")
+     * 注解 具体的查看注解内的注释
+     *
+     * @param entity ignore
+     * @return ignore
+     */
+    int deleteByIdWithFill(T entity);
+}

+ 60 - 0
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/BaseServiceImpl.java

@@ -0,0 +1,60 @@
+package com.wei.base.springframework.mysql.mybatisplus.core;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.wei.base.springframework.mysql.mybatisplus.config.CustomMybatisPlusProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+public class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> implements BaseIService<T> {
+
+    @Autowired
+    protected M baseMapper;
+
+    @Autowired
+    private CustomMybatisPlusProperties customMybatisPlusProperties;
+
+    /**
+     * 批量插入,如果插入字段为null不会取数据库里配置的默认值
+     *
+     * @param entityList ignore
+     * @return ignore
+     */
+    @Override
+    public int insertBatchSomeColumn(List<T> entityList) {
+        return insertBatchSomeColumn(entityList, customMybatisPlusProperties.getBatchSize());
+    }
+
+    /**
+     * 批量插入,如果插入字段为null不会取数据库里配置的默认值
+     *
+     * @param entityList ignore
+     * @param batchSize  ignore
+     * @return ignore
+     */
+    @Override
+    public int insertBatchSomeColumn(List<T> entityList, int batchSize) {
+        List<List<T>> partition = Lists.partition(entityList, batchSize);
+        int i = 0;
+        for (List<T> list : partition) {
+            i += baseMapper.insertBatchSomeColumn(list);
+        }
+
+        return i;
+    }
+
+    /**
+     * 逻辑删除 需要在实体里逻辑删除的字段上添加@TableLogic注解
+     * 根据 id 逻辑删除数据,并带字段填充功能
+     * 如果要更新更新时间的话需要在更新时间字段上带上 @TableField(fill = FieldFill.INSERT_UPDATE, update = "now()")
+     * 注解 具体的查看注解内的注释
+     *
+     * @param entity ignore
+     * @return ignore
+     */
+    @Override
+    public int deleteByIdWithFill(T entity) {
+        return baseMapper.deleteByIdWithFill(entity);
+    }
+}

+ 25 - 0
base-springframework/base-springframework-mysql/src/main/java/com/wei/base/springframework/mysql/mybatisplus/core/injector/CustomSqlInjector.java

@@ -0,0 +1,25 @@
+package com.wei.base.springframework.mysql.mybatisplus.core.injector;
+
+import com.baomidou.mybatisplus.core.injector.AbstractMethod;
+import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
+import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
+import com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class CustomSqlInjector extends DefaultSqlInjector {
+
+    @Override
+    public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
+        List<AbstractMethod> methodList = super.getMethodList(mapperClass);
+
+        // 批量插入
+        methodList.add(new InsertBatchSomeColumn());
+
+        // 逻辑删除
+        methodList.add(new LogicDeleteByIdWithFill());
+        return methodList;
+    }
+}

+ 4 - 1
base-springframework/base-springframework-mysql/src/main/resources/META-INF/spring.factories

@@ -1,4 +1,7 @@
 org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-  com.wei.base.springframework.mysql.config.MybatisPlusConfig
+  com.wei.base.springframework.mysql.mybatisplus.config.MybatisPlusConfig,\
+  com.wei.base.springframework.mysql.mybatisplus.core.injector.CustomSqlInjector,\
+  com.wei.base.springframework.mysql.mybatisplus.config.CustomMybatisPlusProperties
+
 org.springframework.boot.env.EnvironmentPostProcessor=\
   com.wei.base.springframework.mysql.env.InitializeCustomConfiguration

+ 2 - 1
base-springframework/base-springframework-mysql/src/main/resources/application-mysql.yml

@@ -1,11 +1,12 @@
 #公共配置 减少各个项目中的配置
 spring:
   datasource:
-    driver: com.mysql.cj.jdbc.Driver
+    driver-class-name: com.p6spy.engine.spy.P6SpyDriver
 
 mybatis-plus:
   #指明mapper.xml扫描位置(classpath* 代表编译后类文件根目录)
   mapper-locations: classpath:/mapper/*.xml
+  batchSize: 500
   global-config:
     #主键类型 0:数据库ID自增, 1:用户输入ID,2:全局唯一ID (数字类型唯一ID), 3:全局唯一ID UUID
     id-type: 2

+ 24 - 0
base-springframework/base-springframework-mysql/src/main/resources/spy.properties

@@ -0,0 +1,24 @@
+#3.2.1以上使用
+modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
+#3.2.1以下使用或者不配置
+#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
+# 自定义日志打印
+logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
+#日志输出到控制台
+appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
+# 使用日志系统记录 sql
+#appender=com.p6spy.engine.spy.appender.Slf4JLogger
+# 设置 p6spy driver 代理
+deregisterdrivers=true
+# 取消JDBC URL前缀
+useprefix=true
+# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
+excludecategories=info,debug,result,commit,resultset
+# 日期格式
+dateformat=yyyy-MM-dd HH:mm:ss
+# 实际驱动可多个
+#driverlist=org.h2.Driver
+# 是否开启慢SQL记录
+outagedetection=true
+# 慢SQL记录标准 2 秒
+outagedetectioninterval=2

+ 4 - 3
base-springframework/base-springframework-redis/pom.xml

@@ -16,6 +16,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <java.version>1.8</java.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <redisson-spring-boot-starter.version>3.13.4</redisson-spring-boot-starter.version>
     </properties>
 
     <dependencies>
@@ -26,9 +27,9 @@
         </dependency>
 
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-            <version>${spring-boot-starter.version}</version>
+            <groupId>org.redisson</groupId>
+            <artifactId>redisson-spring-boot-starter</artifactId>
+            <version>${redisson-spring-boot-starter.version}</version>
         </dependency>
     </dependencies>
 

+ 5 - 0
base-springframework/base-springframework-redis/src/main/java/com/wei/base/springframework/redis/config/RedisProperties.java

@@ -21,4 +21,9 @@ public class RedisProperties implements Serializable {
      * redis锁默认过期时间
      */
     Long expirationTime;
+
+    /**
+     * redis锁等待时间
+     */
+    Long waitTime;
 }

+ 57 - 17
base-springframework/base-springframework-redis/src/main/java/com/wei/base/springframework/redis/utils/RedisLock.java

@@ -1,61 +1,101 @@
 package com.wei.base.springframework.redis.utils;
 
 import com.wei.base.springframework.redis.config.RedisProperties;
+import lombok.extern.slf4j.Slf4j;
+import org.redisson.api.RLock;
+import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
 
 import java.util.concurrent.TimeUnit;
 
+@Slf4j
 @Component
 public class RedisLock<T> {
 
     @Autowired
-    private RedisTemplate<String, T> redisTemplate;
+    RedissonClient redissonClient;
 
     @Autowired
     private RedisProperties redisProperties;
 
     /**
-     * 锁
+     * 可重入
      *
      * @param key            锁key值
      * @param expirationTime 过期时间
      * @param timeUnit       时间单位
-     * @return true枷锁成功, false枷锁失败
+     * @return 锁对象, 解锁方式  RLock.unlock()
      */
-    public Boolean lock(String key, Long expirationTime, TimeUnit timeUnit) {
-        return redisTemplate.opsForValue().setIfAbsent(redisProperties.getLockKey() + key, (T) "", expirationTime, timeUnit);
+    public RLock lock(String key, long expirationTime, TimeUnit timeUnit) {
+        RLock rLock = redissonClient.getLock(redisProperties.getLockKey() + key);
+        rLock.lock(expirationTime, timeUnit);
+        return rLock;
     }
 
     /**
-     * 锁(过期时间30秒)
+     * 可重入锁(过期时间30秒)
      *
      * @param key 锁key值
-     * @return true枷锁成功, false枷锁失败
+     * @return 锁对象, 解锁方式  RLock.unlock()
      */
-    public Boolean lock(String key) {
+    public RLock lock(String key) {
         return lock(key, redisProperties.getExpirationTime(), TimeUnit.SECONDS);
     }
 
     /**
-     * 锁
+     * 可重入
      *
      * @param key            锁key值
      * @param expirationTime 过期时间(单位:秒)
-     * @return true枷锁成功, false枷锁失败
+     * @return 锁对象, 解锁方式  RLock.unlock()
      */
-    public Boolean lock(String key, Long expirationTime) {
+    public RLock lock(String key, long expirationTime) {
         return lock(key, expirationTime, TimeUnit.SECONDS);
     }
 
     /**
-     * 解锁
+     * 尝试获取锁
+     * <p>
+     * try {
+     * if(tryLock(key)) {
+     * <p>
+     * }
+     * } catch (Exception e) {
+     * } finally {
+     * // 无论如何, 最后都要解锁
+     * unlock();
+     * }
      *
-     * @param key 锁key值
-     * @return true:成功,false:失败
+     * @param rLock     当前锁对象
+     * @param waitTime  等待时间
+     * @param leaseTime 过期时间
+     * @param unit      时间单位
+     * @return true获取成功, false获取失败
+     * @throws InterruptedException 如果线程中断
+     */
+    public Boolean tryLock(RLock rLock, long waitTime, long leaseTime, TimeUnit unit) throws InterruptedException {
+        return rLock.tryLock(waitTime, leaseTime, unit);
+    }
+
+    /**
+     * 尝试获取锁
+     * <p>
+     * try {
+     * if(tryLock(key)) {
+     * <p>
+     * }
+     * } catch (Exception e) {
+     * } finally {
+     * // 无论如何, 最后都要解锁
+     * unlock();
+     * }
+     *
+     * @param rLock 当前锁对象
+     * @return true获取成功, false获取失败
+     * @throws InterruptedException 如果线程中断
      */
-    public Boolean unlock(String key) {
-        return redisTemplate.opsForValue().getOperations().delete(redisProperties.getLockKey() + key);
+    public Boolean tryLock(RLock rLock) throws InterruptedException {
+        return tryLock(rLock, redisProperties.getWaitTime(), redisProperties.getExpirationTime(), TimeUnit.SECONDS);
     }
 }

+ 21 - 0
base-springframework/base-springframework-redis/src/main/java/com/wei/base/springframework/redis/vo/LockContent.java

@@ -0,0 +1,21 @@
+package com.wei.base.springframework.redis.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class LockContent implements Serializable {
+
+    private static final long serialVersionUID = 1923389751075205531L;
+
+    /**
+     * 锁Id
+     */
+    private String lockId;
+
+    /**
+     * 锁超时时间
+     */
+    private Long lockExpirationTime;
+}

+ 0 - 36
base-springframework/pom.xml

@@ -31,7 +31,6 @@
         <commons-lang3.version>3.10</commons-lang3.version>
         <commons-collections4.version>4.4</commons-collections4.version>
         <commons-io.version>1.3.2</commons-io.version>
-        <kotlin.version>1.4.10</kotlin.version>
     </properties>
 
     <dependencies>
@@ -76,17 +75,6 @@
             <artifactId>commons-io</artifactId>
             <version>${commons-io.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.jetbrains.kotlin</groupId>
-            <artifactId>kotlin-stdlib-jdk8</artifactId>
-            <version>${kotlin.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jetbrains.kotlin</groupId>
-            <artifactId>kotlin-test</artifactId>
-            <version>${kotlin.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
     <build>
         <plugins>
@@ -99,30 +87,6 @@
                     <target>${maven.compiler.target}</target>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.jetbrains.kotlin</groupId>
-                <artifactId>kotlin-maven-plugin</artifactId>
-                <version>${kotlin.version}</version>
-                <executions>
-                    <execution>
-                        <id>compile</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>compile</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>test-compile</id>
-                        <phase>test-compile</phase>
-                        <goals>
-                            <goal>test-compile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <jvmTarget>1.8</jvmTarget>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 

+ 0 - 36
pom.xml

@@ -22,21 +22,9 @@
         <maven.compiler.target>1.8</maven.compiler.target>
         <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
         <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
-        <kotlin.version>1.4.10</kotlin.version>
     </properties>
 
     <dependencies>
-        <dependency>
-            <groupId>org.jetbrains.kotlin</groupId>
-            <artifactId>kotlin-stdlib-jdk8</artifactId>
-            <version>${kotlin.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jetbrains.kotlin</groupId>
-            <artifactId>kotlin-test</artifactId>
-            <version>${kotlin.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <build>
@@ -59,30 +47,6 @@
                     <target>${maven.compiler.target}</target>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.jetbrains.kotlin</groupId>
-                <artifactId>kotlin-maven-plugin</artifactId>
-                <version>${kotlin.version}</version>
-                <executions>
-                    <execution>
-                        <id>compile</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>compile</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>test-compile</id>
-                        <phase>test-compile</phase>
-                        <goals>
-                            <goal>test-compile</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <jvmTarget>1.8</jvmTarget>
-                </configuration>
-            </plugin>
         </plugins>
     </build>