release branch 1.3.0
This commit is contained in:
@@ -53,3 +53,9 @@
|
||||
| 1 | A | 添加 keyFormat | 2022-12-8 14:45:40 | |
|
||||
| 2 | A | 添加锁释放失败 | 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 | |
|
||||
|
||||
22
README.md
22
README.md
@@ -12,12 +12,12 @@
|
||||
|
||||
- 基于 redis 的分布式锁
|
||||
|
||||
- 内置支持多种 redis 的整合方式
|
||||
|
||||
- 整合 spring
|
||||
|
||||
- 整合 spring-boot
|
||||
|
||||
- 支持多种 redis 的整合方式
|
||||
|
||||
# 变更日志
|
||||
|
||||
> [变更日志](CHANGELOG.md)
|
||||
@@ -36,7 +36,7 @@ maven 3.x+
|
||||
<dependency>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>lock-core</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@@ -83,7 +83,7 @@ LockBs.newInstance()
|
||||
<dependency>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>lock-spring</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@@ -93,10 +93,13 @@ LockBs.newInstance()
|
||||
|
||||
`@EnableLock` 启用分布式锁。
|
||||
|
||||
`@EnableRedisConfig` 启用 redis 的默认配置。
|
||||
|
||||
```xml
|
||||
@Configurable
|
||||
@ComponentScan(basePackages = "com.github.houbb.lock.test.service")
|
||||
@EnableLock
|
||||
@EnableRedisConfig
|
||||
public class SpringConfig {
|
||||
}
|
||||
```
|
||||
@@ -109,7 +112,6 @@ public @interface EnableLock {
|
||||
/**
|
||||
* 唯一标识生成策略
|
||||
* @return 结果
|
||||
* @since 1.1.0
|
||||
*/
|
||||
String id() default "lockId";
|
||||
|
||||
@@ -119,21 +121,18 @@ public @interface EnableLock {
|
||||
* 默认引入 redis-config 中的配置
|
||||
*
|
||||
* @return 实现
|
||||
* @since 1.1.0
|
||||
*/
|
||||
String cache() default "springRedisService";
|
||||
|
||||
/**
|
||||
* 加锁 key 格式化策略
|
||||
* @return 策略
|
||||
* @since 1.2.0
|
||||
*/
|
||||
String lockKeyFormat() default "lockKeyFormat";
|
||||
|
||||
/**
|
||||
* 锁释放失败处理类
|
||||
* @return 结果
|
||||
* @since 1.2.0
|
||||
*/
|
||||
String lockReleaseFailHandler() default "lockReleaseFailHandler";
|
||||
|
||||
@@ -142,7 +141,7 @@ public @interface EnableLock {
|
||||
|
||||
其中 `springRedisService` 使用的是 [redis-config](https://github.com/houbb/redis-config) 中的实现。
|
||||
|
||||
redis 的配置信息如下:
|
||||
对应注解 `@EnableRedisConfig`,redis 的配置信息如下:
|
||||
|
||||
| 配置 | 说明 | 默认值
|
||||
|:---|:---|:----|
|
||||
@@ -219,21 +218,18 @@ public @interface Lock {
|
||||
/**
|
||||
* 时间单位
|
||||
* @return 单位
|
||||
* @since 1.2.0
|
||||
*/
|
||||
TimeUnit timeUnit() default TimeUnit.SECONDS;
|
||||
|
||||
/**
|
||||
* 等待锁时间
|
||||
* @return 等待锁时间
|
||||
* @since 1.2.0
|
||||
*/
|
||||
long waitLockTime() default 10;
|
||||
|
||||
/**
|
||||
* 业务加锁时间
|
||||
* @return 加锁时间
|
||||
* @since 1.2.0
|
||||
*/
|
||||
long lockTime() default 60;
|
||||
|
||||
@@ -248,7 +244,7 @@ public @interface Lock {
|
||||
<dependency>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>lock-springboot-starter</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>lock</artifactId>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>lock</artifactId>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>lock</artifactId>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
}
|
||||
@@ -1,16 +1,12 @@
|
||||
package com.github.houbb.lock.spring.config;
|
||||
|
||||
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.core.core.Ids;
|
||||
import com.github.houbb.lock.api.core.ILockKeyFormat;
|
||||
import com.github.houbb.lock.api.core.ILockReleaseFailHandler;
|
||||
import com.github.houbb.lock.core.bs.LockBs;
|
||||
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.factory.annotation.Value;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.context.annotation.*;
|
||||
@@ -25,7 +21,7 @@ import org.springframework.core.type.AnnotationMetadata;
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = "com.github.houbb.lock.spring")
|
||||
@Import({LockBeanConfig.class, CommonCacheConfig.class})
|
||||
@Import({LockBeanConfig.class})
|
||||
public class LockAopConfig implements ImportAware, BeanFactoryPostProcessor {
|
||||
|
||||
@Bean("lockBs")
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>lock</artifactId>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -17,9 +17,15 @@
|
||||
<artifactId>lock-spring</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>redis-config-springboot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.github.houbb.lock.springboot.starter.config;
|
||||
|
||||
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.context.annotation.Configuration;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>lock</artifactId>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.github.houbb.lock.test.config;
|
||||
|
||||
|
||||
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.context.annotation.ComponentScan;
|
||||
|
||||
@@ -12,5 +13,6 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
@Configurable
|
||||
@ComponentScan(basePackages = "com.github.houbb.lock.test.service")
|
||||
@EnableLock
|
||||
@EnableRedisConfig
|
||||
public class SpringConfig {
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>lock</artifactId>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
7
pom.xml
7
pom.xml
@@ -5,7 +5,7 @@
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>lock</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.2.0</version>
|
||||
<version>1.3.0</version>
|
||||
<modules>
|
||||
<module>lock-api</module>
|
||||
<module>lock-core</module>
|
||||
@@ -123,6 +123,11 @@
|
||||
<artifactId>redis-config-spring</artifactId>
|
||||
<version>${redis-config.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.houbb</groupId>
|
||||
<artifactId>redis-config-springboot-starter</artifactId>
|
||||
<version>${redis-config.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--============================== OTHER ==============================-->
|
||||
<dependency>
|
||||
|
||||
@@ -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
|
||||
:::: 项目名称
|
||||
|
||||
Reference in New Issue
Block a user