Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 6.02 각 주식 정보 가져오기 API 구현 #54 #99

Merged
merged 9 commits into from
Nov 14, 2024

Conversation

uuuo3o
Copy link
Collaborator

@uuuo3o uuuo3o commented Nov 13, 2024

✅ 주요 작업

  • api 요청을 두개로 나눠달라고 요청하셔서, 차트용 api 한 개, 정보 표시용 api 한 개로 분리하였다.

💭 고민과 해결과정

  • 하나의 서비스 로직에서 다른 주소의 api 요청을 해야 해서 requestApi 함수를 조금 수정해서 사용했다. 현재 class 내부에서 accessToken을 발급받고 있어서 코드 작성 자체는 쉬웠다.
  • 공통 함수로 분리를 하고 작업을 하려고 했으나. . 이 부분이 진명님께서 피드백 주신 중간 계층을 둬서 처리해라 ..~ 이 부분인 것 같은데 아직 공부가 필요한 것 같아 중간에 관두고 service 클래스 안에서만 동작하게 작성했다.

@uuuo3o uuuo3o added BE 백엔드 API API 구현 REFACTORING 코드 리팩터링 labels Nov 13, 2024
@uuuo3o uuuo3o requested review from jinddings and sieunie November 13, 2024 09:08
@uuuo3o uuuo3o self-assigned this Nov 13, 2024
@uuuo3o uuuo3o linked an issue Nov 13, 2024 that may be closed by this pull request
Copy link
Collaborator

@sieunie sieunie left a comment

Choose a reason for hiding this comment

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

공통 함수로 분리를 하고 작업을 하려고 했으나. . 이 부분이 진명님께서 피드백 주신 중간 계층을 둬서 처리해라 ..~ 이 부분인 것 같은데 아직 공부가 필요한 것 같아 중간에 관두고 service 클래스 안에서만 동작하게 작성했다.

🟢 아하 확인했습니당! 나중에 저희 다같이 공부하고 분리해바요...ㅎㅎ

Comment on lines +160 to +166
private async requestApi<T>(
trId: string,
apiURL: string,
params: Record<string, string>,
): Promise<T> {
try {
const accessToken = await this.koreaInvetmentService.getAccessToken();
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟢 아니면... 이 메소드를 koreaInvestmentService에 위치시키면 전역에서 쓰도록 할 수 있지 않을까요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

그렇게 하면 여전히 다른 서비스 계층들이 koreaInvestmentService를 참조해야 하지 않나요..?!

Copy link
Collaborator

Choose a reason for hiding this comment

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

그렇긴합니당…ㅎㅎㅎ 생각해봐야게써용

Copy link
Collaborator

@jinddings jinddings left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

@uuuo3o uuuo3o merged commit d814d9c into back/main Nov 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API 구현 BE 백엔드 REFACTORING 코드 리팩터링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] 6.02 각 주식 정보 가져오기 기능 구현 (WebSocket)
3 participants