internal 1.0.100__py3-none-any.whl → 1.0.102__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of internal might be problematic. Click here for more details.

internal/http/requests.py CHANGED
@@ -3,7 +3,6 @@ import httpx
3
3
  from fastapi import FastAPI
4
4
  from fastapi.encoders import jsonable_encoder
5
5
 
6
- from ..common_enum.overview_websocket_channel import OverviewWebsocketChannelEnum
7
6
  from ..exception.internal_exception import GatewayTimeoutException, BadGatewayException
8
7
 
9
8
 
@@ -58,14 +57,3 @@ async def send_webhook_message(app: FastAPI, message: str):
58
57
  await async_request(app, "POST", app.state.config.WEBHOOK_BASE_URL, json=payload)
59
58
  except Exception as e:
60
59
  app.state.logger.warn(f"Notify failure, Exception:{e}")
61
-
62
-
63
- async def push_overview_websocket(channel: OverviewWebsocketChannelEnum, data: dict, app: FastAPI,
64
- current_user: dict = None):
65
- payload = {"channel": channel, "data": data}
66
- try:
67
- return await async_request(app, "POST", app.state.config.NOTIFY_BASE_URL, current_user, json=payload)
68
- except Exception as e:
69
- app.state.logger.warn(f"Push overview websocket failue, exception: {e}, payload: {payload}")
70
-
71
- return None
internal/utils.py CHANGED
@@ -57,3 +57,22 @@ def get_current_utc() -> datetime:
57
57
 
58
58
  def get_lpr_data_list_redis_key(organization_id, plate_no):
59
59
  return f"{REDIS_LPR_DATA_LIST_PREFIX}_{organization_id}_{plate_no}"
60
+
61
+ async def mask_name(input_string: str, start_index: int = 1, mask_char: str = "o"):
62
+ """
63
+ 将姓名的前 start_index 个字符保留,其余字符替换为 'o',用于隐码处理。
64
+
65
+ :param input_string: 要隐码的姓名字符串
66
+ :param start_index: 从第几位开始进行隐码处理(默认值为 1)
67
+ :return: 隐码处理后的字符串
68
+ """
69
+ if not input_string:
70
+ return ""
71
+
72
+ # 保留前 start_index 个字符
73
+ visible_part = input_string[:start_index]
74
+
75
+ # 创建隐码部分,其余字符替换为 'o'
76
+ masked_part = mask_char * (len(input_string) - start_index)
77
+
78
+ return visible_part + masked_part
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.0.100
3
+ Version: 1.0.102
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -13,7 +13,6 @@ internal/common_enum/lpr_direction.py,sha256=glCGSkcXHUB6_p2jO_7IdEHycyFVhu0vHDD
13
13
  internal/common_enum/notify_type.py,sha256=0xYVmUPU1hp6NiKK2fqL8e-Ip1dSBxBR9MbJve5UZRk,169
14
14
  internal/common_enum/operator_type.py,sha256=XfHwGDsuOG6-ajitDoRuLFLT1LhHKoXXzFRW4e5vmJ8,173
15
15
  internal/common_enum/order_type.py,sha256=XwAl5JaZgFLahBQhBKG4VuMJ39Si9KZEhcSS0-DKKzQ,90
16
- internal/common_enum/overview_websocket_channel.py,sha256=FlqqcX9HT6yanzRMKYisDsWFBoc1Z7J4gQ12ECiWrgo,218
17
16
  internal/const.py,sha256=B1pT2lNTohiXClo3ILC0Kd4UuIWi12lPKqXqWUd52bA,1106
18
17
  internal/database.py,sha256=1u53JnFJ0jvP7H4HPY2faA2ABdPQ8SlsZigYmQAPktI,2470
19
18
  internal/exception/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -25,7 +24,7 @@ internal/ext/amazon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
25
24
  internal/ext/amazon/aws/__init__.py,sha256=2YFjb-rHG1JaZGZiZffYDesgTAJjDshOqQbswOYzhP8,834
26
25
  internal/ext/amazon/aws/const.py,sha256=l4WMg5bKWujwOKABBkCO2zclNg3abnYOfbhD7DG8GsA,109
27
26
  internal/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- internal/http/requests.py,sha256=BSccquJj5bHFLnxD1pVzXMblUsZSNoPfL1bVO4LFQSU,3340
27
+ internal/http/requests.py,sha256=jnclx5SPjCAfQ9b4bOSPLPCocMLL9Fr7_SXEsWmMnx4,2782
29
28
  internal/http/responses.py,sha256=zvU0iRQ9-qxeEZfKmuvTi8lv9DFcaNAsHlQKOTCpVzw,2945
30
29
  internal/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
30
  internal/interface/base_interface.py,sha256=3YaVjIgLi_pZpLk5SEIk8WVkuICM8qPavT8rB0MdB5U,1536
@@ -34,8 +33,8 @@ internal/middleware/log_request.py,sha256=bXAxmvvsYDhObXzfUw4ZNreKAWOo8ee_vpb6Xi
34
33
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
34
  internal/model/base_model.py,sha256=NWjysNOp2MfXvAHGFqaQA_l8ZfTFvJbXQPUPuOXN_2g,5361
36
35
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
37
- internal/utils.py,sha256=zlppFkaZnvYGEZkNPmA_gMdlcZQrGaAOjpICl7QvRLg,1794
36
+ internal/utils.py,sha256=YDALmqhrZWIxOWaL8DeXhEJkn9hFfjh8gOdPcHTyQ5o,2455
38
37
  internal/validator_utils.py,sha256=5ZLcNIgw1hvkYOj1f6gS9AYxe7Y3ufW9FyDxUS7FsMQ,1226
39
- internal-1.0.100.dist-info/METADATA,sha256=PKQQCx_FAYtGXOLZSeQm1d2wZmpKJEd_6NQAILQMiqU,757
40
- internal-1.0.100.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
41
- internal-1.0.100.dist-info/RECORD,,
38
+ internal-1.0.102.dist-info/METADATA,sha256=CSAex7WqRmePll76Lig5IhkgrYBXlaGbgUhKSLDh9gM,757
39
+ internal-1.0.102.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
40
+ internal-1.0.102.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- from enum import Enum
2
-
3
-
4
- class OverviewWebsocketChannelEnum(str, Enum):
5
- OVER_ALL = "over_all" # 儀表板
6
- RECEPTION_CENTER = "reception_center" # 接待中心
7
- CAR_MOVEMENT = "car_movement" # 車輛動態