diff --git a/src/main/java/org/ntlab/amaryllis/server/models/Voicememos.java b/src/main/java/org/ntlab/amaryllis/server/models/Voicememos.java index 9f44dc8..2cfbd38 100644 --- a/src/main/java/org/ntlab/amaryllis/server/models/Voicememos.java +++ b/src/main/java/org/ntlab/amaryllis/server/models/Voicememos.java @@ -20,21 +20,29 @@ } public static String createVid() { - String vid = UUID.randomUUID().toString();//ここ謎 + String vid = UUID.randomUUID().toString(); return vid; } public Voicememo getVoicememo(String vid){ - + for (Voicememo a:voicememos){ + if(a.getVid().equals(vid)){ + return a; + } + } return null; } + public ArrayList getVoicememos(){ + return voicememos; + } + //↓引数にvidなしで書いてます public Voicememo createVoicememo(String uid, Integer time, String data, double latitude, double longitude, String title,String summary){ String vid = createVid(); - Voicememo new_voicememo = new Voicememo(vid,uid,time,data,latitude,longitude,title,summary); - + Voicememo new_voicememo = new Voicememo(vid, uid, time, data, latitude, longitude, title, summary); + voicememos.add(new_voicememo); return new_voicememo; }