fix
This commit is contained in:
@@ -4,7 +4,7 @@ import java.util.List;
|
||||
|
||||
public interface IModuleFactory {
|
||||
|
||||
void register(Object object, Class<?> factoryClass, String name, String description);
|
||||
void register(Object object, Class<?> factoryClass, String name);
|
||||
|
||||
<T> T get(Class<T> factoryClass, String name) throws Throwable;
|
||||
|
||||
@@ -18,10 +18,10 @@ public interface IModuleFactory {
|
||||
|
||||
FactoryInfo getFactoryInfo(Class<?> factoryClass, String name) throws Throwable;
|
||||
|
||||
@SuppressWarnings({"LombokGetterMayBeUsed", "LombokSetterMayBeUsed"})
|
||||
class FactoryInfo {
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private Class<?> factoryClass;
|
||||
|
||||
public String getName() {
|
||||
@@ -32,14 +32,6 @@ public interface IModuleFactory {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Class<?> getFactoryClass() {
|
||||
return factoryClass;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,4 @@ public @interface FactoryMapping {
|
||||
/* 支持环境 */
|
||||
String[] actives() default {};
|
||||
|
||||
/* 说明信息 */
|
||||
String description() default "";
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ModuleFactoryImpl implements IModuleFactory {
|
||||
|
||||
public void autoRegisterFactory(Class<?> factoryClass) {
|
||||
List<Class<?>> classList = RunnerApplication.getClassList();
|
||||
if (classList != null && classList.size() > 0) {
|
||||
if (classList != null && !classList.isEmpty()) {
|
||||
for (Class<?> clazz : classList) {
|
||||
FactoryMapping factoryMapping = clazz.getAnnotation(FactoryMapping.class);
|
||||
if (factoryMapping != null) {
|
||||
@@ -31,8 +31,7 @@ public class ModuleFactoryImpl implements IModuleFactory {
|
||||
if ((actives.length == 0 || ArrayUtil.in(actives, currentActive))
|
||||
&& factoryClass.isAssignableFrom(clazz)) {
|
||||
Object object = RunnerContext.getBean(clazz);
|
||||
register(object, factoryClass, factoryMapping.name(),
|
||||
factoryMapping.description());
|
||||
register(object, factoryClass, factoryMapping.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,12 +39,11 @@ public class ModuleFactoryImpl implements IModuleFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(Object object, Class<?> factoryClass, String name, String description) {
|
||||
public void register(Object object, Class<?> factoryClass, String name) {
|
||||
String factoryName = factoryClass.getName();
|
||||
// info
|
||||
FactoryInfo factoryInfo = new FactoryInfo();
|
||||
factoryInfo.setName(name);
|
||||
factoryInfo.setDescription(description);
|
||||
factoryInfo.setFactoryClass(factoryClass);
|
||||
if (mInfo.containsKey(factoryName)) {
|
||||
mInfo.get(factoryName).put(name, factoryInfo);
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.iqudoo.platform.application.setting.SystemGlobalFileUploadConfig;
|
||||
import java.util.Date;
|
||||
|
||||
@SuppressWarnings({"DuplicatedCode", "SpellCheckingInspection"})
|
||||
@FactoryMapping(name = "ali-oss", description = "阿里云OSS文件上传")
|
||||
@FactoryMapping(name = "ali-oss")
|
||||
public class FileUploadAliossProviderImpl implements IFileUploadProvider {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,7 @@ import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
@SuppressWarnings({"DuplicatedCode"})
|
||||
@FactoryMapping(name = "local", description = "本地文件上传")
|
||||
@FactoryMapping(name = "local")
|
||||
public class FileUploadLocalProviderImpl implements IFileUploadProvider {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.iqudoo.platform.application.facade.repository.ISystemAdminInfoReposit
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@FactoryMapping(name = BizConstants.AUTH_GROUP_SYS_ADMIN, description = "系统管理员")
|
||||
@FactoryMapping(name = BizConstants.AUTH_GROUP_SYS_ADMIN)
|
||||
public class PermissionSystemAdminProviderImpl implements IPermissionProvider {
|
||||
|
||||
@Resource
|
||||
|
||||
Reference in New Issue
Block a user