Casper 5 months ago
parent
commit
4bab9f3a1f
76 changed files with 577 additions and 299 deletions
  1. 0 0
      sri-pysdk/xapi/audio/api.py
  2. 0 0
      sri-pysdk/xapi/enfei/api.py
  3. 0 0
      sri-pysdk/xapi/google/api.py
  4. 0 0
      sri-pysdk/xapi/hik/api.py
  5. 0 0
      sri-pysdk/xapi/hik/read100.py
  6. 0 0
      sri-pysdk/xapi/mccbts/1.txt
  7. 0 0
      sri-pysdk/xapi/mccbts/api.py
  8. 0 0
      sri-pysdk/xapi/nessus/api.py
  9. 0 0
      sri-pysdk/xapi/onvif/api.py
  10. 0 0
      sri-pysdk/xapi/ros1/api_for_hs.py
  11. 0 0
      sri-pysdk/xapi/ros1/cmd1001.txt
  12. 0 0
      sri-pysdk/xapi/ros1/cmd100101.txt
  13. 0 0
      sri-pysdk/xapi/ros1/s1-行驶-去e点
  14. 0 0
      sri-pysdk/xapi/ros1/s2-作业-叉包
  15. 0 0
      sri-pysdk/xapi/ros1/s3-作业-回e点
  16. 0 0
      sri-pysdk/xapi/ros1/s4-行驶-e点-到-倒渣口2
  17. 0 0
      sri-pysdk/xapi/ros1/s5-行驶-e点-到-倒渣口2
  18. 0 0
      sri-pysdk/xapi/ros1/s6-行驶-倒渣口2-到-n20的e点
  19. 0 0
      sri-pysdk/xapi/ros1/s7-作业-放包
  20. 0 0
      sri-pysdk/xapi/taiwuict/u1_for_aibox.py
  21. 0 0
      sri-pysdk/xapi/taiwuict/u2_for_aibox.py
  22. 0 0
      sri-pysdk/xapi/taiwuict/u3_for_cscec.py
  23. 0 0
      sri-pysdk/xclient/xinflux.py
  24. 0 0
      sri-pysdk/xclient/xmaria.py
  25. 0 0
      sri-pysdk/xclient/xmongo.py
  26. 0 0
      sri-pysdk/xclient/xmqtt-1.py
  27. 25 17
      sri-pysdk/xclient/xmqtt.py
  28. 0 0
      sri-pysdk/xclient/xmysql.py
  29. 0 0
      sri-pysdk/xclient/xqcloudsms.py
  30. 0 0
      sri-pysdk/xclient/xredis.py
  31. 0 0
      sri-pysdk/xclient/xsmtp.py
  32. 0 0
      sri-pysdk/xclient/xsmtp_zl.py
  33. 0 0
      sri-pysdk/xclient/xssh.py
  34. 0 0
      sri-pysdk/xclient/xtcp.py
  35. 0 0
      sri-pysdk/xclient/xudp.py
  36. 0 0
      sri-pysdk/xdecorator.py
  37. 0 0
      sri-pysdk/xengine/cv_face_recognition/engine.py
  38. 0 0
      sri-pysdk/xlib/__init__.py
  39. 0 0
      sri-pysdk/xlib/xbase64.py
  40. 0 0
      sri-pysdk/xlib/xfile.py
  41. 0 0
      sri-pysdk/xlib/xipv4.py
  42. 0 0
      sri-pysdk/xlib/xlist.py
  43. 0 0
      sri-pysdk/xlib/xlog.py
  44. 0 0
      sri-pysdk/xlib/xmarkdwon.py
  45. 0 0
      sri-pysdk/xlib/xpickle.py
  46. 0 0
      sri-pysdk/xlib/xsubprocess.py
  47. 0 0
      sri-pysdk/xlib/xthread.py
  48. 0 0
      sri-pysdk/xlib/xtime.py
  49. 0 0
      sri-pysdk/xlib/xuuid.py
  50. 0 0
      sri-pysdk/xpip/aes_by_crypto.py
  51. 0 0
      sri-pysdk/xpip/camera_by_cv2.py
  52. 0 0
      sri-pysdk/xpip/data_by_numpy.py
  53. 0 0
      sri-pysdk/xpip/show_by_prettytable.py
  54. 0 0
      sri-pysdk/xpip/xapscheduler.py
  55. 0 0
      sri-pysdk/xpip/zip_by_pyminizip.py
  56. 0 0
      sri-pysdk/xplugin/hydra/plugin.py
  57. 0 0
      sri-pysdk/xplugin/msscan/plugin.py
  58. 0 0
      sri-pysdk/xserver/xtcp.py
  59. 0 0
      sri-pysdk/xserver/xudp.py
  60. 3 17
      sri-server-bg01/Dockerfile
  61. 12 14
      sri-server-bg01/README-usage.bash
  62. 6 0
      sri-server-bg01/README.md
  63. 13 12
      sri-server-bg01/compose.yml
  64. 1 1
      sri-server-bg01/hub.py
  65. 293 0
      sri-server-bg01/test/SRI湛江后台接口说明.md
  66. 59 59
      sri-server-bg01/test/test-1000.py
  67. 73 73
      sri-server-bg01/test/test-2000.py
  68. 33 33
      sri-server-bg01/test/test-3000.py
  69. 0 49
      sri-server-bg01/test/接口说明.md
  70. 2 1
      sri-server-bg02/Dockerfile
  71. 27 2
      sri-server-bg02/README-usage.bash
  72. 6 0
      sri-server-bg02/README.md
  73. 17 16
      sri-server-bg02/compose.yml
  74. 2 3
      sri-server-bg02/hub.py
  75. 1 0
      sri-server-bg02/test/SRI202409-湛江项目mqtt接口说明.md
  76. 4 2
      sri-server-bg02/test/test-mqtt-sender.py

+ 0 - 0
3rdparty/xapi/audio/api.py → sri-pysdk/xapi/audio/api.py


