sycommon-python-lib 0.1.52__py3-none-any.whl → 0.1.53__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.
sycommon/synacos/feign.py CHANGED
@@ -22,6 +22,8 @@ async def feign(service_name, api_path, method='GET', params=None, headers=None,
22
22
  try:
23
23
  # 初始化headers,确保是可修改的字典
24
24
  headers = headers.copy() if headers else {}
25
+ if "x-traceId-header" not in headers:
26
+ headers["x-traceId-header"] = SYLogger.get_trace_id()
25
27
 
26
28
  # 处理JSON请求的Content-Type
27
29
  is_json_request = method.upper() in ["POST", "PUT", "PATCH"] and not (
@@ -26,6 +26,7 @@ def feign_client(
26
26
  default_headers: Optional[Dict[str, str]] = None
27
27
  ):
28
28
  default_headers = default_headers or {}
29
+ default_headers["x-traceId-header"] = SYLogger.get_trace_id()
29
30
 
30
31
  def decorator(cls):
31
32
  class FeignClient:
@@ -152,6 +153,7 @@ def feign_client(
152
153
  def _build_headers(self, param_meta: Dict[str, Param], bound_args: Dict[str, Any], method_headers: Dict[str, str]) -> Dict[str, str]:
153
154
  headers = self.default_headers.copy()
154
155
  headers.update(method_headers)
156
+ headers["x-traceId-header"] = SYLogger.get_trace_id()
155
157
  for name, meta in param_meta.items():
156
158
  if isinstance(meta, Header) and name in bound_args:
157
159
  value = bound_args[name]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sycommon-python-lib
3
- Version: 0.1.52
3
+ Version: 0.1.53
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -11,7 +11,7 @@ Requires-Dist: fastapi>=0.121.2
11
11
  Requires-Dist: kafka-python>=2.2.16
12
12
  Requires-Dist: loguru>=0.7.3
13
13
  Requires-Dist: mysql-connector-python>=9.5.0
14
- Requires-Dist: nacos-sdk-python>=2.0.9
14
+ Requires-Dist: nacos-sdk-python<3.0,>=2.0.9
15
15
  Requires-Dist: pydantic>=2.12.4
16
16
  Requires-Dist: python-dotenv>=1.2.1
17
17
  Requires-Dist: pyyaml>=6.0.3
@@ -44,16 +44,16 @@ sycommon/sse/sse.py,sha256=__CfWEcYxOxQ-HpLor4LTZ5hLWqw9-2X7CngqbVHsfw,10128
44
44
  sycommon/synacos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
45
  sycommon/synacos/example.py,sha256=61XL03tU8WTNOo3FUduf93F2fAwah1S0lbH1ufhRhRk,5739
46
46
  sycommon/synacos/example2.py,sha256=adUaru3Hy482KrOA17DfaC4nwvLj8etIDS_KrWLWmCU,4811
47
- sycommon/synacos/feign.py,sha256=-2tuGCqoSM3ddSoSz7h1RJTB06hn8K26v_1ev4qLsTU,7728
48
- sycommon/synacos/feign_client.py,sha256=JxzxohrsscQNlAjRVo_3ZQrMQSfVHFOtRYyEnP6sDGk,15205
47
+ sycommon/synacos/feign.py,sha256=xlC88_X0bM7C0FJlyRrZetzkC1OJSLBk3BEsGVbTcKk,7840
48
+ sycommon/synacos/feign_client.py,sha256=UxdYNW-oZVYIEwNBfIfVNPl_gppiYzPxp9ApDgQu0PY,15341
49
49
  sycommon/synacos/nacos_service.py,sha256=2m1ZxIii3r657kQJfp7C7I5bxBUEGDweYMfloUUmBSw,35389
50
50
  sycommon/synacos/param.py,sha256=KcfSkxnXOa0TGmCjY8hdzU9pzUsA8-4PeyBKWI2-568,1765
51
51
  sycommon/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  sycommon/tools/docs.py,sha256=OPj2ETheuWjXLyaXtaZPbwmJKfJaYXV5s4XMVAUNrms,1607
53
53
  sycommon/tools/snowflake.py,sha256=DdEj3T5r5OEvikp3puxqmmmz6BrggxomoSlnsRFb5dM,1174
54
54
  sycommon/tools/timing.py,sha256=OiiE7P07lRoMzX9kzb8sZU9cDb0zNnqIlY5pWqHcnkY,2064
55
- sycommon_python_lib-0.1.52.dist-info/METADATA,sha256=1ucpOddKw2gFQLUJPp2k_kJZ6M03xqVtvLbPSdnVcGQ,7037
56
- sycommon_python_lib-0.1.52.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
57
- sycommon_python_lib-0.1.52.dist-info/entry_points.txt,sha256=q_h2nbvhhmdnsOUZEIwpuoDjaNfBF9XqppDEmQn9d_A,46
58
- sycommon_python_lib-0.1.52.dist-info/top_level.txt,sha256=98CJ-cyM2WIKxLz-Pf0AitWLhJyrfXvyY8slwjTXNuc,17
59
- sycommon_python_lib-0.1.52.dist-info/RECORD,,
55
+ sycommon_python_lib-0.1.53.dist-info/METADATA,sha256=eFVaKBj389CACoxmbqtqRJdqqTkpMKvitbj48ChlohQ,7042
56
+ sycommon_python_lib-0.1.53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
57
+ sycommon_python_lib-0.1.53.dist-info/entry_points.txt,sha256=q_h2nbvhhmdnsOUZEIwpuoDjaNfBF9XqppDEmQn9d_A,46
58
+ sycommon_python_lib-0.1.53.dist-info/top_level.txt,sha256=98CJ-cyM2WIKxLz-Pf0AitWLhJyrfXvyY8slwjTXNuc,17
59
+ sycommon_python_lib-0.1.53.dist-info/RECORD,,