use of io.vertigo.vega.webservice.data.domain.ContactView in project vertigo by KleeGroup.
the class ContactsWebServices method readContactView.
@GET("/contactView/{conId}")
public ContactView readContactView(@PathParam("conId") final long conId) {
final Contact contact = contactDao.get(conId);
if (contact == null) {
// 404 ?
throw new VUserException("Contact #" + conId + " unknown");
}
// we sheet and use 3 times the same address.
final DtList<Address> addresses = DtList.of(contact.getAddressAccessor().get(), contact.getAddressAccessor().get(), contact.getAddressAccessor().get());
final ContactView contactView = new ContactView();
contactView.setName(contact.getName());
contactView.setFirstName(contact.getFirstName());
contactView.setHonorificCode(contact.getHonorificCode());
contactView.setEmail(contact.getEmail());
contactView.setBirthday(contact.getBirthday());
contactView.setAddresses(addresses);
// 200
return contactView;
}
Aggregations