Skip to content

Commit

Permalink
#9 fix : users api modify (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
0321minji authored Aug 3, 2024
1 parent f0f4bf3 commit b91dbf6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
12 changes: 6 additions & 6 deletions users/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
path('signup/',UserSignUpApi.as_view(),name='signup'),
path('login/', UserLoginApi.as_view(), name = 'login'),
path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
path('profile_register/',ReformerProfileApi.as_view(),name='profile_register'),
path('certification_register/',CertificationCreateApi.as_view(),name='certification'),
path('competition_register/',CompetitionCreateApi.as_view(),name='competition'),
path('intership_register/',IntershipCreateApi.as_view(),name='intership'),
path('freelancer_register/',FreelancerCreateApi.as_view(),name='freelancer'),
path('reformer_profile/<int:user_id>/',ReformerProfileApi.as_view(),name='profile'),
path('reformer/profile/',ReformerProfileApi.as_view(),name='reformer_profile_register'),
path('reformer/profile/certification/',CertificationCreateApi.as_view(),name='certification'),
path('reformer/profile/competition/',CompetitionCreateApi.as_view(),name='competition'),
path('reformer/profile/intership/',IntershipCreateApi.as_view(),name='intership'),
path('reformer/profile/freelancer/',FreelancerCreateApi.as_view(),name='freelancer'),
path('reformer/profile/<int:user_id>/',ReformerProfileDetailApi.as_view(),name='reformer_profile'),
path('profile/img/',UserProfileImageApi.as_view(),name='profile_img'),
path('profile/',UserDetailApi.as_view(),name='profile'),
]
45 changes: 33 additions & 12 deletions users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def post(self,request):
except Exception as e:
print(f"Failed to upload img to s3:{e}")
return None

class ReformerProfileApi(APIView):
permission_classes = (AllowAny,)

Expand All @@ -198,14 +199,6 @@ class ReformerProfileInputSerializer(serializers.Serializer):
special_material = serializers.ListField(
child=serializers.CharField(), allow_empty=True
)

class ReformerProfileOuputSerializer(serializers.Serializer):
market_intro=serializers.CharField()
links=serializers.CharField()
area=serializers.CharField()
carrer=serializers.CharField()


@swagger_auto_schema(
request_body=ReformerProfileInputSerializer,
security=[],
Expand Down Expand Up @@ -246,7 +239,36 @@ def post(self,request):
return Response({
'status':'success',
},status=status.HTTP_200_OK)



class ReformerProfileDetailApi(APIView):
permission_classes = (AllowAny,)
class ReformerProfileOuputSerializer(serializers.Serializer):
market_intro=serializers.CharField()
links=serializers.CharField()
area=serializers.CharField()
carrer=serializers.CharField()

@swagger_auto_schema(
security=[],
operation_id='리포머 프로필 조회 API',
operation_description="리포머의 추가 정보를 조회하는 API 입니다.",
responses={
"200":openapi.Response(
description="OK",
examples={
"application/json":{
"status":"success",
"data":{"market_intro":"market_intro~~"}
}
}
),
"400":openapi.Response(
description="Bad Request",
),
}
)
def get(self,request,user_id):
profile=ReformerSelector.profile(user_id=user_id)

Expand All @@ -255,9 +277,8 @@ def get(self,request,user_id):
return Response({
'status':'success',
'data':serializers.data,
},status=status.HTTP_200_OK)


},status=status.HTTP_200_OK)

class CertificationCreateApi(APIView):
permission_classes=(AllowAny,)

Expand Down

0 comments on commit b91dbf6

Please sign in to comment.