commit 8737b82954294c594b46e27f988f7cec78b39f3d Author: Elijah Date: Wed Feb 20 15:43:25 2019 +0800 DEC-6365 登录登出事件demo diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..ae2c3e6 --- /dev/null +++ b/build.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..087a49d --- /dev/null +++ b/plugin.xml @@ -0,0 +1,18 @@ + + + com.fr.plugin.demo.loginout.event + + yes + yes + 1.0 + 10.0~ + 2019-2-19 + Elijah + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..cdc444e --- /dev/null +++ b/pom.xml @@ -0,0 +1,96 @@ + + + + starter + com.fr.plugin + 10.0 + + 4.0.0 + + demo-loginout-event + + 10.0-FEATURE-SNAPSHOT + + + + + com.fr.third + fine-third + ${common-version} + + + com.fr.activator + fine-activator + ${common-version} + compile + + + com.fr.core + fine-core + ${common-version} + compile + + + com.fr.webui + fine-webui + ${common-version} + compile + + + + com.fr.datasource + fine-datasource + ${common-version} + compile + + + + com.fr.decision + fine-decision + ${common-version} + compile + + + com.fr.decision + fine-decision-report + ${common-version} + compile + + + + com.fr.schedule + fine-schedule + ${common-version} + compile + + + com.fr.schedule + fine-schedule-report + ${common-version} + compile + + + + + com.fr.intelligence + fine-swift + ${common-version} + compile + + + com.fr.intelligence + fine-accumulator + ${common-version} + compile + + + + com.fr.report + fine-report-engine + ${common-version} + compile + + + \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/demo/loginout/event/CustomLogInOutEventProvider.java b/src/main/java/com/fr/plugin/demo/loginout/event/CustomLogInOutEventProvider.java new file mode 100644 index 0000000..b6c28e2 --- /dev/null +++ b/src/main/java/com/fr/plugin/demo/loginout/event/CustomLogInOutEventProvider.java @@ -0,0 +1,28 @@ +package com.fr.plugin.demo.loginout.event; + +import com.fr.decision.fun.impl.AbstractLogInOutEventProvider; +import com.fr.decision.webservice.login.LogInOutResultInfo; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.web.utils.WebUtils; + +/** + * @Author: Elijah + * @Create: 2019-02-20 + * @Desciption: + */ +@FunctionRecorder +public class CustomLogInOutEventProvider extends AbstractLogInOutEventProvider { + + @Override + public void loginAction(LogInOutResultInfo result) { + FineLoggerFactory.getLogger().info(result.getUsername() + " login, ip: " + WebUtils.getIpAddr(result.getRequest())); + super.loginAction(result); + } + + @Override + public String logoutAction(LogInOutResultInfo result) { + FineLoggerFactory.getLogger().info(result.getUsername() + " logout, ip: " + WebUtils.getIpAddr(result.getRequest())); + return "http://www.baidu.com"; + } +} \ No newline at end of file