Browse Source

open

master
pioneer 2 years ago
commit
e32cd7e883
  1. 6
      README.md
  2. BIN
      doc/插件使用文档.docx
  3. BIN
      lib/finekit-10.0-20220427.jar
  4. 23
      plugin.xml
  5. 12
      src/main/java/com/fr/plugin/FunctionRecoder.java
  6. 17
      src/main/java/com/fr/plugin/SYNOWLifeCycleMonitor.java
  7. 16
      src/main/java/com/fr/plugin/http/SYNOWHttpHandler.java
  8. 14
      src/main/java/com/fr/plugin/http/SYNOWUrlAliasProvider.java
  9. 33
      src/main/java/com/fr/plugin/http/handler/GETSynNow1Handler.java
  10. 3
      src/main/resources/com/fr/plugin/call.js

6
README.md

@ -0,0 +1,6 @@
# open-JSD-10377
JSD-10377 CPT模板增加按钮可以点击触发调用同步用户管理的立即同步\
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\
仅作为开发者学习参考使用!禁止用于任何商业用途!\
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系【pioneer】处理。

BIN
doc/插件使用文档.docx

Binary file not shown.

BIN
lib/finekit-10.0-20220427.jar

Binary file not shown.

23
plugin.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plugin>
<id>com.eco.plugin.xx.synow</id>
<name><![CDATA[立即同步接口]]></name>
<active>yes</active>
<version>1.0.0</version>
<env-version>10.0</env-version>
<jartime>2021-02-10</jartime>
<vendor>fr.open</vendor>
<main-package>com.fr.plugin</main-package>
<!--用来记录这个任务的创建时间-->
<description><![CDATA[
JSD 10377
]]></description>
<!--任务ID: -->
<create-day>2022-6-6 18:27:58</create-day>
<extra-decision>
<HttpHandlerProvider class="com.fr.plugin.http.SYNOWHttpHandler"/>
<URLAliasProvider class="com.fr.plugin.http.SYNOWUrlAliasProvider"/>
</extra-decision>
<lifecycle-monitor class="com.fr.plugin.SYNOWLifeCycleMonitor"/>
<function-recorder class="com.fr.plugin.FunctionRecoder"/>
</plugin>

12
src/main/java/com/fr/plugin/FunctionRecoder.java

@ -0,0 +1,12 @@
package com.fr.plugin;
import com.fr.plugin.transform.ExecuteFunctionRecord;
import com.fr.plugin.transform.FunctionRecorder;
@FunctionRecorder
public class FunctionRecoder {
@ExecuteFunctionRecord
public void exe(){
System.out.println("插件功能埋点,虽然不会执行,除非上架应用");
}
}

17
src/main/java/com/fr/plugin/SYNOWLifeCycleMonitor.java

@ -0,0 +1,17 @@
package com.fr.plugin;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor;
import com.fr.stable.fun.Authorize;
@Authorize
public class SYNOWLifeCycleMonitor extends AbstractPluginLifecycleMonitor {
@Override
public void afterRun(PluginContext pluginContext) {
}
@Override
public void beforeStop(PluginContext pluginContext) {
}
}

16
src/main/java/com/fr/plugin/http/SYNOWHttpHandler.java

@ -0,0 +1,16 @@
package com.fr.plugin.http;
import com.fr.decision.fun.HttpHandler;
import com.fr.decision.fun.impl.AbstractHttpHandlerProvider;
import com.fr.plugin.http.handler.*;
public class SYNOWHttpHandler extends AbstractHttpHandlerProvider {
HttpHandler[] actions = new HttpHandler[]{
new GETSynNow1Handler(),
};
@Override
public HttpHandler[] registerHandlers() {
return actions;
}
}

14
src/main/java/com/fr/plugin/http/SYNOWUrlAliasProvider.java

@ -0,0 +1,14 @@
package com.fr.plugin.http;
import com.fr.decision.fun.impl.AbstractURLAliasProvider;
import com.fr.decision.webservice.url.alias.URLAlias;
import com.fr.decision.webservice.url.alias.URLAliasFactory;
public class SYNOWUrlAliasProvider extends AbstractURLAliasProvider {
@Override
public URLAlias[] registerAlias() {
return new URLAlias[]{
URLAliasFactory.createPluginAlias("/synNow", "/synNow", false),
};
}
}

33
src/main/java/com/fr/plugin/http/handler/GETSynNow1Handler.java

@ -0,0 +1,33 @@
package com.fr.plugin.http.handler;
import com.fr.decision.fun.impl.BaseHttpHandler;
import com.fr.decision.sync.result.SyncResultData;
import com.fr.decision.webservice.v10.user.SyncService;
import com.fr.third.springframework.web.bind.annotation.RequestMethod;
import com.fr.web.utils.WebUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class GETSynNow1Handler extends BaseHttpHandler {
@Override
public RequestMethod getMethod() {
return RequestMethod.GET;
}
@Override
public String getPath() {
return "/synNow";
}
@Override
public boolean isPublic() {
return false;
}
@Override
public void handle(HttpServletRequest req, HttpServletResponse res) throws Exception {
SyncResultData synchronize = SyncService.getInstance().synchronize();
WebUtils.printAsString(res, "success");
}
}

3
src/main/resources/com/fr/plugin/call.js

@ -0,0 +1,3 @@
$.get("/webroot/decision/url/synNow",{},function (e){
alert("调用成功")
})
Loading…
Cancel
Save