feat: add /api/v1/sms-messages GET endpoint
This commit is contained in:
+11
-1
@@ -12,7 +12,11 @@ cur = con.cursor()
|
||||
|
||||
# ID columns are not necessary - SQLite by default sets ROWID as INTEGER PRIMARY KEY which auto increments
|
||||
cur.execute("CREATE TABLE devices(access_key, secret_key_hash, type, name)")
|
||||
cur.execute("CREATE TABLE messages(content, ts_received, ts_sent, sender, recipient)")
|
||||
|
||||
# type : INCOMING, OUTGOING
|
||||
# local_phone_number : a SECONDARY device SIM's phone number
|
||||
# remote_phone_number : a phone number or shortcode of the other party
|
||||
cur.execute("CREATE TABLE messages(content, ts_received, ts_sent, type, local_phone_number, remote_phone_number)")
|
||||
cur.execute("CREATE TABLE sim_events(sim_id, ts, note, cost, currency)")
|
||||
cur.execute("CREATE TABLE sim_cards(phone_number, device_access_key)")
|
||||
|
||||
@@ -31,6 +35,12 @@ cur.execute("""
|
||||
('+422999888777', 'test_access_key2')
|
||||
""")
|
||||
|
||||
cur.execute("""
|
||||
INSERT INTO messages VALUES
|
||||
('how are you?', 1000, 999, 'INCOMING', '+420123456789', '+10005558888'),
|
||||
('i am fine', 2000, 1999, 'OUTGOING', '+420123456789', '+10005558888')
|
||||
""")
|
||||
|
||||
con.commit()
|
||||
con.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user