zhouping
5 years ago
2 changed files with 14 additions and 7 deletions
@ -1,20 +1,27 @@
|
||||
package com.fr.plugin.decision.login.event; |
||||
|
||||
import com.fr.decision.fun.impl.AbstractLoginEventProvider; |
||||
import com.fr.decision.webservice.login.LoginResultInfo; |
||||
import com.fr.plugin.transform.FunctionRecorder; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
/** |
||||
* Created by zhouping on 2018/12/14. |
||||
*/ |
||||
@FunctionRecorder |
||||
public class CustomLoginActionEvent extends AbstractLoginEventProvider { |
||||
|
||||
@Override |
||||
public void after(String userId) { |
||||
try { |
||||
Thread.sleep(10*1000); |
||||
} catch (InterruptedException e) { |
||||
e.printStackTrace(); |
||||
public void action(LoginResultInfo result) { |
||||
boolean loginResult = result.isResult(); |
||||
HttpServletRequest request = result.getRequest(); |
||||
HttpServletResponse response = result.getResponse(); |
||||
if (loginResult) { |
||||
System.out.println(result.getUsername() + " login success, this is CustomLoginActionEvent."); |
||||
} else { |
||||
System.out.println("login failed, this is CustomLoginActionEvent."); |
||||
} |
||||
System.out.println(userId + " login success, this is CustomLoginActionEvent."); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue