sycommon-python-lib 0.1.52a0__tar.gz → 0.1.54__tar.gz
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_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/PKG-INFO +2 -2
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/pyproject.toml +2 -2
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/kafka_log.py +2 -2
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/middleware.py +1 -1
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/feign.py +3 -1
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/feign_client.py +4 -2
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon_python_lib.egg-info/PKG-INFO +2 -2
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon_python_lib.egg-info/requires.txt +1 -1
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/README.md +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/setup.cfg +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/command/cli.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/Config.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/DatabaseConfig.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/EmbeddingConfig.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/LLMConfig.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/MQConfig.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/RerankerConfig.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/database/base_db_service.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/database/database_service.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/health/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/health/health_check.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/health/metrics.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/health/ping.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/logger_wrapper.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/sql_logger.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/context.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/cors.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/docs.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/exception.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/monitor_memory.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/mq.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/timeout.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/traceid.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/base_http.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/log.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/mqlistener_config.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/mqmsg_model.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/mqsend_config.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/sso_user.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/rabbitmq/rabbitmq_client.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/rabbitmq/rabbitmq_pool.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/rabbitmq/rabbitmq_service.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/services.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/sse/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/sse/event.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/sse/sse.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/example.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/example2.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/nacos_service.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/param.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/tools/__init__.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/tools/docs.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/tools/snowflake.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/tools/timing.py +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon_python_lib.egg-info/SOURCES.txt +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon_python_lib.egg-info/dependency_links.txt +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon_python_lib.egg-info/entry_points.txt +0 -0
- {sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon_python_lib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sycommon-python-lib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.54
|
|
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
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sycommon-python-lib"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.54"
|
|
4
4
|
description = "Add your description here"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -12,7 +12,7 @@ dependencies = [
|
|
|
12
12
|
"kafka-python>=2.2.16",
|
|
13
13
|
"loguru>=0.7.3",
|
|
14
14
|
"mysql-connector-python>=9.5.0",
|
|
15
|
-
"nacos-sdk-python>=2.0.9",
|
|
15
|
+
"nacos-sdk-python>=2.0.9,<3.0",
|
|
16
16
|
"pydantic>=2.12.4",
|
|
17
17
|
"python-dotenv>=1.2.1",
|
|
18
18
|
"pyyaml>=6.0.3",
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/kafka_log.py
RENAMED
|
@@ -459,7 +459,7 @@ class SYLogger:
|
|
|
459
459
|
|
|
460
460
|
@staticmethod
|
|
461
461
|
def _log(msg: any, level: str = "INFO"):
|
|
462
|
-
trace_id = SYLogger.get_trace_id()
|
|
462
|
+
trace_id = SYLogger.get_trace_id() or Snowflake.next_id()
|
|
463
463
|
|
|
464
464
|
if isinstance(msg, dict) or isinstance(msg, list):
|
|
465
465
|
msg_str = json.dumps(msg, ensure_ascii=False)
|
|
@@ -521,7 +521,7 @@ class SYLogger:
|
|
|
521
521
|
@staticmethod
|
|
522
522
|
def exception(msg: any, *args, **kwargs):
|
|
523
523
|
"""记录异常信息,包括完整堆栈"""
|
|
524
|
-
trace_id = SYLogger.get_trace_id()
|
|
524
|
+
trace_id = SYLogger.get_trace_id() or Snowflake.next_id()
|
|
525
525
|
|
|
526
526
|
if isinstance(msg, dict) or isinstance(msg, list):
|
|
527
527
|
msg_str = json.dumps(msg, ensure_ascii=False)
|
|
@@ -2,6 +2,8 @@ import io
|
|
|
2
2
|
import os
|
|
3
3
|
import time
|
|
4
4
|
|
|
5
|
+
from sycommon.tools.snowflake import Snowflake
|
|
6
|
+
|
|
5
7
|
import aiohttp
|
|
6
8
|
from sycommon.logging.kafka_log import SYLogger
|
|
7
9
|
from sycommon.synacos.nacos_service import NacosService
|
|
@@ -23,7 +25,7 @@ async def feign(service_name, api_path, method='GET', params=None, headers=None,
|
|
|
23
25
|
# 初始化headers,确保是可修改的字典
|
|
24
26
|
headers = headers.copy() if headers else {}
|
|
25
27
|
if "x-traceId-header" not in headers:
|
|
26
|
-
headers["x-traceId-header"] = SYLogger.get_trace_id()
|
|
28
|
+
headers["x-traceId-header"] = SYLogger.get_trace_id() or Snowflake.next_id()
|
|
27
29
|
|
|
28
30
|
# 处理JSON请求的Content-Type
|
|
29
31
|
is_json_request = method.upper() in ["POST", "PUT", "PATCH"] and not (
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/feign_client.py
RENAMED
|
@@ -5,6 +5,8 @@ import inspect
|
|
|
5
5
|
from typing import Any, Dict, Optional, Literal, Type, TypeVar
|
|
6
6
|
from urllib.parse import urljoin
|
|
7
7
|
|
|
8
|
+
from sycommon.tools.snowflake import Snowflake
|
|
9
|
+
|
|
8
10
|
import aiohttp
|
|
9
11
|
from pydantic import BaseModel
|
|
10
12
|
from sycommon.synacos.param import Body, Cookie, File, Form, Header, Param, Path, Query
|
|
@@ -26,7 +28,7 @@ def feign_client(
|
|
|
26
28
|
default_headers: Optional[Dict[str, str]] = None
|
|
27
29
|
):
|
|
28
30
|
default_headers = default_headers or {}
|
|
29
|
-
default_headers["x-traceId-header"] = SYLogger.get_trace_id()
|
|
31
|
+
default_headers["x-traceId-header"] = SYLogger.get_trace_id() or Snowflake.next_id()
|
|
30
32
|
|
|
31
33
|
def decorator(cls):
|
|
32
34
|
class FeignClient:
|
|
@@ -153,7 +155,7 @@ def feign_client(
|
|
|
153
155
|
def _build_headers(self, param_meta: Dict[str, Param], bound_args: Dict[str, Any], method_headers: Dict[str, str]) -> Dict[str, str]:
|
|
154
156
|
headers = self.default_headers.copy()
|
|
155
157
|
headers.update(method_headers)
|
|
156
|
-
headers["x-traceId-header"] = SYLogger.get_trace_id()
|
|
158
|
+
headers["x-traceId-header"] = SYLogger.get_trace_id() or Snowflake.next_id()
|
|
157
159
|
for name, meta in param_meta.items():
|
|
158
160
|
if isinstance(meta, Header) and name in bound_args:
|
|
159
161
|
value = bound_args[name]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sycommon-python-lib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.54
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/DatabaseConfig.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/EmbeddingConfig.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/LLMConfig.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/config/RerankerConfig.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/database/base_db_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/health/health_check.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/__init__.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/logger_wrapper.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/logging/sql_logger.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/__init__.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/context.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/exception.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/timeout.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/middleware/traceid.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/base_http.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/mqlistener_config.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/mqmsg_model.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/models/mqsend_config.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/rabbitmq/rabbitmq_client.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/rabbitmq/rabbitmq_pool.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/example2.py
RENAMED
|
File without changes
|
{sycommon_python_lib-0.1.52a0 → sycommon_python_lib-0.1.54}/src/sycommon/synacos/nacos_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|