xyz.erupt.upms.model.online.LogOutOperationHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of erupt-upms Show documentation
Show all versions of erupt-upms Show documentation
User Permissions Management
The newest version!
package xyz.erupt.upms.model.online;
import org.springframework.stereotype.Service;
import xyz.erupt.annotation.fun.OperationHandler;
import xyz.erupt.core.prop.EruptProp;
import xyz.erupt.upms.constant.SessionKey;
import xyz.erupt.upms.service.EruptSessionService;
import javax.annotation.Resource;
import java.util.List;
/**
* @author YuePeng
* date 2021/2/16 14:34
*/
@Service
public class LogOutOperationHandler implements OperationHandler {
@Resource
private EruptProp eruptProp;
@Resource
private EruptSessionService eruptSessionService;
@Override
public String exec(List data, Void v, String[] param) {
if (eruptProp.isRedisSession()) {
data.forEach(it -> {
for (String uk : SessionKey.USER_KEY_GROUP) {
eruptSessionService.remove(uk + it.getToken());
}
});
}
return null;
}
}