Adden user data completion and docs correction
This commit is contained in:
@ -9,6 +9,7 @@ import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
import com.plannaplan.models.UserApiResponse;
|
||||
import com.plannaplan.types.UserRoles;
|
||||
|
||||
/**
|
||||
@ -40,7 +41,7 @@ public class User {
|
||||
* @param name name given to the user
|
||||
* @param surname surname given to the user
|
||||
* @param mail mail given to the user
|
||||
* @param role
|
||||
* @param role user's role
|
||||
*/
|
||||
public User(String name, String surname, String mail, UserRoles role) {
|
||||
this.name = name;
|
||||
@ -55,7 +56,7 @@ public class User {
|
||||
* @param surname surname given to the user
|
||||
* @param mail mail given to the user
|
||||
* @param usosId id in the USOS system
|
||||
* @param role
|
||||
* @param role user's role
|
||||
*/
|
||||
public User(String name, String surname, String mail, String usosId, UserRoles role) {
|
||||
this(name, surname, mail, role);
|
||||
@ -188,6 +189,16 @@ public class User {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* updates user entity with data got by UsosApiService::getUserData
|
||||
*
|
||||
* @param usosData UserApiResponse model with needed data
|
||||
*/
|
||||
public void updateWithUsosData(UserApiResponse usosData) {
|
||||
this.name = usosData.getName();
|
||||
this.surname = usosData.getSurname();
|
||||
}
|
||||
|
||||
/**
|
||||
* it checks if given ammount of time passed since last token usage. If not
|
||||
* retunr true and reset time otherwise return false and token won work anymore
|
||||
|
Reference in New Issue
Block a user