Skip to content

Commit

Permalink
Version 3.0
Browse files Browse the repository at this point in the history
- Les listes sont maintenant partagé avec un certains nombres de personnes
- Possibilité d'avoir plusieurs listes.
- Possibilités d'avoir plusieurs bénéficiaires par liste
- Il est maintenant possible d'ajouter plusieurs liens
- Il est aussi possible d'ajouter une photo.
- Participez à un cadeau qui est déjà offert.
- Ajouté des idées sur la liste d'une autre personne qu'elle ne verra pas.
  • Loading branch information
patou authored Dec 5, 2016
2 parents 08ea16f + fafa96c commit 5e463d4
Show file tree
Hide file tree
Showing 30 changed files with 1,619 additions and 405 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package fr.desaintsteban.liste.envies.dto;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

/**
* Created by sfeir on 30/11/2016.
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class AppUserDto {
private String email;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package fr.desaintsteban.liste.envies.dto;

import fr.desaintsteban.liste.envies.model.Link;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.util.List;

/**
* 01/10/2014.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class EnvyDto {
private Long id;

private String owner;
private Boolean suggest = false;
private String label;

private String description;

private String price;
private String picture;
private List<Link> urls;
private List<String> userTake;

private List<NoteDto> notes;

public EnvyDto() {
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getOwner() {
return owner;
}

public void setOwner(String owner) {
this.owner = owner;
}

public Boolean getSuggest() {
return suggest;
}

public void setSuggest(Boolean suggest) {
this.suggest = suggest;
}

public String getLabel() {
return label;
}

public void setLabel(String label) {
this.label = label;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getPicture() {
return picture;
}

public void setPicture(String picture) {
this.picture = picture;
}

public List<Link> getUrls() {
return urls;
}

public void setUrls(List<Link> urls) {
this.urls = urls;
}

public List<String> getUserTake() {
return userTake;
}

public void setUserTake(List<String> userTake) {
this.userTake = userTake;
}

public String getPrice() {
return price;
}

public void setPrice(String price) {
this.price = price;
}

public List<NoteDto> getNotes() {
return notes;
}

public void setNotes(List<NoteDto> notes) {
this.notes = notes;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package fr.desaintsteban.liste.envies.dto;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.util.List;

/**
*
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ListEnviesDto {
private String name;

private String title;
private String description;
private Boolean isOwner;
private List<UserShareDto> users;

private List<UserShareDto> owners;

public List<UserShareDto> getOwners() {
return owners;
}

public void setOwners(List<UserShareDto> owners) {
this.owners = owners;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public List<UserShareDto> getUsers() {
return users;
}

public void setUsers(List<UserShareDto> users) {
this.users = users;
}

public Boolean getOwner() {
return isOwner;
}

public void setOwner(Boolean owner) {
isOwner = owner;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package fr.desaintsteban.liste.envies.dto;

import fr.desaintsteban.liste.envies.model.AppUser;
import fr.desaintsteban.liste.envies.model.UserShareType;

import java.util.Map;

/**
*
*/
public class UserShareDto {
private String email;
private String name;
private UserShareType type;

public UserShareDto() {
}

public UserShareDto(String email, String name, UserShareType type) {
this.email = email;
this.name = name;
this.type = type;
}

public UserShareDto(String email, UserShareType type, Map<String, AppUser> userName) {
this.email = email;
this.type = type;
if (userName != null && userName.containsKey(email)) {
this.name = userName.get(email).getName();
}
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public UserShareType getType() {
return type;
}

public void setType(UserShareType type) {
this.type = type;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Parent;
import fr.desaintsteban.liste.envies.dto.EnvieDto;
import fr.desaintsteban.liste.envies.dto.EnvyDto;
import fr.desaintsteban.liste.envies.dto.NoteDto;
import fr.desaintsteban.liste.envies.util.EncodeUtils;
import org.codehaus.jackson.annotate.JsonIgnore;
Expand All @@ -19,6 +19,7 @@
*/
@Cache
@Entity
@Deprecated
public class Envie {

@Parent
Expand Down Expand Up @@ -49,38 +50,6 @@ public Envie(AppUser owner, String label) {
this.notes = new ArrayList<>();
}


public Envie(EnvieDto envie) {
setId(envie.getId());
setLabel(envie.getLabel());
setComment(envie.getComment());
setPrice(envie.getPrice());
setUrl(envie.getUrl());
setUserTake(EncodeUtils.encode(envie.getUserTake()));

this.notes = new ArrayList<>();

}

public EnvieDto toDto() {
EnvieDto envie = new EnvieDto();
envie.setId(getId());
envie.setLabel(getLabel());
envie.setComment(getComment());
envie.setPrice(getPrice());
envie.setUrl(getUrl());
envie.setUserTake(EncodeUtils.decode(getUserTake()));

if (this.notes != null && !this.notes.isEmpty()) {
List<NoteDto> listNoteDto = new ArrayList<>();
for (Note note : this.notes) {
listNoteDto.add(note.toDto());
}
envie.setNotes(listNoteDto);
}
return envie;
}

public Key<AppUser> getOwner() {
return owner;
}
Expand Down
Loading

0 comments on commit 5e463d4

Please sign in to comment.