添加用户状态并且在用户数据第一次导入的时候默认设置用户为需要校验

This commit is contained in:
Yucheng Hu 2017-07-30 00:06:46 -04:00
parent c3fc377bb8
commit 99b784acd7
4 changed files with 22 additions and 4 deletions

View File

@ -4,6 +4,7 @@ package com.usvisatrack.core.dao.model;
import java.util.Date;
import com.usvisatrack.core.common.DataObject;
import com.usvisatrack.core.dao.model.data.UserStatus;
/**
* User ORM
@ -16,6 +17,7 @@ public class User extends DataObject {
private String userName;
private String password;
private String email;
private UserStatus userStatus;
private Date dateRegistered;
public User() {
@ -46,6 +48,14 @@ public class User extends DataObject {
this.email = email;
}
public UserStatus getUserStatus() {
return userStatus;
}
public void setUserStatus(UserStatus userStatus) {
this.userStatus = userStatus;
}
public Date getDateRegistered() {
return dateRegistered;
}

View File

@ -21,6 +21,12 @@
<column name="email" length="255" />
</property>
<property name="UserStatus" column="user_status">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">com.usvisatrack.core.dao.model.data.UserStatus</param>
</type>
</property>
<property name="dateRegistered" type="timestamp">
<column name="date_registered" />
</property>

View File

@ -23,13 +23,13 @@
<property name="visaStatus" column="visa_status">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">com.usvisatrack.core.common.data.VisaStatus</param>
<param name="enumClass">com.usvisatrack.core.dao.model.data.VisaStatus</param>
</type>
</property>
<property name="visaEntry" column="visa_entry">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">com.usvisatrack.core.common.data.VisaEntry</param>
<param name="enumClass">com.usvisatrack.core.dao.model.data.VisaEntry</param>
</type>
</property>

View File

@ -19,8 +19,9 @@ import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.usvisatrack.core.common.data.VisaEntry;
import com.usvisatrack.core.common.data.VisaStatus;
import com.usvisatrack.core.dao.model.data.UserStatus;
import com.usvisatrack.core.dao.model.data.VisaEntry;
import com.usvisatrack.core.dao.model.data.VisaStatus;
import com.usvisatrack.core.dao.model.CheckeeVisa;
import com.usvisatrack.core.dao.model.User;
import com.usvisatrack.core.dao.model.Visa;
@ -291,6 +292,7 @@ public class VisaImporter extends DataCrawl {
user = new User();
user.setUserName(userName);
user.setEmail(userEmail);
user.setUserStatus(UserStatus.NEEDVERIFY);
UserFactory.save(user);
}