Skip to content
Snippets Groups Projects
Commit 667feda5 authored by Kfilippopolitis's avatar Kfilippopolitis
Browse files

Now a userDto is being displayed instead of username

parent e405f005
No related branches found
No related tags found
1 merge request!28An experiment wont any longer display the username but the whole info about the user
......@@ -18,7 +18,7 @@ public class ExperimentDTO {
private UUID uuid;
private String name;
private String createdBy;
private UserDTO createdBy;
private Date created;
private Date updated;
private Date finished;
......@@ -41,7 +41,7 @@ public class ExperimentDTO {
this.created = experimentDAO.getCreated();
this.updated = experimentDAO.getUpdated();
this.finished = experimentDAO.getFinished();
this.createdBy = experimentDAO.getCreatedBy().getUsername();
this.createdBy = new UserDTO(experimentDAO.getCreatedBy());
this.name = experimentDAO.getName();
if(includeResult){
this.result = JsonConverters.convertJsonStringToObject(String.valueOf(experimentDAO.getResult()), new ArrayList<>().getClass());
......
package eu.hbp.mip.models.DTOs;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.gson.annotations.SerializedName;
import eu.hbp.mip.models.DAOs.ExperimentDAO;
import eu.hbp.mip.models.DAOs.UserDAO;
import eu.hbp.mip.utils.JsonConverters;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserDTO {
@SerializedName("username")
private String username;
@SerializedName("fullname")
private String fullname;
public UserDTO(){
}
public UserDTO(UserDAO userdao) {
this.username = userdao.getUsername();
this.fullname = userdao.getFullname();
}
}
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