Commit fc594b63 authored by 郑磊's avatar 郑磊

通过配置文件获取sdk路径

parent 5d85dab1
......@@ -11,6 +11,7 @@ SQLALCHEMY_CONFIG:
- SQLALCHEMY_TRACK_MODIFICATIONS: true
name: 开启状态
SDK_CONFIG:
- URL: http://livekit.briefmsg.cn
- APPID: APIgSBos6trETHa
- APPSECRET: e88oFyNTkXqK7ZSKuQusrzR90F5rhzI2xLrravVofvY
- IDENTITY: user1
......
......@@ -18,6 +18,7 @@ SQLALCHEMY_CONFIG = apollo.get("SQLALCHEMY_CONFIG")
SQLALCHEMY_DATABASE_URI = [item.get("DATABASE_URI") for item in SQLALCHEMY_CONFIG][0]
SQLALCHEMY_TRACK_MODIFICATIONS = [item.get("SQLALCHEMY_TRACK_MODIFICATIONS") for item in SQLALCHEMY_CONFIG][1]
SDK_CONFIG = apollo.get("SDK_CONFIG")
SDK_CONFIG_URL = [item.get("URL") for item in SDK_CONFIG][0]
SDK_CONFIG_APPID = [item.get("APPID") for item in SDK_CONFIG][0]
SDK_CONFIG_APPSECRET = [item.get("APPSECRET") for item in SDK_CONFIG][1]
SDK_CONFIG_IDENTITY = [item.get("IDENTITY") for item in SDK_CONFIG][2]
......
......@@ -11,7 +11,7 @@ import requests
from livekit import AccessToken, VideoGrant
from sqlalchemy import or_, and_
from configs.config import SDK_CONFIG_APPSECRET, SDK_CONFIG_APPID, client, Bucket, env, SecretKey, Region, UPLOAD_FOLDER
from configs.config import SDK_CONFIG_URL, SDK_CONFIG_APPSECRET, SDK_CONFIG_APPID, client, Bucket, env, SecretKey, Region, UPLOAD_FOLDER
from src.libs.db_link import LinkMysql
from src.libs.log_utils import Logger
from src.modules.friend import FriendComment, FriendGive
......@@ -215,7 +215,7 @@ def GetRoomList(token, names):
"""
获取房间列表信息
"""
url = 'http://live.zhubei.cn/twirp/livekit.RoomService/ListRooms'
url = SDK_CONFIG_URL + '/twirp/livekit.RoomService/ListRooms'
headers = {
"Authorization": token,
"Content-Type": "application/json"
......@@ -232,7 +232,7 @@ def DeleteRoom(token, room):
"""
删除房间
"""
url = 'http://live.zhubei.cn/twirp/livekit.RoomService/DeleteRoom'
url = SDK_CONFIG_URL + '/twirp/livekit.RoomService/DeleteRoom'
# room = room.split()
headers = {
"Authorization": token,
......@@ -250,7 +250,7 @@ def CreateRoom(token, name, max_participants, empty_timeout, user_ids):
"""
新建房间
"""
url = 'http://live.zhubei.cn/twirp/livekit.RoomService/CreateRoom'
url = SDK_CONFIG_URL + '/twirp/livekit.RoomService/CreateRoom'
headers = {
"Authorization": token,
"Content-Type": "application/json"
......@@ -286,7 +286,7 @@ def GetParticipantlist():
"""
获取参与者信息
"""
url = 'http://live.zhubei.cn/twirp/livekit.RoomService/ListParticipants'
url = SDK_CONFIG_URL + '/twirp/livekit.RoomService/ListParticipants'
headers = {
"Authorization": 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2aWRlbyI6eyJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWUsInJvb21SZWNvcmQiOnRydWUsInJvb21BZG1pbiI6dHJ1ZSwicm9vbSI6Ilx1NGUwMFx1NTNmN1x1NmQ0Ylx1OGJkNSJ9LCJpc3MiOiJBUElnU0JvczZ0ckVUSGEiLCJuYmYiOjE2ODEyNzA3NzQsImV4cCI6MTY4MTI5MjM3NCwic3ViIjoiMjMyMzIiLCJuYW1lIjoiMjMyMzIifQ.qv7BS3xp3EhkO9W7bu2rWBLF8-bz67XhOo9Iq88hMV4',
"Content-Type": "application/json"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment