Skip to content

Commit

Permalink
Merge pull request #20 from Callhub-Connect/email-transcript
Browse files Browse the repository at this point in the history
added some helper methods
  • Loading branch information
sarinali authored Nov 24, 2023
2 parents b149faa + e3d8ade commit b3662a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/callhub/connect/entities/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;

@Document("message")
public class Message {
Expand Down Expand Up @@ -36,4 +39,13 @@ public String getContent() {
public void setContent(String content) {
this.content = content;
}

private String getTimeStampString() {
DateFormat df = new SimpleDateFormat("HH:mm:ss a");
return df.format(this.timeStamp);
}

public String formattedMessage() {
return String.format("%s %s", this.getTimeStampString(), this.content);
}
}
4 changes: 4 additions & 0 deletions src/main/java/callhub/connect/entities/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ public String getCode() {
return code;
}

public ArrayList<Message> getMessages() {
return this.messages;
}

}

0 comments on commit b3662a4

Please sign in to comment.