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

Fix/#128 change http library #133

Merged
merged 12 commits into from
Nov 16, 2023
Merged

Fix/#128 change http library #133

merged 12 commits into from
Nov 16, 2023

Conversation

yummygyudon
Copy link
Member

๐Ÿ“ PR Summary

๊ธฐ์กด RestTemplate์„ OpenFeign์œผ๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜

  • ์ฝ”๋“œ ๊ฐ„๊ฒฐ์„ฑ ๊ฐœ์„  ๋ชฉ์ 
  • ์ฝ”๋“œ ๊ฐ€๋…์„ฑ ๊ฐœ์„  ๋ชฉ์ 
  • ๊ด€๋ฆฌ ์šฉ์ด์„ฑ ๊ฐœ์„ 

๐ŸŒต Working Branch

fix/#128-change-http-library

๐ŸŒด Works

  • [ ]
  • [ ]

๐ŸŒฑ Related Issue

#128

@yummygyudon yummygyudon self-assigned this Oct 16, 2023
@yummygyudon yummygyudon linked an issue Oct 16, 2023 that may be closed by this pull request
1 task
- ์œ ๊ธฐ์ ์ธ Header ์ƒ์„ฑ ๊ฐ€๋Šฅ
  - ๋‹จ, springframework.web.bind ํŒจํ‚ค์ง€์˜ Mapping Annotation ์“ฐ๊ธฐ ๋ถˆํŽธํ•จ
  - Method ์ธ์‹ ์—๋Ÿฌ ๋ฐœ์ƒ -> spring.cloud.openfeign ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์€ ์ด์œ 
- ์–ด๋…ธํ…Œ์ด์…˜ ์ตœ์†Œํ™”
@pull-request-size pull-request-size bot added size/L and removed size/S labels Oct 21, 2023
@yummygyudon yummygyudon requested a review from gunom October 23, 2023 17:26
Copy link
Contributor

@gunom gunom left a comment

Choose a reason for hiding this comment

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

์ข‹์€ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! ๋‹ค๋งŒ ํ•˜๋‚˜ ๊ณ ๋ฏผ์ด ์ƒ๊ธด ๊ฒƒ์ด "client๊ฐ€ ๊ณผ์—ฐ application layer์— ์ ํ•ฉํ•œ๊ฐ€?" ๊ฐ€ ์žˆ๋„ค์š”. ์œ ์‚ฌ MSA๋ฅผ ์‚ฌ์šฉ ์ค‘์ด๋ผ client์˜ ์—ญํ• ์ด ์™ธ๋ถ€ ์„œ๋ฒ„์—์„œ ์‘๋‹ต์„ ๋ฐ›์•„์˜ค๋Š” ๊ฑฐ๋ผ๋ฉด application๋ณด๋‹ค interface์— ๋” ์ ํ•ฉํ•˜๋‹ค๋Š” ์ƒ๊ฐ๋„ ๋“ค์–ด์š”! ํ•œ๋ฒˆ ๊ณ ๋ฏผํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฑฐ ๊ฐ™์•„์š”!

public OkHttpClient okHttpClient() {
return new OkHttpClient();
}
// @Bean
Copy link
Contributor

Choose a reason for hiding this comment

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

์ฃผ์„ ์ง€์šฐ๊ธฐ!


val entity = new HttpEntity(null, headers);

