Skip to content

ADD: 셀소 detail get_chat_link에 coin_history response로 주기#81

Open
KilJaeeun wants to merge 7 commits into
masterfrom
kil
Open

ADD: 셀소 detail get_chat_link에 coin_history response로 주기#81
KilJaeeun wants to merge 7 commits into
masterfrom
kil

Conversation

@KilJaeeun
Copy link
Copy Markdown
Collaborator

@KilJaeeun KilJaeeun commented Apr 30, 2020

Summary

셀소 detail get_chat_link에 coin_history response로 주기

References

Checklist

  • 로컬에서 잘 작동하는지 확인했는가
  • 테스트를 작성했는가
  • Base branch 를 알맞게 설정하였는가
  • Reviewers, Assignees, Labels 등을 적절히 지정했는가

@KilJaeeun KilJaeeun added the FEAT 기능을 추가하는 경우 label Apr 30, 2020
@KilJaeeun KilJaeeun changed the title Kil [IMPROVE]셀소 detail get_chat_link에 coin_history response로 주기 Apr 30, 2020
@KilJaeeun KilJaeeun changed the title [IMPROVE]셀소 detail get_chat_link에 coin_history response로 주기 FEAT: 셀소 detail get_chat_link에 coin_history response로 주기 Apr 30, 2020
@KilJaeeun KilJaeeun changed the title FEAT: 셀소 detail get_chat_link에 coin_history response로 주기 ADD: 셀소 detail get_chat_link에 coin_history response로 주기 Apr 30, 2020
@KilJaeeun KilJaeeun requested a review from maitracle April 30, 2020 02:42
@KilJaeeun KilJaeeun self-assigned this Apr 30, 2020
@KilJaeeun KilJaeeun requested review from 10000001a and Outwater April 30, 2020 02:43
@KilJaeeun
Copy link
Copy Markdown
Collaborator Author

리뷰 부탁드립니다😀

Copy link
Copy Markdown
Owner

@maitracle maitracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 했습니다.

Comment on lines -17 to -23

def get(self, url, data=None, json=None, timeout=None, auth=None, **options):
return self.request('GET', url, data=data, json=json, timeout=timeout, auth=auth, *options)

def post(self, url, data=None, json=None, timeout=None, auth=None, **options):
return self.request('POST', url, data=data, json=json, timeout=timeout, auth=auth, *options)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빈 줄은 왜 빼신거죠ㅠㅠ

from django.urls import path
from rest_framework.routers import SimpleRouter
from rest_framework_simplejwt.views import TokenRefreshView

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도!

Comment thread hongaeting/local.py
@@ -0,0 +1,23 @@
import os
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 파일은 어떤 작업 하는 파일인가요?

Comment on lines +156 to +158



Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제거해주세요

assert_that(rest_coin).is_equal_to(expected_rest_coin)

def _check_response_and_expected(self, dictionary, instance):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제거해주세요

Comment on lines +361 to +362
assert_that(response.data['coin_history_last']['rest_coin']).is_equal_to(rest_coin)
# assert_that(CoinHistory.objects.filter(profile=profile).last().rest_coin).is_equal_to(rest_coin)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 coin history의 다른 필드들도 검사해주시고, 필요없는 코드는 삭제해주세요.

Comment on lines +32 to +45


class RetrieveCoinHistorySerializer(serializers.ModelSerializer):
class Meta:
model = CoinHistory
fields = (
'id',
'profile',
'rest_coin',
'reason',
'message',
'created_at',
'updated_at',
)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListCoinHistorySerializer와 똑같으니 굳이 하나 더 만들지 않아도 될 것 같아요.

chat_link 필드는 CharField, last_coin_history 필드는 ListCoinHistorySerializer로 ChatLinkSerializer를 하나 만들어주세요.

response_target_chat_link = request_self_date_profile.get_target_chat_link(target_self_date_profile)
chat_link = {
coin_history_last = request.user.profile.coin_histories.last()
coin_history_last = RetrieveCoinHistorySerializer(coin_history_last)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serializer를 이런식으로 사용하는 것 보단,

위의 serializer_class_by_actions에 새로 만든 ChatLinkSerializer를 추가하고, 이곳에선 self.get_serializer를 호출하여 사용하는게 더 좋아보여요.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChatLinkSerializer에 response_link_coin dictionary 전체를 넣고 전체를 serializing 해주세요

Comment on lines +116 to +118



Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

삭제해주세요.

Comment on lines -33 to -35

expected_profile = Profile.objects.get(nickname=profile_data['nickname'])

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다시 빈 줄 넣어주세요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FEAT 기능을 추가하는 경우

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants