测试linux执行

This commit is contained in:
毛鹏
2025-04-16 18:25:11 +08:00
parent 4cde157440
commit ddca06d34d
5 changed files with 20 additions and 8 deletions

View File

@@ -138,7 +138,7 @@ class ChatConsumer(WebsocketConsumer):
is_notice=is_notice,
data=None
)
if func_name:
if func_name is not None:
send_data.data = QueueModel(func_name=func_name, func_args=func_args)
if send_data.is_notice:
self.active_send(send_data)
@@ -164,10 +164,7 @@ class ChatConsumer(WebsocketConsumer):
self.inside_send(f"账号或密码错误,不允许连接!")
return False, 0
try:
if self.username != SocketEnum.OPEN.value:
user = User.objects.get(username=self.username, password=user.get('password'))
return True, user.id
else:
return True, 0
user = User.objects.get(username=self.username, password=user.get('password'))
return True, user.id
except User.DoesNotExist:
return False, 0

View File

@@ -32,3 +32,8 @@ class SystemConsumer:
CacheDataCRUD.inside_post(data)
else:
CacheDataCRUD.inside_put(cache_data.id, data)
@classmethod
def t_set_actuator_open_state(cls, data: list[dict]):
from src.auto_test.auto_system.service.socket_link.socket_user import SocketUser
SocketUser.set_user_open_status(data['username'], data['is_open'])

View File

@@ -16,6 +16,7 @@ class SocketUserModel(BaseModel):
username: str
web_obj: Any | None = None
client_obj: Any | None = None
is_open: bool = False
class SocketUser:
@@ -91,3 +92,11 @@ class SocketUser:
@classmethod
def get_all_user_list(cls):
return cls.user
@classmethod
def set_user_open_status(cls, username, is_open: bool):
for i in cls.user:
if i.username == username:
i.is_open = is_open
return
raise SystemEError(*ERROR_MSG_0027, )

View File

@@ -29,7 +29,7 @@ ERROR_MSG_0023 = (323, '只有json格式的返回数据才可以使用jsonpath
ERROR_MSG_0024 = (324, '')
ERROR_MSG_0025 = (325, '')
ERROR_MSG_0026 = (326, 'web端不提供该方法您已经成功了请直接开始使用该方法进行测试文件名称{}')
ERROR_MSG_0027 = (327, '')
ERROR_MSG_0027 = (327, '您要设置的用户open状态失败可能用户没有登录执行器请先登录之后再进行设置状态')
ERROR_MSG_0028 = (328, '发送任务失败,请确保{}已连接{}')
ERROR_MSG_0029 = (329, '设备配置没有配置或者状态未开启,请先到前端自动化-设备配置中添加配置~')
ERROR_MSG_0030 = (330, '查询数据库结果为空错误,请联系管理查看错误问题')

View File

@@ -66,7 +66,7 @@ services:
- "8001:80"
networks:
- app_network
-
mango_actuator:
build:
context: ./MangoActuator
@@ -81,6 +81,7 @@ services:
condition: service_started
networks:
- app_network
networks:
app_network:
driver: bridge