public Response create(Organization o) { Response op = new Response(); if (organizationDAO.hasOrganization(o.key) == false) { o.apiKey = getUUID(); organizationDAO.create(new PersistedOrganization(o)); op.setPayload(true); } else { op.addError(new Error(10)); } return op; }
public Response getAll() { List<PersistedOrganization> all = organizationDAO.getAll(); List<Organization> allBase = new ArrayList<Organization>(); for (PersistedOrganization organization : all) { allBase.add(organization.toBase()); } return new Response(allBase); }
public void delete(Organization o) { organizationDAO.delete(new PersistedOrganization(o)); }