+ 0 - 0
3rdparty/xapi/enfei/api.py → sri-pysdk/xapi/enfei/api.py


+ 0 - 0
3rdparty/xapi/google/api.py → sri-pysdk/xapi/google/api.py


+ 0 - 0
3rdparty/xapi/hik/api.py → sri-pysdk/xapi/hik/api.py


+ 0 - 0
3rdparty/xapi/hik/read100.py → sri-pysdk/xapi/hik/read100.py


+ 0 - 0
3rdparty/xapi/mccbts/1.txt → sri-pysdk/xapi/mccbts/1.txt


+ 0 - 0
3rdparty/xapi/mccbts/api.py → sri-pysdk/xapi/mccbts/api.py


+ 0 - 0
3rdparty/xapi/nessus/api.py → sri-pysdk/xapi/nessus/api.py


+ 0 - 0
3rdparty/xapi/onvif/api.py → sri-pysdk/xapi/onvif/api.py


+ 0 - 0
3rdparty/xapi/ros1/api_for_hs.py → sri-pysdk/xapi/ros1/api_for_hs.py


+ 0 - 0
3rdparty/xapi/ros1/cmd1001.txt → sri-pysdk/xapi/ros1/cmd1001.txt


+ 0 - 0
3rdparty/xapi/ros1/cmd100101.txt → sri-pysdk/xapi/ros1/cmd100101.txt


+ 0 - 0
3rdparty/xapi/ros1/s1-行驶-去e点 → sri-pysdk/xapi/ros1/s1-行驶-去e点


+ 0 - 0
3rdparty/xapi/ros1/s2-作业-叉包 → sri-pysdk/xapi/ros1/s2-作业-叉包


+ 0 - 0
3rdparty/xapi/ros1/s3-作业-回e点 → sri-pysdk/xapi/ros1/s3-作业-回e点


+ 0 - 0
3rdparty/xapi/ros1/s4-行驶-e点-到-倒渣口2 → sri-pysdk/xapi/ros1/s4-行驶-e点-到-倒渣口2


+ 0 - 0
3rdparty/xapi/ros1/s5-行驶-e点-到-倒渣口2 → sri-pysdk/xapi/ros1/s5-行驶-e点-到-倒渣口2


+ 0 - 0
3rdparty/xapi/ros1/s6-行驶-倒渣口2-到-n20的e点 → sri-pysdk/xapi/ros1/s6-行驶-倒渣口2-到-n20的e点


+ 0 - 0
3rdparty/xapi/ros1/s7-作业-放包 → sri-pysdk/xapi/ros1/s7-作业-放包


+ 0 - 0
3rdparty/xapi/taiwuict/u1_for_aibox.py → sri-pysdk/xapi/taiwuict/u1_for_aibox.py


+ 0 - 0
3rdparty/xapi/taiwuict/u2_for_aibox.py → sri-pysdk/xapi/taiwuict/u2_for_aibox.py


+ 0 - 0
3rdparty/xapi/taiwuict/u3_for_cscec.py → sri-pysdk/xapi/taiwuict/u3_for_cscec.py


+ 0 - 0
3rdparty/xclient/xinflux.py → sri-pysdk/xclient/xinflux.py


+ 0 - 0
3rdparty/xclient/xmaria.py → sri-pysdk/xclient/xmaria.py


+ 0 - 0
3rdparty/xclient/xmongo.py → sri-pysdk/xclient/xmongo.py


+ 0 - 0
3rdparty/xclient/xmqtt-1.py → sri-pysdk/xclient/xmqtt-1.py


+ 25 - 17
3rdparty/xclient/xmqtt.py → sri-pysdk/xclient/xmqtt.py

@@ -1,17 +1,3 @@
-"""
-cd /home/server/repositories/repositories/gitee.com/casperz.py-project/module-py/xclient
-
-pip3 install paho-mqtt==1.6.1
-
-python3 xmqtt-a1.py
-python3 xmqtt-a2.py
-python3 xmqtt.py
-
-
-pip3 install paho-mqtt==1.6.1 -i hhttps://mirror.baidu.com/pypi/simple
-
-
-"""
 import paho.mqtt.client as mqtt
 import time
 import json
@@ -57,14 +43,36 @@ class Client(mqtt.Client):
 
 
 if __name__ == '__main__':
+    """
+    cd /home/sri/repositories/repositories/SRI-DINO.Server-py/sri-pysdk/xclient && python3 xmqtt.py
+    
+    pip3 install paho-mqtt==1.6.1
+    
+    python3 xmqtt-a1.py
+    python3 xmqtt-a2.py
+    python3 xmqtt.py
+    
+    pip3 install paho-mqtt==1.6.1 -i hhttps://mirror.baidu.com/pypi/simple
+    
+    
+    """
     # --- init ---
     # c1 = Client(host='192.168.131.23', port=41883)
-    c1 = Client(host='127.0.0.1', port=41883)
+    # c1 = Client(host='127.0.0.1', port=41883)
+    c1 = Client(host='10.10.10.116', port=41883)
+
 
     # --- test subscribe ---
     def m1(_, __, p3):
+        # print(f'#message: {p3.payload}')
         print(f"#message.payload: {json.loads(p3.payload)}")
-    c1.start_subscribe_loop(decorate_method=m1, subscribe_topic='bg/log')
+
+
+    # --- test subscribe
+    # subscribe_topic = 'bg/log'
+    # subscribe_topic = 'qtmqtt'
+    subscribe_topic = 'Vehicle/ControlVehicle/Veh001'
+    c1.start_subscribe_loop(decorate_method=m1, subscribe_topic=subscribe_topic)
 
     # --- test publish ---
     # while True:
@@ -86,4 +94,4 @@ if __name__ == '__main__':
     #         'direction': 22,
     #     }
     #     c1.publish_message('hs/vehicle/state', json.dumps(data))
-    #     time.sleep(3)
+    #     time.sleep(3)

+ 0 - 0
3rdparty/xclient/xmysql.py → sri-pysdk/xclient/xmysql.py


