返回结果中增加客户端版本号

main
RogerWork 8 months ago
parent a3ee2ee85e
commit 4250fc3457
  1. 4
      update/utils/client_util.py
  2. 4
      update/views.py

@ -181,6 +181,7 @@ class ClientUtil:
db_conn.commit() db_conn.commit()
db_cursor.close() db_cursor.close()
db_conn.close() db_conn.close()
return client.upload_name
def client_process(self, cinema_ip, short_release): def client_process(self, cinema_ip, short_release):
self.smb_connect() self.smb_connect()
@ -188,8 +189,9 @@ class ClientUtil:
self.handle_client_db() self.handle_client_db()
self.clear_delete_file() self.clear_delete_file()
self.get_client(cinema_ip, short_version) self.get_client(cinema_ip, short_version)
self.upload_client(cinema_ip, short_version) client_file_name = self.upload_client(cinema_ip, short_version)
self.smb_disconnect() self.smb_disconnect()
return client_file_name
# #
# class ClientUtil: # class ClientUtil:

@ -294,9 +294,9 @@ def update_cine(request):
redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60)
client_release = ClientUtil() client_release = ClientUtil()
print('client_release.client_process') print('client_release.client_process')
client_release.client_process(cinema_ip, short_release) client_name = client_release.client_process(cinema_ip, short_release)
update_status['client']['result'] = 'success' update_status['client']['result'] = 'success'
update_status['client']['msg'] = '客户端上传成功' update_status['client']['msg'] = f'客户端上传成功: {client_name}'
redis_conn.set(redis_key, json.dumps(update_status), 5 * 60) redis_conn.set(redis_key, json.dumps(update_status), 5 * 60)
except Exception as e: except Exception as e:
print('client', e) print('client', e)

Loading…
Cancel
Save