forked from Bin-mario/xiaoyaoji
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhoujingjie
committed
Mar 23, 2018
1 parent
821fc74
commit 4afc95d
Showing
52 changed files
with
907 additions
and
396 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
[ | ||
{ | ||
"id":"cn.xiaoyaoji.plugin.attachment", | ||
"id": "cn.xiaoyaoji.plugin.attachment", | ||
"name": "附件", | ||
"shortName": "附件", | ||
"clazz": "cn.xiaoyaoji.plugin.attachment.AttachmentPlugin", | ||
"description": "支持附件上传", | ||
"author": "zhoujingjie", | ||
"createTime": "2017/06/21", | ||
"version": "2.2", | ||
"events":["docEdit","docView"], | ||
"icon":{ | ||
"icon32x32":"/assets/http.png" | ||
"events": [ | ||
"docEdit", | ||
"docView" | ||
], | ||
"icon": { | ||
"icon32x32": "/assets/http.png" | ||
}, | ||
"dependency":{ | ||
"min":"2.3.0" | ||
"dependency": { | ||
"min": "2.3.0" | ||
}, | ||
"config":{ | ||
"excludeContentTypes":"" | ||
"config": { | ||
"excludeContentTypes": "" | ||
}, | ||
"supportPageTypes":["sys.http","sys.websocket"] | ||
"supportPageTypes": [ | ||
"sys.http", | ||
"sys.websocket" | ||
] | ||
} | ||
] |
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
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
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
101 changes: 101 additions & 0 deletions
101
xiaoyaoji-biz/src/main/java/cn/xiaoyaoji/core/plugin/PlatformPluginManager.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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package cn.xiaoyaoji.core.plugin; | ||
|
||
import cn.xiaoyaoji.core.plugin.doc.DocImportPlugin; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* ┏┓ ┏┓ | ||
* ┏┛┻━━━┛┻┓ | ||
* ┃ ┃ | ||
* ┃ ━ ┃ | ||
* ┃ ┳┛ ┗┳ ┃ | ||
* ┃ ┃ | ||
* ┃ ┻ ┃ | ||
* ┃ ┃ | ||
* ┗━┓ ┏━┛ | ||
* ┃ ┃神兽保佑 | ||
* ┃ ┃代码无BUG! | ||
* ┃ ┗━━━┓ | ||
* ┃ ┣┓ | ||
* ┃ ┏┛ | ||
* ┗┓┓┏━┳┓┏┛ | ||
* ┃┫┫ ┃┫┫ | ||
* ┗┻┛ ┗┻┛ | ||
* <p> | ||
* 系统平台插件 | ||
* | ||
* @author zhoujingjie | ||
* Date 2018-03-21 | ||
*/ | ||
public class PlatformPluginManager { | ||
private static PlatformPluginManager instance = new PlatformPluginManager(); | ||
|
||
private PlatformPluginManager() { | ||
|
||
} | ||
|
||
public static PlatformPluginManager getInstance() { | ||
return instance; | ||
} | ||
|
||
|
||
/** | ||
* 获取登录插件 | ||
* | ||
* @return list | ||
*/ | ||
public List<PluginInfo<LoginPlugin>> getLoginPlugins() { | ||
List<PluginInfo> pluginInfos = PluginManager.getInstance().getPlugins(Event.login); | ||
List<PluginInfo<LoginPlugin>> temp = new ArrayList<>(pluginInfos.size()); | ||
for (PluginInfo item : pluginInfos) { | ||
temp.add(item); | ||
} | ||
return temp; | ||
} | ||
|
||
/** | ||
* 获取所有导入插件 | ||
*/ | ||
public List<PluginInfo<DocImportPlugin>> getImportPlugins() { | ||
List<PluginInfo> list = PluginManager.getInstance().getPlugins(Event.docImport); | ||
List<PluginInfo<DocImportPlugin>> temp = new ArrayList<>(list.size()); | ||
for (PluginInfo item : list) { | ||
temp.add(item); | ||
} | ||
return temp; | ||
} | ||
|
||
/** | ||
* 获取导入插件 | ||
* | ||
* @param pluginId 插件id | ||
* @return 插件 | ||
*/ | ||
public PluginInfo<DocImportPlugin> getImportPlugin(String pluginId) { | ||
for (PluginInfo<DocImportPlugin> item : getImportPlugins()) { | ||
if (item.getId().equals(pluginId)) { | ||
return item; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
|
||
/** | ||
* 获取登录插件 | ||
* | ||
* @param pluginId 插件id | ||
* @return 登录插件 | ||
*/ | ||
public PluginInfo<LoginPlugin> getLoginPlugin(String pluginId) { | ||
for (PluginInfo<LoginPlugin> item : getLoginPlugins()) { | ||
if (item.getId().equals(pluginId)) { | ||
return item; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
} |
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
Oops, something went wrong.