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 @@ -4,4 +4,5 @@
secrets.json
__pycache__/
*.pyc
.python-version
.python-version
*.log
11 changes: 9 additions & 2 deletions resume/views/resume_views.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import json
import logging
import uuid
from typing import List

from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.http import HttpRequest, JsonResponse
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from pydantic_core._pydantic_core import ValidationError

from resume.models import CareerInfo, Certification, Resume
Expand All @@ -31,6 +30,9 @@
from user.models import CommonUser, UserInfo
from user.schemas import UserInfoModel
from utils.common import check_and_return_normal_user, get_user_from_token
from utils.logging_decorators import log_resume_call

logger = logging.getLogger(__name__)

# ------------------------
# 이력서 관련 api
Expand All @@ -42,6 +44,7 @@ class MyResumeListView(View):
내 이력서 관련 (일반 유저)
"""

@log_resume_call
def get(self, request: HttpRequest) -> JsonResponse:
"""
내 이력서 리스트 조회
Expand Down Expand Up @@ -75,6 +78,7 @@ def get(self, request: HttpRequest) -> JsonResponse:
except Exception as e:
return JsonResponse({"errors": str(e)}, status=400)

@log_resume_call
def post(self, request: HttpRequest) -> JsonResponse:
"""
새로운 이력서 등록
Expand Down Expand Up @@ -123,6 +127,7 @@ class MyResumeDetailView(View):
이력서 단일 조회 / 수정 / 삭제
"""

@log_resume_call
def get(self, request: HttpRequest, resume_id: uuid.UUID) -> JsonResponse:
"""
이력서 상세 조회
Expand Down Expand Up @@ -166,6 +171,7 @@ def get(self, request: HttpRequest, resume_id: uuid.UUID) -> JsonResponse:
except Exception as e:
return JsonResponse({"errors": str(e)}, status=400)

@log_resume_call
def patch(self, request: HttpRequest, resume_id: uuid.UUID) -> JsonResponse:
"""
이력서 부분 수정
Expand Down Expand Up @@ -198,6 +204,7 @@ def patch(self, request: HttpRequest, resume_id: uuid.UUID) -> JsonResponse:
except Exception as e:
return JsonResponse({"errors": str(e)}, status=400)

@log_resume_call
def delete(self, request: HttpRequest, resume_id: uuid.UUID) -> JsonResponse:
"""
이력서 삭제
Expand Down
15 changes: 13 additions & 2 deletions resume/views/submission_views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json
import logging
import uuid

from django.core.exceptions import PermissionDenied
from django.http import HttpRequest, JsonResponse
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf import csrf_exempt, csrf_protect
from pydantic_core._pydantic_core import ValidationError

from job_posting.models import JobPosting, JobPostingBookmark
Expand Down Expand Up @@ -38,6 +37,10 @@
check_and_return_normal_user,
get_user_from_token,
)
from utils.logging_decorators import log_resume_call

logger = logging.getLogger(__name__)


# ------------------------
# 지원 관련 api
Expand All @@ -49,6 +52,7 @@ class SubmissionListView(View):
지원한 공고 리스트 API (유저)
"""

@log_resume_call
def get(self, request: HttpRequest) -> JsonResponse:
"""
지원한 공고 리스트 조회
Expand All @@ -75,6 +79,7 @@ def get(self, request: HttpRequest) -> JsonResponse:
except Exception as e:
return JsonResponse({"errors": str(e)}, status=400)

@log_resume_call
def post(self, request: HttpRequest) -> JsonResponse:
"""
공고 지원 (유저)
Expand Down Expand Up @@ -146,6 +151,7 @@ class SubmissionDetailView(View):
지원 공고 상세
"""

@log_resume_call
def get(self, request: HttpRequest, submission_id: uuid.UUID) -> JsonResponse:
"""
상세 데이터 조회
Expand Down Expand Up @@ -193,6 +199,7 @@ def get(self, request: HttpRequest, submission_id: uuid.UUID) -> JsonResponse:
except Exception as e:
return JsonResponse({"errors": str(e)}, status=400)

@log_resume_call
def delete(self, request: HttpRequest, submission_id: uuid.UUID) -> JsonResponse:
"""
지원공고 삭제
Expand Down Expand Up @@ -220,6 +227,7 @@ class SubmissionMemoView(View):
memo update 및 delete 뷰
"""

@log_resume_call
def patch(self, request: HttpRequest, submission_id: uuid.UUID) -> JsonResponse:
"""
memo 수정
Expand Down Expand Up @@ -248,6 +256,7 @@ def patch(self, request: HttpRequest, submission_id: uuid.UUID) -> JsonResponse:
except Exception as e:
return JsonResponse({"errors": str(e)}, status=400)

@log_resume_call
def delete(self, request: HttpRequest, submission_id: uuid.UUID) -> JsonResponse:
"""
memo 삭제
Expand Down Expand Up @@ -278,6 +287,7 @@ class SubmissionCompanyListView(View):
기업 유저 지원자 목록 조회
"""

@log_resume_call
def get(self, request: HttpRequest) -> JsonResponse:
"""
공고 제목 및 지원서 목록 리스트 조회
Expand Down Expand Up @@ -324,6 +334,7 @@ class SubmissionCompanyDetialView(View):
기업회원 지원자 이력서 조회
"""

@log_resume_call
def get(self, request: HttpRequest, submission_id: uuid.UUID) -> JsonResponse:
try:
valid_user: CommonUser = get_user_from_token(request)
Expand Down