Create schemas for JSON API endpoints

This commit is contained in:
Pim Kunis 2021-06-26 22:02:18 +02:00
parent 1ec18163c1
commit 7c73c2c424
11 changed files with 125 additions and 105 deletions

View file

@ -33,4 +33,13 @@ defmodule MatrixServer.Device do
|> change(%{access_token: access_token})
|> repo.update()
end
def generate_device_id(%Account{localpart: localpart}) do
time_string =
DateTime.utc_now()
|> DateTime.to_unix()
|> Integer.to_string()
"#{localpart}_#{time_string}"
end
end