Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ secrets.json
__pycache__/
*.pyc
.python-version
*.log
*.log
logs/
5 changes: 4 additions & 1 deletion search/views/search_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
)
from user.models import CommonUser
from utils.common import check_and_return_normal_user, get_user_from_token
from utils.logging_decorators import log_search_call


class SearchView(View):
@log_search_call
def get(self, request: HttpRequest) -> JsonResponse:
# 0. 인증된 사용자 가져오기
valid_user: CommonUser = get_user_from_token(request)
Expand Down Expand Up @@ -125,7 +127,8 @@ def get(self, request: HttpRequest) -> JsonResponse:
"deadline",
"summary",
"company_id__company_logo",
)
"created_at",
).order_by("-created_at")

# 지역 코드 리스트 수집
city_codes = final_qs.values_list("city", flat=True).distinct()
Expand Down
3 changes: 3 additions & 0 deletions search/views/tree_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from config.settings.base import REDIS_DB, REDIS_HOST, REDIS_PORT
from search.schemas import JobTreeResponse, RegionTreeResponse
from utils.logging_decorators import log_search_call

r = redis.Redis(
host=cast(str, REDIS_HOST),
Expand All @@ -17,6 +18,7 @@


class RegionTreeView(View):
@log_search_call
def get(self, request) -> JsonResponse:
region_tree_json = r.get("region_tree")

Expand All @@ -32,6 +34,7 @@ def get(self, request) -> JsonResponse:


class JobTreeView(View):
@log_search_call
def get(self, request) -> JsonResponse:
job_tree_json = r.get("job_categories")
job_tree = json.loads(job_tree_json) if job_tree_json else {}
Expand Down