2023-11-27 16:33:24 +01:00
|
|
|
package eu.eudat.model.mapper.publicapi;
|
|
|
|
|
2023-11-28 11:54:08 +01:00
|
|
|
import eu.eudat.model.Dmp;
|
|
|
|
import eu.eudat.model.publicapi.overviewmodels.DataManagementPlanPublicModel;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.sql.Date;
|
|
|
|
|
|
|
|
@Component
|
2023-11-27 16:33:24 +01:00
|
|
|
public class DmpToPublicApiDmpMapper {
|
|
|
|
|
2023-11-28 11:54:08 +01:00
|
|
|
public DataManagementPlanPublicModel toPublicModel(Dmp dmp) {
|
|
|
|
DataManagementPlanPublicModel model = new DataManagementPlanPublicModel();
|
|
|
|
model.setId(dmp.getId().toString());
|
|
|
|
model.setLabel(dmp.getLabel());
|
|
|
|
model.setDescription(dmp.getDescription());
|
|
|
|
model.setVersion(dmp.getVersion());
|
|
|
|
model.setGroupId(dmp.getGroupId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.setCreatedAt(Date.from(dmp.getCreatedAt()));
|
|
|
|
model.setModifiedAt(Date.from(dmp.getUpdatedAt()));
|
|
|
|
model.setFinalizedAt(Date.from(dmp.getFinalizedAt()));
|
2023-11-27 16:33:24 +01:00
|
|
|
|
2023-11-28 11:54:08 +01:00
|
|
|
return model;
|
|
|
|
}
|
2023-11-27 16:33:24 +01:00
|
|
|
|
|
|
|
}
|