commit
e32cd7e883
10 changed files with 124 additions and 0 deletions
@ -0,0 +1,6 @@ |
|||||||
|
# open-JSD-10377 |
||||||
|
|
||||||
|
JSD-10377 CPT模板增加按钮可以点击触发调用同步用户管理的立即同步\ |
||||||
|
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ |
||||||
|
仅作为开发者学习参考使用!禁止用于任何商业用途!\ |
||||||
|
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系【pioneer】处理。 |
Binary file not shown.
Binary file not shown.
@ -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> |
@ -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("插件功能埋点,虽然不会执行,除非上架应用"); |
||||||
|
} |
||||||
|
} |
@ -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) { |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -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; |
||||||
|
} |
||||||
|
} |
@ -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), |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
@ -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"); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue