A Spring(java) based microservice to save/retrieve chat logs on/from the server.
This server presents an HTTP interface with the following commands.
Creates a new chatlog entry for the user with userID as {user}.
The POST data can either be url encoded or JSON encoded.
The data contains the following fields:
■ message - a String representing the message text
■ timestamp - a Long representing the timestamp
■ isSent - a Boolean/Integer representing if this message was sent by the user or received by the user.
The response from the message is a unique messageID that we can refer to the message by.
Returns chatlogs for the given user.
These are returned in reverse timeorder (most recent messages first).
Takes two optional parameters.
■ limit - an Integer stating how many messages should return. Default to 10.
■ start - a key of the same type as messageID to determine where to start from.
This is to help implement pagination. If not set, it returns the most recent messages.
Deletes all the chat logs for a given user.
Delete just the given chatlog for a given user.
Returns an appropriate HTTP error response if the msgid is not found.
- The project uses PostgreSQL as data store for chat logs.
- The project requires a database server (postgreSQL) running on the host machine.
- Run db script from the project (create_db.sql) to create required db schemas.