-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#5 hello jihoon #9
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3903d5c
### ์ ๋ชฉ
Fwe1 0f722bf
### ์ ๋ชฉ Create Order class
Fwe1 97d774a
### ์ ๋ชฉ Create orderRepository class
Fwe1 dd16388
Create README.md
Fwe1 7cdab06
### ์ ๋ชฉ
Fwe1 d15314e
Merge remote-tracking branch 'origin/feat/#5-hello-jihoon' into feat/โฆ
Fwe1 21377aa
#5
Fwe1 52ce032
Merge remote-tracking branch 'origin/feat/#5-hello-jihoon' into feat/โฆ
Fwe1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ### 5.15 | ||
| ## Order class | ||
| ๊ธฐ๋ณธ์ ์ธ ์์ฑ์ ์ ์ธ | ||
| ์์ด๋๋ฅผ ์ฐพ์ ์ ์๋๋ก ๋งค์๋ ์ ์ธ | ||
|
|
||
| ## OrderRepository class | ||
| ๋ชจ๋ ์์ด๋์ ๋ฆฌ์คํธ๋ฅผ ํ์ธ ํ ์ ์๋ ๋งค์๋ ์ถ๊ฐ -> ArrayList๋ก ์์ฑ | ||
| ํน์ ์์ด๋๋ฅผ ์ฐพ์ ์ ์๋ ๋งค์๋ ์ถ๊ฐ | ||
| ๋ชจ๋ ๋ฆฌ์คํธ๋ฅผ ์ญ์ ํ ์ ์๋ ๋งค์๋ ์ถ๊ฐ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package jihoon; | ||
|
|
||
| public class Hello { | ||
| public static void main(String[] args) { | ||
| System.out.println("Hello world"); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package jihoon; | ||
|
|
||
| public class JihoonPractice { | ||
| public static void greet() { | ||
| System.out.println("reqeqw"); | ||
| } | ||
| public static void main(String[] args) { | ||
|
|
||
| greet(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package jihoon.Order; | ||
|
|
||
| // Order.java | ||
| public class Order { | ||
| private Long memberId; // ์ฃผ๋ฌธ์ ํ์ ID | ||
| private String itemName; // ์ํ๋ช | ||
| private int itemPrice; // ์ํ ๊ฐ๊ฒฉ | ||
| private int discountPrice; // ํ ์ธ ๊ธ์ก | ||
| private int finalPrice; // ์ต์ข ๊ฒฐ์ ๊ธ์ก | ||
|
|
||
| public Order(Long memberId, String itemName, int itemPrice, int discountPrice, int finalPrice) { | ||
| this.memberId = memberId; | ||
| this.itemName = itemName; | ||
| this.itemPrice = itemPrice; | ||
| this. finalPrice = finalPrice; | ||
|
|
||
| } | ||
| public Long getId() { | ||
| return memberId; | ||
| } | ||
| // ์์ฑ์, ๊ณ์ฐ ๋ฉ์๋, ์ถ๋ ฅ ๋ฉ์๋ ๋ฑ ํฌํจ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package jihoon.Order; | ||
| import java.util.List; | ||
| import java.util.ArrayList; | ||
| public class OrderRepository { | ||
| private List<Order> orders = new ArrayList<>(); | ||
|
|
||
| public void save(Order order) { | ||
| orders.add(order); | ||
| } | ||
|
|
||
| public List<Order> findAll() { | ||
| return orders; | ||
| } | ||
|
|
||
| public Order findById(int id) { | ||
| for (Order order : orders) { | ||
| if (order.getId() == id) { | ||
| return order; | ||
| } | ||
|
|
||
| } | ||
| return null; | ||
| } | ||
|
|
||
| public void clear() { | ||
| orders.clear(); | ||
| } | ||
| } | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good