123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- /*
- * *************************************************
- * Copyright (c) 2018 QMTH. All Rights Reserved.
- * Created by Deason on 2018-07-31 14:32:47.
- * *************************************************
- */
- package cn.com.qmth.examcloud.app.model;
- import java.io.Serializable;
- import java.util.Calendar;
- import java.util.Date;
- /**
- * 用户登录信息
- *
- * @author: fengdesheng
- * @since: 2018/7/16
- */
- public class LoginInfo implements Serializable {
- private static final long serialVersionUID = 1L;
- private Long userId;
- private String userName;
- private String account;
- private String password;
- private String accountType;
- private Long rootOrgId;
- private String domain;
- private String key;
- private String token;
- private String appToken;
- private String deviceId;
- private Date createTime;
- private String smsCode;
- private Boolean noSession;
- public LoginInfo(String account, String password, String accountType, Long rootOrgId, String domain, String key, String token, String deviceId) {
- this.account = account;
- this.password = password;
- this.accountType = accountType;
- this.rootOrgId = rootOrgId;
- this.domain = domain;
- this.key = key;
- this.token = token;
- this.deviceId = deviceId;
- this.createTime = new Date();
- }
- public LoginInfo(String account, String password, String accountType, Long rootOrgId, String domain, String deviceId, String smsCode) {
- this.account = account;
- this.password = password;
- this.accountType = accountType;
- this.rootOrgId = rootOrgId;
- this.domain = domain;
- this.deviceId = deviceId;
- this.createTime = new Date();
- this.smsCode = smsCode;
- }
- public LoginInfo() {
- this.createTime = new Date();
- }
- public boolean hasExpired(int seconds) {
- if (createTime == null) {
- return true;
- }
- Calendar c = Calendar.getInstance();
- c.setTime(createTime);
- c.add(Calendar.SECOND, seconds - 60);
- //System.out.println(DateUtils.format(c.getTime()));
- //判断是否在n小时内
- if (c.getTime().after(new Date())) {
- return false;
- }
- return true;
- }
- public Long getUserId() {
- return userId;
- }
- public void setUserId(Long userId) {
- this.userId = userId;
- }
- public String getUserName() {
- return userName;
- }
- public void setUserName(String userName) {
- this.userName = userName;
- }
- public String getAccount() {
- return account;
- }
- public void setAccount(String account) {
- this.account = account;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public String getAccountType() {
- return accountType;
- }
- public void setAccountType(String accountType) {
- this.accountType = accountType;
- }
- public Long getRootOrgId() {
- return rootOrgId;
- }
- public void setRootOrgId(Long rootOrgId) {
- this.rootOrgId = rootOrgId;
- }
- public String getDomain() {
- return domain;
- }
- public void setDomain(String domain) {
- this.domain = domain;
- }
- public String getKey() {
- return key;
- }
- public void setKey(String key) {
- this.key = key;
- }
- public String getToken() {
- return token;
- }
- public void setToken(String token) {
- this.token = token;
- }
- public String getAppToken() {
- return appToken;
- }
- public void setAppToken(String appToken) {
- this.appToken = appToken;
- }
- public String getDeviceId() {
- return deviceId;
- }
- public void setDeviceId(String deviceId) {
- this.deviceId = deviceId;
- }
- public Date getCreateTime() {
- return createTime;
- }
- public void setCreateTime(Date createTime) {
- this.createTime = createTime;
- }
- public String getSmsCode() {
- return smsCode;
- }
- public void setSmsCode(String smsCode) {
- this.smsCode = smsCode;
- }
- public Boolean getNoSession() {
- return noSession;
- }
- public void setNoSession(Boolean noSession) {
- this.noSession = noSession;
- }
- }
|