同步喇叭通道接口修改
This commit is contained in:
parent
52dd5d5763
commit
c38761a17f
|
@ -51,7 +51,8 @@ class SpTestView(APIView):
|
||||||
# return Response()
|
# return Response()
|
||||||
# params = {"page": 1, "pageSize": 10000}
|
# params = {"page": 1, "pageSize": 10000}
|
||||||
# _, res = spClient.request(**spapis['device_list'], params=params)
|
# _, res = spClient.request(**spapis['device_list'], params=params)
|
||||||
_, res = spClient.speak(path='http://192.168.10.249/media/2022/09/01/test.mp3', sns=['ls20://020277AA7D06'], v_num=5)
|
_, res = spClient.speak(path='http://192.168.10.249:20309/media/2022/09/01/test.mp3',
|
||||||
|
sns=['ls20://020277AA7D06'], v_num=5)
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,9 +64,9 @@ class XxTestView(APIView):
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
json = {
|
json = {
|
||||||
"railId": "bc0ed1151524490589a9a519685f188f",
|
"railId": "bc0ed1151524490589a9a519685f188f",
|
||||||
"type": ""
|
"type": ""
|
||||||
}
|
}
|
||||||
_, res = xxClient.request(**xxapis['rail_ibeacon_list'], json=json)
|
_, res = xxClient.request(**xxapis['rail_ibeacon_list'], json=json)
|
||||||
return Response(res)
|
return Response(res)
|
||||||
# ok, res = xxClient.request(
|
# ok, res = xxClient.request(
|
||||||
|
|
|
@ -183,7 +183,9 @@ class TDeviceViewSet(ListModelMixin, UpdateModelMixin, DestroyModelMixin, Custom
|
||||||
}
|
}
|
||||||
_, res = spClient.request(**spapis['device_list'], params=params)
|
_, res = spClient.request(**spapis['device_list'], params=params)
|
||||||
rows = res['rows']
|
rows = res['rows']
|
||||||
|
t_l = []
|
||||||
for i in rows:
|
for i in rows:
|
||||||
|
t_l.append(i['sn'])
|
||||||
td = TDevice.objects.filter(code=i['sn']).first()
|
td = TDevice.objects.filter(code=i['sn']).first()
|
||||||
if td:
|
if td:
|
||||||
pass
|
pass
|
||||||
|
@ -191,6 +193,7 @@ class TDeviceViewSet(ListModelMixin, UpdateModelMixin, DestroyModelMixin, Custom
|
||||||
td = TDevice(code=i['sn'], type=TDevice.DEVICE_SPEAKER)
|
td = TDevice(code=i['sn'], type=TDevice.DEVICE_SPEAKER)
|
||||||
td.name = i['name']
|
td.name = i['name']
|
||||||
td.save()
|
td.save()
|
||||||
|
TDevice.objects.filter(type=TDevice.DEVICE_SPEAKER).exclude(code__in=t_l).delete() # 移除不需要的
|
||||||
return Response()
|
return Response()
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, perms_map={'post': '*'},
|
@action(methods=['post'], detail=False, perms_map={'post': '*'},
|
||||||
|
|
Loading…
Reference in New Issue