1 Commits

Author SHA1 Message Date
binbin.hou
4ce823e161 release branch 1.3.0 2022-12-08 13:30:01 +08:00
14 changed files with 38 additions and 45 deletions

View File

@@ -53,3 +53,9 @@
| 1 | A | 添加 keyFormat | 2022-12-8 14:45:40 | | | 1 | A | 添加 keyFormat | 2022-12-8 14:45:40 | |
| 2 | A | 添加锁释放失败 | 2022-12-8 14:45:40 | | | 2 | A | 添加锁释放失败 | 2022-12-8 14:45:40 | |
| 3 | O | 加锁处理优化,接口统一优化 | 2022-12-8 14:45:40 | | | 3 | O | 加锁处理优化,接口统一优化 | 2022-12-8 14:45:40 | |
# release_1.3.0
| 序号 | 变更类型 | 说明 | 时间 | 备注 |
|:---|:---|:---|:---|:--|
| 1 | A | 让 redis-config 主动启用,避免无法主动管理的情况 | 2022-12-8 14:45:40 | |

View File

@@ -12,12 +12,12 @@
- 基于 redis 的分布式锁 - 基于 redis 的分布式锁
- 内置支持多种 redis 的整合方式
- 整合 spring - 整合 spring
- 整合 spring-boot - 整合 spring-boot
- 支持多种 redis 的整合方式
# 变更日志 # 变更日志
> [变更日志](CHANGELOG.md) > [变更日志](CHANGELOG.md)
@@ -36,7 +36,7 @@ maven 3.x+
<dependency> <dependency>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<artifactId>lock-core</artifactId> <artifactId>lock-core</artifactId>
<version>1.2.0</version> <version>1.3.0</version>
</dependency> </dependency>
``` ```
@@ -83,7 +83,7 @@ LockBs.newInstance()
<dependency> <dependency>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<artifactId>lock-spring</artifactId> <artifactId>lock-spring</artifactId>
<version>1.2.0</version> <version>1.3.0</version>
</dependency> </dependency>
``` ```
@@ -93,10 +93,13 @@ LockBs.newInstance()
`@EnableLock` 启用分布式锁。 `@EnableLock` 启用分布式锁。
`@EnableRedisConfig` 启用 redis 的默认配置。
```xml ```xml
@Configurable @Configurable
@ComponentScan(basePackages = "com.github.houbb.lock.test.service") @ComponentScan(basePackages = "com.github.houbb.lock.test.service")
@EnableLock @EnableLock
@EnableRedisConfig
public class SpringConfig { public class SpringConfig {
} }
``` ```
@@ -109,7 +112,6 @@ public @interface EnableLock {
/** /**
* 唯一标识生成策略 * 唯一标识生成策略
* @return 结果 * @return 结果
* @since 1.1.0
*/ */
String id() default "lockId"; String id() default "lockId";
@@ -119,21 +121,18 @@ public @interface EnableLock {
* 默认引入 redis-config 中的配置 * 默认引入 redis-config 中的配置
* *
* @return 实现 * @return 实现
* @since 1.1.0
*/ */
String cache() default "springRedisService"; String cache() default "springRedisService";
/** /**
* 加锁 key 格式化策略 * 加锁 key 格式化策略
* @return 策略 * @return 策略
* @since 1.2.0
*/ */
String lockKeyFormat() default "lockKeyFormat"; String lockKeyFormat() default "lockKeyFormat";
/** /**
* 锁释放失败处理类 * 锁释放失败处理类
* @return 结果 * @return 结果
* @since 1.2.0
*/ */
String lockReleaseFailHandler() default "lockReleaseFailHandler"; String lockReleaseFailHandler() default "lockReleaseFailHandler";
@@ -142,7 +141,7 @@ public @interface EnableLock {
其中 `springRedisService` 使用的是 [redis-config](https://github.com/houbb/redis-config) 中的实现。 其中 `springRedisService` 使用的是 [redis-config](https://github.com/houbb/redis-config) 中的实现。
redis 的配置信息如下: 对应注解 `@EnableRedisConfig`redis 的配置信息如下:
| 配置 | 说明 | 默认值 | 配置 | 说明 | 默认值
|:---|:---|:----| |:---|:---|:----|
@@ -219,21 +218,18 @@ public @interface Lock {
/** /**
* 时间单位 * 时间单位
* @return 单位 * @return 单位
* @since 1.2.0
*/ */
TimeUnit timeUnit() default TimeUnit.SECONDS; TimeUnit timeUnit() default TimeUnit.SECONDS;
/** /**
* 等待锁时间 * 等待锁时间
* @return 等待锁时间 * @return 等待锁时间
* @since 1.2.0
*/ */
long waitLockTime() default 10; long waitLockTime() default 10;
/** /**
* 业务加锁时间 * 业务加锁时间
* @return 加锁时间 * @return 加锁时间
* @since 1.2.0
*/ */
long lockTime() default 60; long lockTime() default 60;
@@ -248,7 +244,7 @@ public @interface Lock {
<dependency> <dependency>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<artifactId>lock-springboot-starter</artifactId> <artifactId>lock-springboot-starter</artifactId>
<version>1.2.0</version> <version>1.3.0</version>
</dependency> </dependency>
``` ```

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>lock</artifactId> <artifactId>lock</artifactId>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<version>1.2.0</version> <version>1.3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>lock</artifactId> <artifactId>lock</artifactId>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<version>1.2.0</version> <version>1.3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>lock</artifactId> <artifactId>lock</artifactId>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<version>1.2.0</version> <version>1.3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -1,16 +0,0 @@
package com.github.houbb.lock.spring.config;
import com.github.houbb.redis.config.spring.annotation.EnableRedisConfig;
import org.springframework.context.annotation.Configuration;
/**
* bean 配置
*
* @author binbin.hou
* @since 0.0.2
*/
@Configuration
@EnableRedisConfig
public class CommonCacheConfig {
}

View File

@@ -1,16 +1,12 @@
package com.github.houbb.lock.spring.config; package com.github.houbb.lock.spring.config;
import com.github.houbb.common.cache.api.service.ICommonCacheService; import com.github.houbb.common.cache.api.service.ICommonCacheService;
import com.github.houbb.heaven.util.lang.StringUtil;
import com.github.houbb.id.api.Id; import com.github.houbb.id.api.Id;
import com.github.houbb.id.core.core.Ids;
import com.github.houbb.lock.api.core.ILockKeyFormat; import com.github.houbb.lock.api.core.ILockKeyFormat;
import com.github.houbb.lock.api.core.ILockReleaseFailHandler; import com.github.houbb.lock.api.core.ILockReleaseFailHandler;
import com.github.houbb.lock.core.bs.LockBs; import com.github.houbb.lock.core.bs.LockBs;
import com.github.houbb.lock.spring.annotation.EnableLock; import com.github.houbb.lock.spring.annotation.EnableLock;
import com.github.houbb.redis.config.core.factory.JedisRedisServiceFactory;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.annotation.*; import org.springframework.context.annotation.*;
@@ -25,7 +21,7 @@ import org.springframework.core.type.AnnotationMetadata;
*/ */
@Configuration @Configuration
@ComponentScan(basePackages = "com.github.houbb.lock.spring") @ComponentScan(basePackages = "com.github.houbb.lock.spring")
@Import({LockBeanConfig.class, CommonCacheConfig.class}) @Import({LockBeanConfig.class})
public class LockAopConfig implements ImportAware, BeanFactoryPostProcessor { public class LockAopConfig implements ImportAware, BeanFactoryPostProcessor {
@Bean("lockBs") @Bean("lockBs")

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>lock</artifactId> <artifactId>lock</artifactId>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<version>1.2.0</version> <version>1.3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@@ -17,9 +17,15 @@
<artifactId>lock-spring</artifactId> <artifactId>lock-spring</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>redis-config-springboot-starter</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -1,8 +1,6 @@
package com.github.houbb.lock.springboot.starter.config; package com.github.houbb.lock.springboot.starter.config;
import com.github.houbb.lock.spring.annotation.EnableLock; import com.github.houbb.lock.spring.annotation.EnableLock;
import com.github.houbb.lock.spring.config.LockAopConfig;
import com.github.houbb.redis.config.spring.annotation.EnableRedisConfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>lock</artifactId> <artifactId>lock</artifactId>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<version>1.2.0</version> <version>1.3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -2,6 +2,7 @@ package com.github.houbb.lock.test.config;
import com.github.houbb.lock.spring.annotation.EnableLock; import com.github.houbb.lock.spring.annotation.EnableLock;
import com.github.houbb.redis.config.spring.annotation.EnableRedisConfig;
import org.springframework.beans.factory.annotation.Configurable; import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@@ -12,5 +13,6 @@ import org.springframework.context.annotation.ComponentScan;
@Configurable @Configurable
@ComponentScan(basePackages = "com.github.houbb.lock.test.service") @ComponentScan(basePackages = "com.github.houbb.lock.test.service")
@EnableLock @EnableLock
@EnableRedisConfig
public class SpringConfig { public class SpringConfig {
} }

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>lock</artifactId> <artifactId>lock</artifactId>
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<version>1.2.0</version> <version>1.3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<groupId>com.github.houbb</groupId> <groupId>com.github.houbb</groupId>
<artifactId>lock</artifactId> <artifactId>lock</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>1.2.0</version> <version>1.3.0</version>
<modules> <modules>
<module>lock-api</module> <module>lock-api</module>
<module>lock-core</module> <module>lock-core</module>
@@ -123,6 +123,11 @@
<artifactId>redis-config-spring</artifactId> <artifactId>redis-config-spring</artifactId>
<version>${redis-config.version}</version> <version>${redis-config.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>redis-config-springboot-starter</artifactId>
<version>${redis-config.version}</version>
</dependency>
<!--============================== OTHER ==============================--> <!--============================== OTHER ==============================-->
<dependency> <dependency>

View File

@@ -10,9 +10,9 @@ ECHO "============================= RELEASE START..."
:: 版本号信息(需要手动指定) :: 版本号信息(需要手动指定)
:::: 旧版本名称 :::: 旧版本名称
SET version=1.2.0 SET version=1.3.0
:::: 新版本名称 :::: 新版本名称
SET newVersion=1.3.0 SET newVersion=1.4.0
:::: 组织名称 :::: 组织名称
SET groupName=com.github.houbb SET groupName=com.github.houbb
:::: 项目名称 :::: 项目名称