Create schemas for JSON API endpoints
This commit is contained in:
parent
1ec18163c1
commit
7c73c2c424
11 changed files with 125 additions and 105 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue