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

๐Ÿš€ 2๋‹จ๊ณ„ - ์š”๊ธˆ ์กฐํšŒ #124

Merged
merged 12 commits into from
Feb 21, 2022

Conversation

loop-study
Copy link

์•ˆ๋…•ํ•˜์„ธ์š” ๋ฆฌ๋ทฐ์–ด๋‹˜!
๋ฐ•ํ˜„์ฒ ์ž…๋‹ˆ๋‹ค.
์š”๊ธˆ๊ณ„์‚ฐ์„ Enum์œผ๋กœ ํ•œ๋ฒˆ์— ๋‹ค ์ฒ˜๋ฆฌํ•˜๋„๋ก ์ง„ํ–‰ํ•ด๋ดค์Šต๋‹ˆ๋‹ค.
Enum ์‚ฌ์šฉ์ด ๋ฏธ์ˆ™ํ•ด์„œ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

image

2022. 02. 17.
README.md
- ์š”๊ธˆ ์กฐํšŒ ์š”๊ตฌ์‚ฌํ•ญ ์ •๋ฆฌ

Resolves : loop-study
See also : junwoochoi
2022. 02. 17.
PathAcceptanceTest
- ๊ธฐ์กด ํ…Œ์ŠคํŠธ์— ์š”๊ธˆ ๊ฒ€์ฆ ์ถ”๊ฐ€

Resolves : loop-study
See also : junwoochoi
2022. 02. 17.
PathDocumentation
- ์š”๊ธˆ ๊ฒ€์ฆ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€

PathAcceptanceTest
- ์š”๊ธˆ ๊ฒ€์ฆ ๊ธˆ์•ก ์ˆ˜์ •

Resolves : loop-study
See also : junwoochoi
2022. 02. 20.
SubwayMapTest
- ๋‹ค์ค‘ ๊ฒ€์ฆ ํ…Œ์ŠคํŠธ๋ฅผ assertAll๋กœ ๋ฌถ์Œ

Resolves : loop-study
See also : junwoochoi
2022. 02. 20.
PathResponse
- ์š”๊ธˆ ํ•„๋“œ ์ถ”๊ฐ€.

Resolves : loop-study
See also : junwoochoi
2022. 02. 20.
PathResponse
- 9 -> 10์œผ๋กœ ๋ณ€๊ฒฝ

Resolves : loop-study
See also : junwoochoi
2022. 02. 20.
PathFare
- ๊ธˆ์•ก ๊ณ„์‚ฐํ•˜๋Š” enum ๊ตฌํ˜„

Path
- ๊ธฐ์กด ๋กœ์ง ์ˆ˜

PathResponse
- ๋ˆ„๋ฝ๋œ getter ์ถ”๊ฐ€

Resolves : loop-study
See also : junwoochoi
2022. 02. 20.
PathDocumentation
- ๋ถˆํ•„์š”ํ•œ ํ…Œ์ŠคํŠธ ์ œ๊ฑฐ

Resolves : loop-study
See also : junwoochoi
2022. 02. 20.
PathFareTest
- ๊ฑฐ๋ฆฌ๋ณ„ ์š”๊ธˆ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€

Resolves : loop-study
See also : junwoochoi
2022. 02. 20.
PathSteps
- ์š”๊ธˆ ํ•„๋“œ ์ถ”๊ฐ€

Resolves : loop-study
See also : junwoochoi
2022. 02. 21.
PathFare
- ๋„ค์ด๋ฐ ์ˆ˜์ •

Resolves : loop-study
See also : junwoochoi
Copy link

@junwoochoi junwoochoi left a comment

Choose a reason for hiding this comment

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

์•ˆ๋…•ํ•˜์„ธ์š”! ํ˜„์ฒ ๋‹˜! :)
์ธ์ˆ˜ํ…Œ์ŠคํŠธ ๋ฆฌํŒฉํ† ๋ง ๋ฐ ๋„๋ฉ”์ธ ํ…Œ์ŠคํŠธ ์ž˜ ์ƒ์„ฑํ•ด์„œ ๋ฏธ์…˜ ์ง„ํ–‰ํ•ด์ฃผ์‹  ๋ถ€๋ถ„ ๋งค์šฐ ์ข‹์•˜์Šต๋‹ˆ๋‹ค ๐Ÿ‘ ๐Ÿ˜„
๋‹ค๋งŒ, ์š”๊ตฌ์‚ฌํ•ญ์ด๋ž‘ ๋‹ค๋ฅด๊ฒŒ ๊ตฌํ˜„์ด ๋˜์–ด์žˆ๋Š” ๋ถ€๋ถ„์ด ์žˆ์–ด, ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒผ์œผ๋‹ˆ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค ๐Ÿ™

()-> assertThat(response.jsonPath().getInt("duration")).isEqualTo(5),
()-> assertThat(response.jsonPath().getInt("distance")).isEqualTo(13)
()-> assertThat(response.jsonPath().getInt("fare")).isEqualTo(1350)

Choose a reason for hiding this comment

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

image

`์ตœ๋‹จ ์‹œ๊ฐ„ ๊ฒฝ๋กœ`๋กœ ์š”์ฒญ์„ ์ค€ ๊ฒฝ์šฐ์—๋„, `์ตœ๋‹จ ๊ฑฐ๋ฆฌ ๊ฒฝ๋กœ`๊ธฐ์ค€์œผ๋กœ ๊ธˆ์•ก์ด ์‚ฐ์ •๋˜์–ด์•ผ ํ•˜๋Š”๋ฐ, ํ˜„์žฌ ๊ตฌํ˜„ํ•˜์‹  ๊ธฐ๋Šฅ์€ ์š”์ฒญ์ด ๋“ค์–ด์˜จ PathType์˜ ์š”๊ธˆ์„ ๊ณ„์‚ฐํ•ด์„œ ์•Œ๋ ค์ฃผ๊ณ  ์žˆ๋„ค์š” ๐Ÿ˜ญ ์š” ๋ถ€๋ถ„ ์ˆ˜์ • ๋ฐ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€๊ฐ€ ํ•„์š”ํ•ด ๋ณด์ž…๋‹ˆ๋‹ค

Copy link
Author

Choose a reason for hiding this comment

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

ํ—ˆํ—ˆํ—ฃ.... ์ด๊ฒŒ ์ด๋Ÿฐ ์˜๋ฏธ์˜€๊ตฐ์š”....

2022. 02. 21.
Path
- ์š”๊ธˆ ๊ณ„์‚ฐ์šฉ ๊ฑฐ๋ฆฌ ํ•„๋“œ ์ถ”๊ฐ€
- ์ตœ๋‹จ ์‹œ๊ฐ„์˜ ๊ฑฐ๋ฆฌ์™€ ๊ตฌ๋ถ„ํ•˜๊ธฐ ์œ„ํ•œ ์ƒ์„ฑ์ž ์ถ”๊ฐ€

PathService
- ์ตœ๋‹จ ์‹œ๊ฐ„์ผ ๊ฒฝ์šฐ ์ตœ๋‹จ ๊ฒฝ๋กœ์˜ ๊ฑฐ๋ฆฌ๋ฅผ ๋ฐ›๊ธฐ์œ„ํ•œ ์กฐ๊ฑด๋ฌธ ์ถ”๊ฐ€

PathAcceptanceTest
- ์ตœ๋‹จ ์‹œ๊ฐ„์ด ์•„๋‹Œ ์ตœ๋‹จ ๊ฒฝ๋กœ๋กœ ์š”๊ธˆ ๊ตฌํ•˜๋Š” ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€

Resolves : loop-study
See also : junwoochoi
@loop-study
Copy link
Author

loop-study commented Feb 21, 2022