Map<String, String> headers = Map.of(
Copy link
Contributor

Choose a reason for hiding this comment

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

๋ญ”๊ฐ€ header ๋งŒ๋“œ๋Š”๊ฒŒ ๊ณตํ†ต์ ์ธ๊ฒŒ ์žˆ์„ ๊ฑฐ ๊ฐ™์€๋ฐ ๋”ฐ๋กœ ๋บ„ ๋ฐฉ๋ฒ•์ด ์žˆ์œผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“œ๋„ค์š”!
๋‹ค๋ฅธ ์„œ๋น„์Šค ํด๋ž˜์Šค์—์„œ๋„ content-type๊ณผ Authorization์„ ๊ณตํ†ต์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ์• ๋“ค์€ ๋ชจ๋‘ ํ•ด๋‹น ์ฝ”๋“œ๊ฐ€ ๋ฐ˜๋ณต๋  ์ˆ˜ ์žˆ๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ...?

Copy link
Member Author

Choose a reason for hiding this comment

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

์•„ํ•ฉ!! ์š”๋ถ€๋ถ„ util static ํ•จ์ˆ˜๋‚˜ ๋‚ด๋ถ€ private ํ•จ์ˆ˜๋กœ ๋ถ„๋ฆฌ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

Copy link
Member Author

Choose a reason for hiding this comment

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

@gunom ์š”๋ถ€๋ถ„ ๋” ๊ณ ๋ฏผํ•ด๋ดค๋Š”๋ฐ
playground token refresh api๋Š” accessToken ์ด ์—†๊ณ 
x-api-key & x-request-from ์ด๋ผ๋Š” ํŠน์ˆ˜ ํ—ค๋” ๊ฐ’์ด ํ•„์š”๋กœ ํ•˜๋”๋ผ๊ตฌ์š”!!

๊ทธ๋ž˜์„œ ํ—ค๋”๋Š” Service๋งˆ๋‹ค ํŠน์ˆ˜์„ฑ์ด ์žˆ์„ ๊ฒƒ ๊ฐ™๊ธฐ๋„ ํ•˜๋‚˜
๋ฉ”์„œ๋“œ๋กœ ๋ถ„๋ฆฌํ•˜๋Š”๊ฒŒ ๊ฐ€๋…์„ฑ ๊ฐœ์„ ์— ๋„์›€์ด ๋  ๊ฒƒ ๊ฐ™๋‹ค๋Š” ๋ถ€๋ถ€์—” ์ „์ ์œผ๋กœ ๋™์˜ํ•˜์—ฌ
์šฐ์„  ๊ฐ Service ํด๋ž˜์Šค์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ณตํ†ต ํ—ค๋” ๊ฐ’์„ ํฌํ•จํ•˜๋Š” Header Map ๊ฐ์ฒด ์ƒ์„ฑ ๋ฉ”์„œ๋“œ๋ฅผ private์œผ๋กœ ์„ ์–ธํ•˜์—ฌ ์žฌ์‚ฌ์šฉํ•˜๋„๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค!!

์ดํ›„ ์ปค๋ฐ‹ ๋ด์ฃผ์‹œ๋ฉด ๋  ๊ฒƒ ๊ฐ™์•„์˜น~~

@yummygyudon
Copy link
Member Author

์ข‹์€ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! ๋‹ค๋งŒ ํ•˜๋‚˜ ๊ณ ๋ฏผ์ด ์ƒ๊ธด ๊ฒƒ์ด "client๊ฐ€ ๊ณผ์—ฐ application layer์— ์ ํ•ฉํ•œ๊ฐ€?" ๊ฐ€ ์žˆ๋„ค์š”. ์œ ์‚ฌ MSA๋ฅผ ์‚ฌ์šฉ ์ค‘์ด๋ผ client์˜ ์—ญํ• ์ด ์™ธ๋ถ€ ์„œ๋ฒ„์—์„œ ์‘๋‹ต์„ ๋ฐ›์•„์˜ค๋Š” ๊ฑฐ๋ผ๋ฉด application๋ณด๋‹ค interface์— ๋” ์ ํ•ฉํ•˜๋‹ค๋Š” ์ƒ๊ฐ๋„ ๋“ค์–ด์š”! ํ•œ๋ฒˆ ๊ณ ๋ฏผํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฑฐ ๊ฐ™์•„์š”!

์˜ค์˜ค,....app ์œผ๋กœ ๊ธฐ์ค€์„ ์žก๊ณ  ์ƒ๊ฐํ•˜๋‹ค๋ณด๋‹ˆ service ๋‚ด๋ถ€์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ์šฉ๋„๋กœ client๊ฐ€ ์‚ฌ์šฉ๋˜๊ธฐ์— application layer์— ํฌํ•จ๊ธฐ์ผœ ๋†“์•˜๋Š”๋ฐ
๊ฑด๋ชจ์”จ์˜ ์˜๊ฒฌ๋„ ๋งค์šฐ ์ข‹์€ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค..!!
ํ ... ๋ง์”€ํ•˜์‹  ๋ฐฉ๋ฒ•๋Œ€๋กœ๋ผ๋ฉด interface ํŒจํ‚ค์ง€ ๋‚ด๋ถ€์— external ํด๋”๋ฅผ ๋งŒ๋“ค์–ด์„œ client ๋“ค์„ ๊ด€๋ฆฌํ•˜๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š”?!

- ์™ธ๋ถ€ ์„œ๋ฒ„์—์„œ ์‘๋‹ต์„ ๋ฐ›์•„์˜ค๋Š” ๊ฐ์ฒด๋“ค๋กœ์„œ application ๊ณ„์ธต๋ณด๋‹ค๋Š” interface ๊ณ„์ธต์— ์žˆ๋Š” ๊ฒƒ์ด ๋ฐ”๋žŒ์งํ•˜๋‹ค๊ณ  ํŒ๋‹จ
@yummygyudon yummygyudon merged commit dc90b7b into dev Nov 16, 2023
0 of 2 checks passed
@ozzing ozzing deleted the fix/#128-change-http-library branch May 23, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FIX] RestTemplate to OpenFeign
2 participants