+ 0 - 0
3rdparty/xclient/xqcloudsms.py → sri-pysdk/xclient/xqcloudsms.py


+ 0 - 0
3rdparty/xclient/xredis.py → sri-pysdk/xclient/xredis.py


+ 0 - 0
3rdparty/xclient/xsmtp.py → sri-pysdk/xclient/xsmtp.py


+ 0 - 0
3rdparty/xclient/xsmtp_zl.py → sri-pysdk/xclient/xsmtp_zl.py


+ 0 - 0
3rdparty/xclient/xssh.py → sri-pysdk/xclient/xssh.py


+ 0 - 0
3rdparty/xclient/xtcp.py → sri-pysdk/xclient/xtcp.py


+ 0 - 0
3rdparty/xclient/xudp.py → sri-pysdk/xclient/xudp.py


+ 0 - 0
3rdparty/xdecorator.py → sri-pysdk/xdecorator.py


+ 0 - 0
3rdparty/xengine/cv_face_recognition/engine.py → sri-pysdk/xengine/cv_face_recognition/engine.py


+ 0 - 0
3rdparty/xlib/__init__.py → sri-pysdk/xlib/__init__.py


+ 0 - 0
3rdparty/xlib/xbase64.py → sri-pysdk/xlib/xbase64.py


+ 0 - 0
3rdparty/xlib/xfile.py → sri-pysdk/xlib/xfile.py


+ 0 - 0
3rdparty/xlib/xipv4.py → sri-pysdk/xlib/xipv4.py


+ 0 - 0
3rdparty/xlib/xlist.py → sri-pysdk/xlib/xlist.py


+ 0 - 0
3rdparty/xlib/xlog.py → sri-pysdk/xlib/xlog.py


+ 0 - 0
3rdparty/xlib/xmarkdwon.py → sri-pysdk/xlib/xmarkdwon.py


+ 0 - 0
3rdparty/xlib/xpickle.py → sri-pysdk/xlib/xpickle.py


+ 0 - 0
3rdparty/xlib/xsubprocess.py → sri-pysdk/xlib/xsubprocess.py


+ 0 - 0
3rdparty/xlib/xthread.py → sri-pysdk/xlib/xthread.py


+ 0 - 0
3rdparty/xlib/xtime.py → sri-pysdk/xlib/xtime.py


+ 0 - 0
3rdparty/xlib/xuuid.py → sri-pysdk/xlib/xuuid.py


+ 0 - 0
3rdparty/xpip/aes_by_crypto.py → sri-pysdk/xpip/aes_by_crypto.py


+ 0 - 0
3rdparty/xpip/camera_by_cv2.py → sri-pysdk/xpip/camera_by_cv2.py


+ 0 - 0
3rdparty/xpip/data_by_numpy.py → sri-pysdk/xpip/data_by_numpy.py


+ 0 - 0
3rdparty/xpip/show_by_prettytable.py → sri-pysdk/xpip/show_by_prettytable.py


+ 0 - 0
3rdparty/xpip/xapscheduler.py → sri-pysdk/xpip/xapscheduler.py


+ 0 - 0
3rdparty/xpip/zip_by_pyminizip.py → sri-pysdk/xpip/zip_by_pyminizip.py


+ 0 - 0
3rdparty/xplugin/hydra/plugin.py → sri-pysdk/xplugin/hydra/plugin.py


+ 0 - 0
3rdparty/xplugin/msscan/plugin.py → sri-pysdk/xplugin/msscan/plugin.py


+ 0 - 0
3rdparty/xserver/xtcp.py → sri-pysdk/xserver/xtcp.py


+ 0 - 0
3rdparty/xserver/xudp.py → sri-pysdk/xserver/xudp.py


+ 3 - 17
sri-server-bg01/Dockerfile

@@ -1,4 +1,5 @@
-FROM ubuntu:20.04
+#FROM ubuntu:20.04
+FROM docker.m.daocloud.io/ubuntu:20.04
 ENV DEBIAN_FRONTEND=noninteractive
 
 RUN echo "Update apt:" \
@@ -9,31 +10,16 @@ RUN echo "Update apt:" \
         wget unzip git apt-utils
 
 RUN echo "Install Python v3.8:" \
-    && set -x \
-#    && apt-get dist-upgrade -y \
-#    && apt-get update \
+    && apt-get update \
     && apt-get install -y  \
         python3-dev \
         python3-pip \
         python3-setuptools \
         python3-wheel \
     && pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
-    && pip3 config set global.extra-index-url https://pypi.doubanio.com/simple \
-    && pip3 config set global.extra-index-url https://mirrors.163.com/pypi/simple \
-    && pip3 config set global.extra-index-url https://mirrors.cloud.tencent.com/pypi/simple \
-    && pip3 config set global.extra-index-url https://mirror.baidu.com/pypi/simple \
     && pip3 install --upgrade --quiet pip setuptools \
     && python3 --version
 
-RUN echo "Install OpenCV v4.2.0:" \
-    && set -x \
-    && apt-get update \
-    && apt-get install -y libopencv-dev python3-opencv \
-    && python3 -c "import cv2; print(cv2.__version__)"
-
-# --- set ffmpeg ---
-RUN apt-get install --no-install-recommends -y git ffmpeg supervisor
-
 # --- install requirements ---
 RUN echo "Install Python Requirements:" \
     && pip3 install --default-timeout=1800 --no-cache-dir \

+ 12 - 14
sri-server-bg01/README-usage.bash

@@ -1,37 +1,35 @@
 ## USAGE
 
-# 一、构建操作
-# 构建启动
-echo "BEGIN:" \
-&& project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
+echo "操作:构建启动" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg01" \
 && cd ${project_path} \
 && sudo docker-compose --file compose.yml down \
 && sudo docker-compose --file compose.yml up --detach --build \
 && sudo docker-compose --file compose.yml logs --follow
