aiteamutils 0.2.72__tar.gz → 0.2.73__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/PKG-INFO +1 -1
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/base_service.py +1 -2
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/database.py +3 -5
- aiteamutils-0.2.73/aiteamutils/version.py +2 -0
- aiteamutils-0.2.72/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/.cursorrules +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/.gitignore +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/README.md +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/__init__.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/base_repository.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/security.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/aiteamutils/validators.py +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/pyproject.toml +0 -0
- {aiteamutils-0.2.72 → aiteamutils-0.2.73}/setup.py +0 -0
@@ -38,13 +38,12 @@ class BaseService(Generic[ModelType]):
|
|
38
38
|
filters: Dict[str, Any] | None = None,
|
39
39
|
search_params: Dict[str, Any] | None = None,
|
40
40
|
model_name: str | None = None,
|
41
|
-
request: Request | None = None,
|
42
41
|
response_model: Any = None
|
43
42
|
) -> List[Dict[str, Any]]:
|
44
43
|
try:
|
45
44
|
# 검색 조건 처리 및 필터 병합
|
46
45
|
if search_params:
|
47
|
-
search_filters = build_search_filters(
|
46
|
+
search_filters = build_search_filters(search_params)
|
48
47
|
if filters:
|
49
48
|
# 기존 filters와 search_filters 병합 (search_filters가 우선 적용)
|
50
49
|
filters.update(search_filters)
|
@@ -120,14 +120,12 @@ def process_response(
|
|
120
120
|
# 조건 처리 #
|
121
121
|
##################
|
122
122
|
def build_search_filters(
|
123
|
-
request: Dict[str, Any],
|
124
123
|
search_params: Dict[str, Dict[str, Any]]
|
125
124
|
) -> Dict[str, Any]:
|
126
125
|
"""
|
127
|
-
|
126
|
+
검색 파라미터를 기반으로 필터 조건을 생성합니다.
|
128
127
|
|
129
128
|
Args:
|
130
|
-
request: 요청 데이터 (key-value 형태).
|
131
129
|
search_params: 검색 조건 설정을 위한 파라미터.
|
132
130
|
|
133
131
|
Returns:
|
@@ -135,9 +133,9 @@ def build_search_filters(
|
|
135
133
|
"""
|
136
134
|
filters = {}
|
137
135
|
for key, param in search_params.items():
|
138
|
-
value =
|
136
|
+
value = param.get("value")
|
139
137
|
if value is not None:
|
140
|
-
if param
|
138
|
+
if param.get("like", False):
|
141
139
|
filters[key] = {"field": param["fields"][0], "operator": "like", "value": f"%{value}%"}
|
142
140
|
else:
|
143
141
|
filters[key] = {"field": param["fields"][0], "operator": "eq", "value": value}
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|