adds phoenix boilerplate and database api

- message communication added
- database migration added
- initial commit
This commit is contained in:
2021-12-05 00:36:13 +01:00
commit 4e607a7e45
50 changed files with 1817 additions and 0 deletions

27
lib/bump/messages.ex Normal file
View File

@ -0,0 +1,27 @@
defmodule Bump.Messages do
alias Bump.Repo
import Ecto.Query
def get_newest_message(_sender) do
end
def get_all_messages_since(sender, minutes) do
ago = DateTime.utc_now
|> Timex.shift(minutes: -minutes)
|> DateTime.truncate(:second)
query = from m in "messages",
where: m.sender == ^sender and
m.timestamp >= ^ago,
select: m.data
Repo.all(query)
end
def remove_sender(_sender) do
end
def add_message(_sender, _message) do
end
end