-# 调试
-echo "BEGIN:" \
-&& project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
+
+echo "操作:调试" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg01" \
 && cd ${project_path} \
 && sudo docker-compose --file compose.yml down \
 && sudo docker-compose --file compose.yml up --detach --build \
 && sudo docker exec -it sri_module_agent_001 bash
-# 强制构建并运行
-echo "BEGIN:" \
-&& project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
+
+echo "操作:强制构建并运行" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg01" \
 && cd ${project_path} \
 && sudo docker-compose --file compose.yml down \
 && sudo docker-compose --file compose.yml build --no-cache \
 && sudo docker-compose --file compose.yml up --detach \
 && sudo docker-compose --file compose.yml logs --follow
-# 重启
-echo "BEGIN:" \
-&& project_path="/home/server/repositories/repositories/casperz.py-project/project-fastapi-bg" \
+
+echo "操作:重启" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg01" \
 && cd ${project_path} \
 && sudo docker-compose --file compose.yml down \
 && sudo docker-compose --file compose.yml up --detach \
 && sudo docker-compose --file compose.yml logs --follow
 
-# 二、日常调试命令
+# 日常调试命令
 sudo chmod -R 777 /home/ubuntu/repositories/repositories
 sudo chmod -R 777 /home/server/repositories/repositories
 sudo docker restart sri-module-bg01 && sudo docker logs -f sri-module-bg01

+ 6 - 0
sri-server-bg01/README.md

@@ -0,0 +1,6 @@
+## 湛江后台api接口服务
+
+#### INFO
+
+* 用途:湛江后台api接口服务
+* 状态:进行中(2024年9月)

+ 13 - 12
sri-server-bg01/compose.yml

@@ -1,10 +1,10 @@
 version: '3.5'
 services:
 
-    sri-module-bg01:
+    sri-server-bg01:
 
         # --- building ---
-        image: sri-module-bg01:2024
+        image: sri-server-bg01:2024
         build:
             context: ./
             dockerfile: ./Dockerfile
@@ -14,24 +14,25 @@ services:
         # --- binding ---
         volumes:
             - /home:/home
-        networks:
-            - sri_network
-        ports:
-            - "9101:9000"
+        network_mode: host
+#        networks:
+#            - sri_network
+#        ports:
+#            - "9101:9000"
 
         # --- running ---
-        container_name: sri-module-bg01
+        container_name: sri-server-bg01
 
         # --- for debug ---
-#        working_dir: /home/server/repositories/repositories/casperz.py-project/project-fastapi-bg
+#        working_dir: /home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg01
 #        stdin_open: true
 #        tty: true
 
         # --- for release ---
-        working_dir: /home/server/repositories/repositories/casperz.py-project/project-fastapi-bg
+        working_dir: /home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg01
         command: bash run.sh
         restart: always
 
-networks:
-    sri_network:
-        external: true
+#networks:
+#    sri_network:
+#        external: true

+ 1 - 1
sri-server-bg01/hub.py

@@ -1,7 +1,7 @@
 import sys
 import importlib
 
-sys.path.append('../3rdparty')
+sys.path.append('../sri-pysdk')
 
 methods = importlib.import_module(f"xlib")
 

+ 293 - 0
sri-server-bg01/test/SRI湛江后台接口说明.md

