Commit 7bd8b869 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov

Added filtering users by lastLogin

parent 9d14aecb
...@@ -20,6 +20,7 @@ import java.util.Date; ...@@ -20,6 +20,7 @@ import java.util.Date;
import java.util.Set; import java.util.Set;
import org.genesys.blocks.model.filters.AuditedVersionedModelFilter; import org.genesys.blocks.model.filters.AuditedVersionedModelFilter;
import org.genesys.blocks.model.filters.DateFilter;
import org.genesys.blocks.model.filters.StringFilter; import org.genesys.blocks.model.filters.StringFilter;
import org.genesys2.server.model.UserRole; import org.genesys2.server.model.UserRole;
import org.genesys2.server.model.impl.QUser; import org.genesys2.server.model.impl.QUser;
...@@ -44,6 +45,8 @@ public class UserFilter extends AuditedVersionedModelFilter<UserFilter, User> { ...@@ -44,6 +45,8 @@ public class UserFilter extends AuditedVersionedModelFilter<UserFilter, User> {
/** The role. */ /** The role. */
public Set<UserRole> role; public Set<UserRole> role;
public DateFilter lastLogin;
/** The locked. */ /** The locked. */
public Boolean locked; public Boolean locked;
...@@ -99,6 +102,10 @@ public class UserFilter extends AuditedVersionedModelFilter<UserFilter, User> { ...@@ -99,6 +102,10 @@ public class UserFilter extends AuditedVersionedModelFilter<UserFilter, User> {
} }
} }
if (lastLogin != null) {
and.and(lastLogin.buildQuery(user.lastLogin));
}
return and; return and;
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment