-
Notifications
You must be signed in to change notification settings - Fork 120
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_김민성_1주차 과제(1단계~3단계) #165
Open
castlekimdev
wants to merge
20
commits into
kakao-tech-campus-2nd-step2:main
Choose a base branch
from
castlekimdev:step1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5647f76
docs: 구현할 기능 목록 정리
castlekimdev 8eb5891
feat: 상품 클래스 구현
castlekimdev fac0838
feat: 상품 관련 API 구현
castlekimdev aeccfc7
feat: 상품 추가 수정 삭제 DTO 구현
castlekimdev 7811777
feat: 상품 관리 페이지 응답용 컨트롤러 구현
castlekimdev 78357b1
feat: 어드민 상품 관리 화면 구현
castlekimdev 022cb5c
feat: h2 데이터베이스 ddl 정의 및 연동
castlekimdev 4bdcf35
feat: product repository 구현
castlekimdev 54ea3aa
refactor: 더 직관적인 네이밍으로 변경 (`productRepository `)
castlekimdev 315c4fa
refactor: `/products`로 공통화
castlekimdev 32562c0
refactor: 도메인 객체 `record` 대신 `class`로 변경
castlekimdev 37923e7
refactor: `Repository` 조회 함수 리턴값 Optional 하게 변경
castlekimdev a3f91e1
refactor: 불필요한 어노테이션 `@Autowired` 제거
castlekimdev 7d500f5
feat: custom exception 정의 (`NoSuchElementException`)
castlekimdev 98c367e
chore: Local DB 연동 정보 추가
castlekimdev 713078f
refactor: util에 정의된 `NoSuchElementException` 사용하도록 변경
castlekimdev 9e3d9e7
fix: `RequestMapping` 올바르게 사용하도록 수정
castlekimdev c0fc53a
refactor: 관습에 따라 setter 이름 변경
castlekimdev 83c8325
refactor: controller가 domain service에 의존하도록 리팩토링
castlekimdev 5ebd921
chore: data.sql, schema.sql 올바른 위치로 이동
castlekimdev 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 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 |
---|---|---|
@@ -1,10 +1,80 @@ | ||
package gift.domain; | ||
|
||
public record Product( | ||
Long id, | ||
String name, | ||
Integer price, | ||
String imageUrl | ||
) { | ||
import java.util.Objects; | ||
|
||
public class Product { | ||
|
||
private Long id; | ||
private String name; | ||
private Integer price; | ||
private String imageUrl; | ||
|
||
public Product(Long id, String name, Integer price, String imageUrl) { | ||
this.id = id; | ||
this.name = name; | ||
this.price = price; | ||
this.imageUrl = imageUrl; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Integer getPrice() { | ||
return price; | ||
} | ||
|
||
public void setPrice(Integer price) { | ||
this.price = price; | ||
} | ||
|
||
public String getImageUrl() { | ||
return imageUrl; | ||
} | ||
|
||
public void setImageUrl(String imageUrl) { | ||
this.imageUrl = imageUrl; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Product{" + | ||
"id=" + id + | ||
", name='" + name + '\'' + | ||
", price=" + price + | ||
", imageUrl='" + imageUrl + '\'' + | ||
'}'; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
Product product = (Product) o; | ||
return Objects.equals(id, product.id) && | ||
Objects.equals(name, product.name) && | ||
Objects.equals(price, product.price) && | ||
Objects.equals(imageUrl, product.imageUrl); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, name, price, imageUrl); | ||
} | ||
} |
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.
모든 setter 가 현재 코드에서 사용되지 않는 것 같은데, 사용하지 않는 setter는 닫아두는 것이 어떨까요~?