diff --git a/src/main/java/org/ntlab/amaryllis/server/entities/Voicememo.java b/src/main/java/org/ntlab/amaryllis/server/entities/Voicememo.java index 137d4e6..d072773 100644 --- a/src/main/java/org/ntlab/amaryllis/server/entities/Voicememo.java +++ b/src/main/java/org/ntlab/amaryllis/server/entities/Voicememo.java @@ -37,17 +37,10 @@ setSummary(summary); this.times = 0; this.favos = 0; -// categories = new ArrayList<>(); -// comments = new ArrayList<>(); + categories = new ArrayList<>(); + comments = new ArrayList<>(); } - -// public void editVoicememo(String title, String summary) { -// setTitle(title); -// setSummary(summary); -// } - - public String getVid() { return vid; } @@ -159,47 +152,47 @@ favos = favolist.size(); } -// -// public ArrayList getCategory(){ return categories; } -// -// public void addCategory(String categoryId){ -// for (String a : categories) { -// if (a.equals(categoryId)) { -// return; -// } -// } -// categories.add(categoryId); -// } -// -// public void removeCategory(String CategoryId) { -// categories.remove(CategoryId); -// } -// -// -// public ArrayList getComments(){ return comments; } -// -// public Comment getComment(String commentId) { -// for (Comment a : comments) { -// if (a.getCid().equals(commentId)) { -// return a; -// } -// } -// return null; -// } -// -// public Comment createComment(String uid, String text) { -// if (uid == null || text == null) { -// return null; -// } -// Comment newComment = new Comment(uid, text); -// comments.add(newComment); -// return newComment; -// } -// -// public void removeComment(String commentId) { -// Comment removeComment = getComment(commentId); -// comments.remove(removeComment); -// } + + public ArrayList getCategory(){ return categories; } + + public void addCategory(String categoryId){ + for (String a : categories) { + if (a.equals(categoryId)) { + return; + } + } + categories.add(categoryId); + } + + public void removeCategory(String CategoryId) { + categories.remove(CategoryId); + } + + + public ArrayList getComments(){ return comments; } + + public Comment getComment(String commentId) { + for (Comment a : comments) { + if (a.getCid().equals(commentId)) { + return a; + } + } + return null; + } + + public Comment createComment(String uid, String text) { + if (uid == null || text == null) { + return null; + } + Comment newComment = new Comment(uid, text); + comments.add(newComment); + return newComment; + } + + public void removeComment(String commentId) { + Comment removeComment = getComment(commentId); + comments.remove(removeComment); + } }