@@ -0,0 +1,293 @@
+~~~
+# --- test 获取token ---
+# url = 'http://58.34.94.177:29101/v1/token'
+url = 'http://127.0.0.1:9000/v1/token'
+data = {
+    'username': 'admin',  # 登录账户
+    'password': '123456',  # 登录密码
+}
+response = requests.post(url=url, json=data)
+code = response.json().get('code')
+token = response.headers.get('authorization')
+# print(response.json())
+# """
+# {
+#   'code': 0,
+#   'message': 'authorization passed.',
+#   'data': {
+#     'uid': '65dc4187e6e1bf491a4aad1f',
+#     'username': 'admin',
+#     'role': '超级管理员',
+#     'role_type': 1,
+#     'token': 'xxxxxxxx'
+#   }
+# }
+# """
+~~~
+
+~~~
+# --- test 1001 新增用户 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1001,  # 接口号
+    'username': 'aabbcc',  # 登录账户(必须项)
+    'password': 'aabbcc',  # 登录密码(可选项)(默认值:baosteel@2024)
+    'role_type': 1,  # 角色类型(可选项)(1: 超级管理员 2: 普通管理员 3: 普通用户)
+    'name': 'aabbcc',  # 姓名(可选项)
+    'cid': '112233',  # 身份证号(可选项)
+    'phone': '112233',  # 手机号(可选项)
+    'sex': 0,  # 性别(可选项)(0:未设置 1:男 2:女)
+    'department': 'aabbcc',  # 部门(可选项)
+    'wid': 'aabbcc',  # 工号(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 1002 查询用户列表 ---
+# url = 'http://58.34.94.177:29101/v6/api'
+url = 'http://127.0.0.1:9000/v6/api'
+data = {
+    'code': 1002,  # 接口号
+    'page': 1,  # 页码
+    'size': 3,  # 每页条数
+    'name': 'a',  # 模糊姓名(可选项)
+    'phone': '',  # 手机号(可选项)
+    'role_type': ['2'],  # 角色类型(可选项) 1 超级管理员 2 普通管理员 3 普通用户(默认值)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+"""
+{
+  'code': 0,
+  'data': [
+    {
+      'uuid': '65dbeb1c49fbe311a3a01d34',
+      'name': 'aabbcc',
+      'cid': '112233',
+      'phone': '112233',
+      'sex': 0,  # 性别 (0:未设置 1:男 2:女)
+      'department': 'aabbcc',
+      'wid': 'aabbcc',
+      'state': 0,  # 禁用状态 (0:激活 1:禁用)
+      'allow_at': 1708911388  # 注册审批时间时间戳
+    }
+  ]
+}
+"""
+~~~
+
+~~~
+# --- test 1003 删除指定用户 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1003,  # 接口号
+    'uuid': '65db84b35e305885648ec062',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 1004 禁用指定用户 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1004,  # 接口号
+    'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 1005 启用指定用户 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1005,  # 接口号
+    'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 1006 获取指定用户详情 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1006,  # 接口号
+    'uuid': '65dd775c44b74ae33732d7f7',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 1007 修改指定用户信息 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1007,  # 接口号
+    'uuid': '65dd775c44b74ae33732d7f7',  # 用户id(必须项)
+    # 'username': 'aabbcc',  # 登录账户(必须项)
+    # 'password': 'aabbcc',  # 登录密码(可选项)(默认值:baosteel@2024)
+    # 'role_type': 3,  # 角色类型(可选项)(1: 超级管理员 2: 普通管理员 3: 普通用户)
+    'name': 'aabbcc',  # 姓名(可选项)
+    # 'cid': '112233',  # 身份证号(可选项)
+    # 'phone': '112233',  # 手机号(可选项)
+    # 'sex': 0,  # 性别(可选项)(0:未设置 1:男 2:女)
+    # 'department': 'aabbcc',  # 部门(可选项)
+    # 'wid': 'aabbcc',  # 工号(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 2001 新增车辆 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2001,  # 接口号
+    'pid': 'AA998877',  # 车牌号(必须项)
+    'type': '112233',  # 车型号(可选项)
+    'host_address': 'xxx.xxx.xxx.xxx',  # 工控机地址(可选项)
+    'rtk_address': 'xxx.xxx.xxx.xxx',  # rtk地址(可选项)
+    'cpe_address': 'xxx.xxx.xxx.xxx',  # cpe地址(可选项)
+    'release_at': '2022-12-12',  # 出厂日期(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 2002 查询车辆列表 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2002,  # 接口号
+    'page': 1,  # 页码
+    'size': 3,  # 每页条数
+    'pid': 'AA',  # 模糊查询,车牌号(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+"""
+{
+  'code': 0,
+  'data': [
+    {
+      'uuid': '65dbe96949fbe311a3a01d30',
+      'pid': 'AA112233',
+      'type': '112233',
+      'host_address': 'xxx.xxx.xxx.xxx',
+      'rtk_address': 'xxx.xxx.xxx.xxx',
+      'cpe_address': 'xxx.xxx.xxx.xxx',
+      'release_at': '2022-12-12',
+      'state': 1,  # 当前状态 (1:离线 2:在线空闲 3: 现场驾驶中 4: 远程驾驶中)
+      'permit_state': 0  # 遥操状态 (0:允许 1:禁用)
+    }
+  ]
+}
+"""
+~~~
+
+~~~
+# --- test 2003 修改指定车辆信息 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2003,  # 接口号
+    'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
+    'pid': 'AA112233',  # 车牌号(可选项)
+    'type': '三一/SMHW48',  # 车型号(可选项)
+    'host_address': 'xxx.xxx.xxx.xxx',  # 工控机地址(可选项)
+    'rtk_address': 'xxx.xxx.xxx.xxx',  # rtk地址(可选项)
+    'cpe_address': 'xxx.xxx.xxx.xxx',  # cpe地址(可选项)
+    'release_at': '2022-12-12',  # 出厂日期(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 2004 禁止指定车辆远程操作 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2004,  # 接口号
+    'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 2005 允许指定车辆远程操作 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2005,  # 接口号
+    'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 2006 删除指定作业车辆 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2006,  # 接口号
+    'uuid': '65dd95e244b74ae33732d810',  # 车辆id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 2007 获取指定作业车辆详情 ---
+# url = 'http://58.34.94.177:29101/v6/api'
+url = 'http://127.0.0.1:9000/v6/api'
+data = {
+    'code': 2007,  # 接口号
+    'uuid': '65de9fa044b74ae33732d811',  # 车辆id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+~~~
+
+~~~
+# --- test 3001 查询驾驶人员操作记录列表 ---
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 3001,  # 接口号
+    'page': 1,  # 页码
+    'size': 3,  # 每页条数
+    'pid': 'AA',  # 模糊查询,车牌号(可选项)
+    'driver_name': 'AABBXX',  # 模糊查询,驾驶员(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+"""
+{
+  'code': 0,
+  'data': [
+    {
+      'uuid': '65dbe96949fbe311a3a01d30',
+      'pid': 'AA112233',
+      'start_time_at': 1708917227,
+      'end_time_at': 1708946027,
+      'driver_name': '张三',
+      'cockpit_name': '1号舱'
+    }
+  ],
+  'total': 1,
+  'page': 1,
+  'size': 3
+}
+"""
+~~~
+
+~~~
+# --- test 3002 下载指定驾驶人员操作日志 ---
+url = 'http://58.34.94.177:29101/v6/api'
+params = {'code': 3002}
+response = requests.get(url=url, params=params, headers={'authorization': token})
+print(response.text)
+requests.get(url='http://58.34.94.177:29101/v6/api?code=3002').text
+~~~

+ 59 - 59
sri-server-bg01/test/test-1000.py

@@ -26,21 +26,21 @@ token = response.headers.get('authorization')
 # """
 
 # --- test 1001 新增用户 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 1001,  # 接口号
-#     'username': 'aabbcc',  # 登录账户(必须项)
-#     'password': 'aabbcc',  # 登录密码(可选项)(默认值:baosteel@2024)
-#     'role_type': 1,  # 角色类型(可选项)(1: 超级管理员 2: 普通管理员 3: 普通用户)
-#     'name': 'aabbcc',  # 姓名(可选项)
-#     'cid': '112233',  # 身份证号(可选项)
-#     'phone': '112233',  # 手机号(可选项)
-#     'sex': 0,  # 性别(可选项)(0:未设置 1:男 2:女)
-#     'department': 'aabbcc',  # 部门(可选项)
-#     'wid': 'aabbcc',  # 工号(可选项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1001,  # 接口号
+    'username': 'aabbcc',  # 登录账户(必须项)
+    'password': 'aabbcc',  # 登录密码(可选项)(默认值:baosteel@2024)
+    'role_type': 1,  # 角色类型(可选项)(1: 超级管理员 2: 普通管理员 3: 普通用户)
+    'name': 'aabbcc',  # 姓名(可选项)
+    'cid': '112233',  # 身份证号(可选项)
+    'phone': '112233',  # 手机号(可选项)
+    'sex': 0,  # 性别(可选项)(0:未设置 1:男 2:女)
+    'department': 'aabbcc',  # 部门(可选项)
+    'wid': 'aabbcc',  # 工号(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 1002 查询用户列表 ---
 # url = 'http://58.34.94.177:29101/v6/api'
@@ -75,55 +75,55 @@ print(response.json())
 """
 
 # --- test 1003 删除指定用户 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 1003,  # 接口号
-#     'uuid': '65db84b35e305885648ec062',  # 用户id(必须项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1003,  # 接口号
+    'uuid': '65db84b35e305885648ec062',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 1004 禁用指定用户 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 1004,  # 接口号
-#     'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1004,  # 接口号
+    'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 1005 启用指定用户 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 1005,  # 接口号
-#     'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1005,  # 接口号
+    'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 1006 获取指定用户详情 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 1006,  # 接口号
-#     'uuid': '65dd775c44b74ae33732d7f7',  # 用户id(必须项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1006,  # 接口号
+    'uuid': '65dd775c44b74ae33732d7f7',  # 用户id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 1007 修改指定用户信息 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 1007,  # 接口号
-#     'uuid': '65dd775c44b74ae33732d7f7',  # 用户id(必须项)
-#     # 'username': 'aabbcc',  # 登录账户(必须项)
-#     # 'password': 'aabbcc',  # 登录密码(可选项)(默认值:baosteel@2024)
-#     # 'role_type': 3,  # 角色类型(可选项)(1: 超级管理员 2: 普通管理员 3: 普通用户)
-#     'name': 'aabbcc',  # 姓名(可选项)
-#     # 'cid': '112233',  # 身份证号(可选项)
-#     # 'phone': '112233',  # 手机号(可选项)
-#     # 'sex': 0,  # 性别(可选项)(0:未设置 1:男 2:女)
-#     # 'department': 'aabbcc',  # 部门(可选项)
-#     # 'wid': 'aabbcc',  # 工号(可选项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 1007,  # 接口号
+    'uuid': '65dd775c44b74ae33732d7f7',  # 用户id(必须项)
+    # 'username': 'aabbcc',  # 登录账户(必须项)
+    # 'password': 'aabbcc',  # 登录密码(可选项)(默认值:baosteel@2024)
+    # 'role_type': 3,  # 角色类型(可选项)(1: 超级管理员 2: 普通管理员 3: 普通用户)
+    'name': 'aabbcc',  # 姓名(可选项)
+    # 'cid': '112233',  # 身份证号(可选项)
+    # 'phone': '112233',  # 手机号(可选项)
+    # 'sex': 0,  # 性别(可选项)(0:未设置 1:男 2:女)
+    # 'department': 'aabbcc',  # 部门(可选项)
+    # 'wid': 'aabbcc',  # 工号(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())

+ 73 - 73
sri-server-bg01/test/test-2000.py

@@ -13,89 +13,89 @@ token = response.headers.get('authorization')
 # print(code, token)
 
 # --- test 2001 新增车辆 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 2001,  # 接口号
-#     'pid': 'AA998877',  # 车牌号(必须项)
-#     'type': '112233',  # 车型号(可选项)
-#     'host_address': 'xxx.xxx.xxx.xxx',  # 工控机地址(可选项)
-#     'rtk_address': 'xxx.xxx.xxx.xxx',  # rtk地址(可选项)
-#     'cpe_address': 'xxx.xxx.xxx.xxx',  # cpe地址(可选项)
-#     'release_at': '2022-12-12',  # 出厂日期(可选项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2001,  # 接口号
+    'pid': 'AA998877',  # 车牌号(必须项)
+    'type': '112233',  # 车型号(可选项)
+    'host_address': 'xxx.xxx.xxx.xxx',  # 工控机地址(可选项)
+    'rtk_address': 'xxx.xxx.xxx.xxx',  # rtk地址(可选项)
+    'cpe_address': 'xxx.xxx.xxx.xxx',  # cpe地址(可选项)
+    'release_at': '2022-12-12',  # 出厂日期(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 2002 查询车辆列表 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 2002,  # 接口号
-#     'page': 1,  # 页码
-#     'size': 3,  # 每页条数
-#     'pid': 'AA',  # 模糊查询,车牌号(可选项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
-# """
-# {
-#   'code': 0,
-#   'data': [
-#     {
-#       'uuid': '65dbe96949fbe311a3a01d30',
-#       'pid': 'AA112233',
-#       'type': '112233',
-#       'host_address': 'xxx.xxx.xxx.xxx',
-#       'rtk_address': 'xxx.xxx.xxx.xxx',
-#       'cpe_address': 'xxx.xxx.xxx.xxx',
-#       'release_at': '2022-12-12',
-#       'state': 1,  # 当前状态 (1:离线 2:在线空闲 3: 现场驾驶中 4: 远程驾驶中)
-#       'permit_state': 0  # 遥操状态 (0:允许 1:禁用)
-#     }
-#   ]
-# }
-# """
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2002,  # 接口号
+    'page': 1,  # 页码
+    'size': 3,  # 每页条数
+    'pid': 'AA',  # 模糊查询,车牌号(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+"""
+{
+  'code': 0,
+  'data': [
+    {
+      'uuid': '65dbe96949fbe311a3a01d30',
+      'pid': 'AA112233',
+      'type': '112233',
+      'host_address': 'xxx.xxx.xxx.xxx',
+      'rtk_address': 'xxx.xxx.xxx.xxx',
+      'cpe_address': 'xxx.xxx.xxx.xxx',
+      'release_at': '2022-12-12',
+      'state': 1,  # 当前状态 (1:离线 2:在线空闲 3: 现场驾驶中 4: 远程驾驶中)
+      'permit_state': 0  # 遥操状态 (0:允许 1:禁用)
+    }
+  ]
+}
+"""
 
 # --- test 2003 修改指定车辆信息 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 2003,  # 接口号
-#     'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
-#     'pid': 'AA112233',  # 车牌号(可选项)
-#     'type': '三一/SMHW48',  # 车型号(可选项)
-#     'host_address': 'xxx.xxx.xxx.xxx',  # 工控机地址(可选项)
-#     'rtk_address': 'xxx.xxx.xxx.xxx',  # rtk地址(可选项)
-#     'cpe_address': 'xxx.xxx.xxx.xxx',  # cpe地址(可选项)
-#     'release_at': '2022-12-12',  # 出厂日期(可选项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2003,  # 接口号
+    'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
+    'pid': 'AA112233',  # 车牌号(可选项)
+    'type': '三一/SMHW48',  # 车型号(可选项)
+    'host_address': 'xxx.xxx.xxx.xxx',  # 工控机地址(可选项)
+    'rtk_address': 'xxx.xxx.xxx.xxx',  # rtk地址(可选项)
+    'cpe_address': 'xxx.xxx.xxx.xxx',  # cpe地址(可选项)
+    'release_at': '2022-12-12',  # 出厂日期(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 2004 禁止指定车辆远程操作 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 2004,  # 接口号
-#     'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2004,  # 接口号
+    'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 2005 允许指定车辆远程操作 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 2005,  # 接口号
-#     'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2005,  # 接口号
+    'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 2006 删除指定作业车辆 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 2006,  # 接口号
-#     'uuid': '65dd95e244b74ae33732d810',  # 车辆id(必须项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 2006,  # 接口号
+    'uuid': '65dd95e244b74ae33732d810',  # 车辆id(必须项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
 
 # --- test 2007 获取指定作业车辆详情 ---
 # url = 'http://58.34.94.177:29101/v6/api'

+ 33 - 33
sri-server-bg01/test/test-3000.py

@@ -13,38 +13,38 @@ token = response.headers.get('authorization')
 # print(code, token)
 
 # --- test 3001 查询驾驶人员操作记录列表 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# data = {
-#     'code': 3001,  # 接口号
-#     'page': 1,  # 页码
-#     'size': 3,  # 每页条数
-#     'pid': 'AA',  # 模糊查询,车牌号(可选项)
-#     'driver_name': 'AABBXX',  # 模糊查询,驾驶员(可选项)
-# }
-# response = requests.post(url=url, json=data, headers={'authorization': token})
-# print(response.json())
-# """
-# {
-#   'code': 0,
-#   'data': [
-#     {
-#       'uuid': '65dbe96949fbe311a3a01d30',
-#       'pid': 'AA112233',
-#       'start_time_at': 1708917227,
-#       'end_time_at': 1708946027,
-#       'driver_name': '张三',
-#       'cockpit_name': '1号舱'
-#     }
-#   ],
-#   'total': 1,
-#   'page': 1,
-#   'size': 3
-# }
-# """
+url = 'http://58.34.94.177:29101/v6/api'
+data = {
+    'code': 3001,  # 接口号
+    'page': 1,  # 页码
+    'size': 3,  # 每页条数
+    'pid': 'AA',  # 模糊查询,车牌号(可选项)
+    'driver_name': 'AABBXX',  # 模糊查询,驾驶员(可选项)
+}
+response = requests.post(url=url, json=data, headers={'authorization': token})
+print(response.json())
+"""
+{
+  'code': 0,
+  'data': [
+    {
+      'uuid': '65dbe96949fbe311a3a01d30',
+      'pid': 'AA112233',
+      'start_time_at': 1708917227,
+      'end_time_at': 1708946027,
+      'driver_name': '张三',
+      'cockpit_name': '1号舱'
+    }
+  ],
+  'total': 1,
+  'page': 1,
+  'size': 3
+}
+"""
 
 # --- test 3002 下载指定驾驶人员操作日志 ---
-# url = 'http://58.34.94.177:29101/v6/api'
-# params = {'code': 3002}
-# response = requests.get(url=url, params=params, headers={'authorization': token})
-# print(response.text)
-# requests.get(url='http://58.34.94.177:29101/v6/api?code=3002').text
+url = 'http://58.34.94.177:29101/v6/api'
+params = {'code': 3002}
+response = requests.get(url=url, params=params, headers={'authorization': token})
+print(response.text)
+requests.get(url='http://58.34.94.177:29101/v6/api?code=3002').text

+ 0 - 49
sri-server-bg01/test/接口说明.md

@@ -1,49 +0,0 @@
-~~~
-# --- test 2006 删除指定车辆 ---
-url = 'http://58.34.94.177:29101/v6/api'
-data = {
-    'code': 2006,  # 接口号
-    'uuid': '65dbe96949fbe311a3a01d30',  # 车辆id(必须项)
-}
-response = requests.post(url=url, json=data, headers={'authorization': token})
-print(response.json())
-~~~
-
-~~~
-# --- test 2007 获取指定作业车辆详情 ---
-url = 'http://58.34.94.177:29101/v6/api'
-data = {
-    'code': 2007,  # 接口号
-    'uuid': '65de9fa044b74ae33732d811',  # 车辆id(必须项)
-}
-response = requests.post(url=url, json=data, headers={'authorization': token})
-print(response.json())
-~~~
-
-~~~
-# --- test 1005 启用指定用户 ---
-url = 'http://58.34.94.177:29101/v6/api'
-data = {
-    'code': 1005,  # 接口号
-    'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
-}
-response = requests.post(url=url, json=data, headers={'authorization': token})
-print(response.json())
-~~~
-
-~~~
-# --- test 1006 获取指定用户详情 ---
-url = 'http://58.34.94.177:29101/v6/api'
-data = {
-    'code': 1006,  # 接口号
-    'uuid': '65decb7744b74ae33732d813',  # 用户id(必须项)
-}
-response = requests.post(url=url, json=data, headers={'authorization': token})
-print(response.json())
-~~~
-
-~~~
-# --- test 3002 下载指定驾驶人员操作日志 ---
-url = 'http://58.34.94.177:29101/v6/api?code=3002'
-response = requests.get(url=url)
-~~~

+ 2 - 1
sri-server-bg02/Dockerfile

@@ -1,4 +1,5 @@
-FROM ubuntu:20.04
+#FROM ubuntu:20.04
+FROM docker.m.daocloud.io/ubuntu:20.04
 ENV DEBIAN_FRONTEND=noninteractive
 
 RUN echo "Install Python v3.8:" \

+ 27 - 2
sri-server-bg02/README-usage.bash

@@ -1,7 +1,32 @@
 ## NOTE
 
-echo "执行:启动" \
-&& project_path="/home/server/repositories/repositories/gitee.com/casperz.py-project/project-responder-bg" \
+echo "操作:构建调试" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg02" \
+&& cd ${project_path} \
+&& sudo docker-compose --file compose.yml down \
+&& sudo docker-compose --file compose.yml up --detach --build \
+&& sudo docker exec -it sri-server-bg02 bash
+
+echo "操作:启动调试环境" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg02" \
+&& cd ${project_path} \
+&& sudo docker-compose --file compose.yml down \
+&& sudo docker-compose --file compose.yml up --detach \
+&& sudo docker exec -it sri-server-bg02 bash
+
+echo "操作:重启调试环境" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg02" \
+&& cd ${project_path} \
+&& sudo docker-compose --file compose.yml restart \
+&& sudo docker exec -it sri-server-bg02 bash
+
+echo "操作:进入调试环境" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg02" \
+&& cd ${project_path} \
+&& sudo docker exec -it sri-server-bg02 bash
+
+echo "操作:初装启动" \
+&& project_path="/home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg02" \
 && cd ${project_path} \
 && sudo docker-compose --file compose.yml down \
 && sudo docker-compose --file compose.yml up --detach --build \

+ 6 - 0
sri-server-bg02/README.md

@@ -0,0 +1,6 @@
+## 湛江mqtt消息监听服务
+
+#### INFO
+
+* 用途:湛江mqtt消息监听服务
+* 状态:进行中(2024年9月)

+ 17 - 16
sri-server-bg02/compose.yml

@@ -1,10 +1,10 @@
 version: '3.5'
 services:
 
-    sri-module-bg02:
+    sri-server-bg02:
 
         # --- building ---
-        image: sri-module-bg02:2024
+        image: sri-server-bg02:2024
         build:
             context: ./
             dockerfile: ./Dockerfile
@@ -14,24 +14,25 @@ services:
         # --- binding ---
         volumes:
             - /home:/home
-        networks:
-            - sri_network
-        ports:
-            - 9102:9000
+        network_mode: host
+#        networks:
+#            - sri_network
+#        ports:
+#            - 9102:9000
 
         # --- running ---
-        container_name: sri-module-bg02
+        container_name: sri-server-bg02
 
         # --- for debug ---
-#        working_dir: /home/server/repositories/repositories/gitee.com/casperz.py-project/project-responder-bg
-#        stdin_open: true
-#        tty: true
+        working_dir: /home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg02
+        stdin_open: true
+        tty: true
 
         # --- for release ---
-        working_dir: /home/server/repositories/repositories/gitee.com/casperz.py-project/project-responder-bg
-        command: bash run.sh
-        restart: always
+#        working_dir: /home/sri/repositories/repositories/SRI-DINO.Server-py/sri-server-bg02
+#        command: bash run.sh
+#        restart: always
 
-networks:
-    sri_network:
-        external: true
+#networks:
+#    sri_network:
+#        external: true

+ 2 - 3
sri-server-bg02/hub.py

@@ -1,7 +1,7 @@
 import sys
 import importlib
 
-sys.path.append('../3rdparty')
+sys.path.append('../sri-pysdk')
 
 methods = importlib.import_module(f"xlib")
 
@@ -10,7 +10,6 @@ class Global(object):
     # --- 中间件服务器 ---
     emqx = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
 
-
     aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
                                                             db_host='127.0.0.1',
                                                             db_port=47017,
@@ -23,4 +22,4 @@ class Global(object):
     #                                                         db_host='10.10.10.73',
     #                                                         db_port=47017,
     #                                                         username='admin', password='admin',
-    #                                                         database='bg', collection='LoopTask')
+    #                                                         database='bg', collection='LoopTask')

+ 1 - 0
sri-server-bg02/test/SRI202409-湛江项目mqtt接口说明.md

@@ -1,6 +1,7 @@
 ~~~
 mqtt服务地址:10.10.10.73(实验室mqtt服务器)
 mqtt服务地址:10.10.60.237(sri内网测试服务器)
+mqtt服务地址:10.10.10.116(sri内网测试服务器)
 mqtt服务端口:41883
 mqtt话题:bg/log
 mqtt消息(json字符串):{"1": "2024-12-12 01:01:21", "2": 6000, "3": 6000, "4": 6000}

+ 4 - 2
sri-server-bg02/test/test-mqtt-sender.py

@@ -4,8 +4,9 @@ import json
 
 client = mqtt.Client()
 # client.connect(host='10.10.61.229', port=41883)
-client.connect(host='127.0.0.1', port=41883)  # 本地环境
+client.connect(host='10.10.10.116', port=41883)
 # client.connect(host='10.10.10.73', port=41883)
+# client.connect(host='127.0.0.1', port=41883)  # 本地环境
 
 
 def test_bg_log():
@@ -25,7 +26,8 @@ def test_bg_log():
         3: 6000,  # 油门值
         4: 6000,  # 刹车值
     }
-    results = client.publish('bg/log', json.dumps(data))
+    # results = client.publish('bg/log', json.dumps(data))
+    results = client.publish('qtmqtt', json.dumps(data))
     result_code, message_id = results
     print(f"#result_code: {result_code}, #message_id: {message_id}")