Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
🔖 发布1.1.2版本
Browse files Browse the repository at this point in the history
  • Loading branch information
opcooc committed Sep 18, 2022
1 parent aea88f8 commit 9d5f48d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
<dependency>
<groupId>com.opcooc</groupId>
<artifactId>opcooc-storage-spring-boot-starter</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
</dependency>
```
- Gradle
```groovy
implementation 'com.opcooc:opcooc-storage-spring-boot-starter:1.1.1'
implementation 'com.opcooc:opcooc-storage-spring-boot-starter:1.1.2'
```

## 添加配置,在 `application.yml` 中添加配置信息
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
encoding=UTF-8

#project version
opcoocVersion=1.1.1
opcoocVersion=1.1.2

sonatypeUsername=*
sonatypePassword=*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@Setter
public class ClientDriverHolder {

public ClientDriver getClientDriver(ClientDriverProperty property) {
public static ClientDriver getClientDriver(ClientDriverProperty property) {

if (property.getCustomClient() != null) {
//实例化自定义 ClientDriver
Expand All @@ -54,7 +54,7 @@ public ClientDriver getClientDriver(ClientDriverProperty property) {
return getDefaultS3ClientDriver(property);
}

public ClientDriver getCustomizeClientDriver(ClientDriverProperty property) {
public static ClientDriver getCustomizeClientDriver(ClientDriverProperty property) {
// 校验配置合法性
property.preCheck();
Client client = StorageUtil.instantiateClass(property.getCustomClient(), property);
Expand All @@ -63,7 +63,7 @@ public ClientDriver getCustomizeClientDriver(ClientDriverProperty property) {
return driver;
}

public ClientDriver getDefaultS3ClientDriver(ClientDriverProperty property) {
public static ClientDriver getDefaultS3ClientDriver(ClientDriverProperty property) {
// 校验配置合法性
property.preCheck();
S3Client client = new S3Client(property);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;

import com.opcooc.storage.drivers.ClientDriver;
Expand All @@ -33,16 +32,13 @@
*/
public abstract class AbstractClientDriverProvider implements ClientDriverProvider {

@Autowired
private ClientDriverHolder clientDriverHolder;

protected Map<String, ClientDriver> createClientDriverMap(Map<String, ClientDriverProperty> clientDriverMap) {

Map<String, ClientDriver> map = new HashMap<>(clientDriverMap.size() * 2);
for (Map.Entry<String, ClientDriverProperty> item : clientDriverMap.entrySet()) {
ClientDriverProperty clientDriverProperty = item.getValue();
String driverName = clientDriverProperty.getDriver();
ClientDriver driver = clientDriverHolder.getClientDriver(clientDriverProperty);
ClientDriver driver = ClientDriverHolder.getClientDriver(clientDriverProperty);
if (ObjectUtils.isEmpty(driverName)) {
driverName = item.getKey();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.opcooc.storage.aop.DynamicClientAnnotationInterceptor;
import com.opcooc.storage.drivers.ClientDriver;
import com.opcooc.storage.drivers.DynamicRoutingClientDriver;
import com.opcooc.storage.holder.ClientDriverHolder;
import com.opcooc.storage.processor.OsHeaderProcessor;
import com.opcooc.storage.processor.OsProcessor;
import com.opcooc.storage.processor.OsSessionProcessor;
Expand All @@ -41,7 +40,6 @@
import com.opcooc.storage.support.ObjectConverter;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
* 自动IOC注入类
Expand All @@ -63,12 +61,6 @@ public YmlClientDriverProvider ymlClientDriverProvider() {
return new YmlClientDriverProvider(properties.getDriver());
}

@Bean
@ConditionalOnMissingBean
public ClientDriverHolder clientDriverHolder() {
return new ClientDriverHolder();
}

@Bean
@ConditionalOnMissingBean
public ClientDriver clientDriver() {
Expand Down

0 comments on commit 9d5f48d

Please sign in to comment.