Skip to content

Commit

Permalink
Merge pull request #195 from CSSAInformationDepartment/Eason
Browse files Browse the repository at this point in the history
新增检查各部门是否正在招新接口
  • Loading branch information
Liu233w authored Dec 25, 2021
2 parents 798330f + f762bd4 commit eff2d70
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/RecruitAPI/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from . import models
from rest_framework import serializers

class JoblistAvailabilitySerializer(serializers.ModelSerializer):
class Meta:
model = models.JobList
fields = ['jobName', 'disabled']
1 change: 1 addition & 0 deletions src/RecruitAPI/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
path('resume/', ResumeListView.as_view(), name="resume_list"),
path('resume/<str:id>/detail/', ResumeDetailView.as_view(), name="resume_detail"),
path('resume/<str:id>/add_to_interview/', AddInterviewView.as_view(), name="add_to_interview"),
path('joblist_availability_check/', JoblistAvailabilityViewSet.as_view({'get': 'list'}), name='joblist_availability_check')
]

urlpatterns += [
Expand Down
8 changes: 8 additions & 0 deletions src/RecruitAPI/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from rest_framework import serializers, status, viewsets, permissions


from .serializers import *
from .models import Resume, JobList, InterviewTimetable
from .apis import GetResumesByDepartments, GetInterviewTimeByDepartments
from .forms import AddJobForm, AddInterviewForm
Expand Down Expand Up @@ -231,3 +234,8 @@ def filter_queryset(self, qs):
if search:
qs = qs.filter(Q(resume__user__email__istartswith=search))
return qs

class JoblistAvailabilityViewSet(viewsets.ReadOnlyModelViewSet):
queryset = JobList.objects.all().order_by('jobId')
serializer_class = JoblistAvailabilitySerializer
permission_classes = [permissions.AllowAny]

0 comments on commit eff2d70

Please sign in to comment.