parent
d4f76925ba
commit
9ca73dac30
10 changed files with 108 additions and 18 deletions
@ -0,0 +1,21 @@ |
|||||||
|
from channels.generic.websocket import WebsocketConsumer |
||||||
|
import json |
||||||
|
|
||||||
|
|
||||||
|
class UpdateConsumer(WebsocketConsumer): |
||||||
|
def connect(self): |
||||||
|
self.accept() |
||||||
|
self.send('你已经连接成功') |
||||||
|
|
||||||
|
def receive(self, text_data=None, bytes_data=None): |
||||||
|
if text_data is None: |
||||||
|
self.send('你发了啥') |
||||||
|
if text_data == 'update': |
||||||
|
self.send(json.dumps({'code': '111'})) |
||||||
|
if text_data == 'close': |
||||||
|
self.send('白白') |
||||||
|
self.close() |
||||||
|
self.disconnect('500') |
||||||
|
else: |
||||||
|
self.send(f'你收到的消息是{text_data}') |
||||||
|
|
@ -0,0 +1,23 @@ |
|||||||
|
# Generated by Django 4.2.7 on 2024-01-31 07:15 |
||||||
|
|
||||||
|
from django.db import migrations, models |
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration): |
||||||
|
|
||||||
|
dependencies = [ |
||||||
|
('update', '0019_alter_clientrelease_sub_ver'), |
||||||
|
] |
||||||
|
|
||||||
|
operations = [ |
||||||
|
migrations.AddField( |
||||||
|
model_name='cinema', |
||||||
|
name='is_cloud', |
||||||
|
field=models.CharField(default='', help_text='是否是云版本', max_length=10, null=True, verbose_name='是否是云版本'), |
||||||
|
), |
||||||
|
migrations.AddField( |
||||||
|
model_name='cinema', |
||||||
|
name='remote_label', |
||||||
|
field=models.CharField(default='', help_text='远程办公id', max_length=20, null=True, verbose_name='远程办公id'), |
||||||
|
), |
||||||
|
] |
Loading…
Reference in new issue