-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pengweizhong/dev
更新版本
- Loading branch information
Showing
16 changed files
with
446 additions
and
460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,4 @@ | |
|
||
Class<?> dataSourceClass() default Void.class; | ||
|
||
//注解嵌套 | ||
// Reference reference() default @Reference(next=true); | ||
} |
This file was deleted.
Oops, something went wrong.
40 changes: 6 additions & 34 deletions
40
src/main/java/com/pengwz/dynamic/config/DataSourceConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,11 @@ | ||
package com.pengwz.dynamic.config; | ||
|
||
import com.pengwz.dynamic.exception.BraveException; | ||
import com.pengwz.dynamic.utils.StringUtils; | ||
import javax.sql.DataSource; | ||
|
||
import java.util.EnumMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
public interface DataSourceConfig /*extends CommonDataSource*/ { | ||
|
||
Properties getProperties(); | ||
|
||
class Properties { | ||
private EnumMap<DBConfigEnum, String> configEnumMap = new EnumMap<>(DBConfigEnum.class); | ||
private Map<String, String> otherConfigMap; | ||
|
||
public EnumMap<DBConfigEnum, String> getConfigEnumMap() { | ||
return configEnumMap; | ||
} | ||
|
||
public void setConfig(DBConfigEnum configEnum, String value) { | ||
if (StringUtils.isEmpty(value)) { | ||
throw new BraveException("value不可为空"); | ||
} | ||
configEnumMap.put(configEnum, value); | ||
} | ||
|
||
public Map<String, String> getOtherConfigMap() { | ||
return otherConfigMap; | ||
} | ||
|
||
public void setOtherConfigMap(Map<String, String> otherConfigMap) { | ||
this.otherConfigMap = otherConfigMap; | ||
} | ||
|
||
} | ||
public interface DataSourceConfig { | ||
/** | ||
* 若没有自定义数据源 ,请使用mysql链接驱动包自带的 MysqlDataSource | ||
*/ | ||
DataSource getDataSource(); | ||
|
||
} |
Oops, something went wrong.