上传文件至 core
This commit is contained in:
@@ -90,3 +90,14 @@ def DeleteChatRoom(Authorization: str, id: str) -> dict:
|
||||
headers = {'accept': 'application/json', 'Authorization': Authorization}
|
||||
return _make_request('DELETE', url, headers)
|
||||
|
||||
def CreateChatWithRealm(Authorization: str) -> dict:
|
||||
"""创建聊天房间"""
|
||||
url = f"{DOMAIN}/chat"
|
||||
headers = {'accept': 'application/json', 'Authorization': Authorization}
|
||||
return _make_request('POST', url, headers)
|
||||
|
||||
def GetChatToAccount(Authorization: str,accountid: str) -> dict:
|
||||
"""获取聊天对象用户信息"""
|
||||
url = f"{DOMAIN}/chat/direct/{accountid}"
|
||||
headers = {'accept': 'application/json', 'Authorization': Authorization}
|
||||
return _make_request('GET', url, headers)
|
||||
|
9
core/DBServices.py
Normal file
9
core/DBServices.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import sqlite3
|
||||
|
||||
def DBStart():
|
||||
conn = sqlite3.connect('./dbfile/App.db')
|
||||
c = conn.cursor()
|
||||
c.execute('''CREATE TABLE IF NOT EXISTS chat
|
||||
(id TEXT PRIMARY KEY, accountid TEXT, name TEXT, avatar TEXT, lastmessage TEXT, lastmessagetime TEXT)''')
|
||||
conn.commit()
|
||||
conn.close()
|
Reference in New Issue
Block a user