์•ˆ๋…•ํ•˜์„ธ์š” ๋ฆฌ๋ทฐ์–ด๋‹˜!
๋ฐ•ํ˜„์ฒ ์ž…๋‹ˆ๋‹ค.
์ตœ๋‹จ ์‹œ๊ฐ„์˜ ๊ฑฐ๋ฆฌ๊ฐ€ ์•„๋‹Œ ์ตœ๋‹จ ๊ฑฐ๋ฆฌ๋กœ ๊ตฌํ•  ์ˆ˜ ์žˆ๋„๋ก ๋กœ์ง์„ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.
์ธ์ˆ˜ํ…Œ์ŠคํŠธ ๋˜ํ•œ ์ž ์‹ค์—ญ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ๊ฑฐ๋ฆฌ์™€ ์‹œ๊ฐ„ ๊ดด๋ฆฌ๊ฐ์œผ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋„๋ก ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  SubwayMap์„ ํ•œ๋ฒˆ๋งŒ ํ˜ธ์ถœํ•ด์„œ ํ•ด๊ฒฐํ•  ๋ฐฉ๋ฒ•์ด ์—†์„๊นŒ ๊ณ ๋ฏผ์„ ํ•ด๋ดค์ง€๋งŒ
PathService์—์„œ ์กฐ๊ฑด๋ฌธ์œผ๋กœ ํ•œ๋ฒˆ ๋” SubwayMap๋ฅผ ํ˜ธ์ถœํ•ด์„œ ์ตœ๋‹จ ๊ฑฐ๋ฆฌ๋ฅผ ๋„ฃ์–ด์ค€ ๊ฒƒ์ด ์ตœ์„ ์ด์˜€์Šต๋‹ˆ๋‹น.
๊ดœ์ฐฎ์€ ๋ฐฉ๋ฒ•์ด ์žˆ๋Š”์ง€ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๐Ÿ™ˆ
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

Copy link

@junwoochoi junwoochoi left a comment

Choose a reason for hiding this comment

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

์•ˆ๋…•ํ•˜์„ธ์š”! ์š”๊ตฌ์‚ฌํ•ญ ๋‹ค์‹œ ์ˆ˜์ •ํ•ด์ฃผ์‹  ๋ถ€๋ถ„ ์ž˜ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค!
์ถ”๊ฐ€๋กœ ์˜๊ฒฌ ์ฝ”๋ฉ˜ํŠธ ๋“œ๋ ธ๋Š”๋ฐ, ๊ณ ๋ฏผํ•ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋‹ค์Œ ๋ฏธ์…˜ ์ด์–ด์„œ ์ง„ํ–‰ํ•ด์ฃผ์„ธ์š”! ๐Ÿš€

if (PathType.DURATION == type) {
// ์ตœ๋‹จ ์‹œ๊ฐ„์˜ ๊ฑฐ๋ฆฌ๊ฐ€ ์•„๋‹Œ ์ตœ๋‹จ ๊ฒฝ๋กœ์˜ ๊ฑฐ๋ฆฌ ๊ตฌํ•˜๊ธฐ
Path shortestDistancePath = new SubwayMap(lines, PathType.DISTANCE).findPath(upStation, downStation);
path = path.changeShortestDistancePath(shortestDistancePath);

Choose a reason for hiding this comment

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

๐Ÿง path์— ํ•„๋“œ ๋ณ€์ˆ˜๋กœ shortestDistance๋ฅผ ๋„ฃ๋Š” ๊ฒƒ๋ณด๋‹ค๋Š” PathResponse.of(path, shortestPath.extractFare())์™€ ๊ฐ™์€ ์‹์œผ๋กœ PathResponse์— ๋”ฐ๋กœ ๋„ฃ๋Š” ๊ฒƒ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”. Path๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค๋ณด๋ฉด Path๋„๋ฉ”์ธ์ด ๋งค๋ฒˆ shortestDistance์™€ ํ•จ๊ป˜ ์‚ฌ์šฉ๋˜์ง€๋Š” ์•Š์„ ์ˆ˜๋„ ์žˆ์„ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ๊ฐœ์ธ์ ์ธ ์˜๊ฒฌ์ž…๋‹ˆ๋‹ค!

Copy link
Author

Choose a reason for hiding this comment

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

Path๋ฅผ ๋ณ€๊ฒฝํ•˜์ง€ ์•Š๊ณ  ํŽธํ•˜๊ฒŒ ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•˜๋„ค์š” ๐Ÿ‘

@junwoochoi junwoochoi merged commit 171d3df into next-step:loop-study Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants