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

[1단계 - 상품 관리 기능] 제이미(임정수) 미션 제출합니다. #237

Merged
merged 42 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
32a2fb7
docs: 기능 요구사항 목록 추가
JJ503 Apr 25, 2023
eae188a
feat: Datasource 등록 및 item 테이블 생성
JJ503 Apr 25, 2023
9c0b810
feat: item 전체 조회 기능 추가
JJ503 Apr 25, 2023
685a2d7
test: item 전체 조회 기능 테스트
JJ503 Apr 25, 2023
acada40
feat: ItemService에서 전체 아이템 불러오기 기능 추가
JJ503 Apr 25, 2023
5c9a1df
feat: ListController에 GET / 요청 매핑
JJ503 Apr 25, 2023
4f0d7f3
feat: AdminController GET /admin 요청 매핑
JJ503 Apr 25, 2023
94f1efb
feat: ItemDAO 저장하는 기능 추가
JJ503 Apr 25, 2023
b21951f
refactor: item 빌더 패턴 적용
JJ503 Apr 25, 2023
bce2003
feat: ItemService 아이템 저장 기능 추가
JJ503 Apr 25, 2023
d799b17
feat: ItemController에 POST /items 요청 매핑
JJ503 Apr 25, 2023
6fd8e7f
feat: ItemController에 GET /items 요청 매핑
JJ503 Apr 25, 2023
5c4f1a0
feat: ItemDao 수정 기능 추가
JJ503 Apr 25, 2023
7fe376a
feat: ItemService 수정 기능 추가
JJ503 Apr 25, 2023
c098d2b
feat: ItemController PUT /items/{id} 요청 매핑
JJ503 Apr 25, 2023
33f04a5
feat: ItemDao 삭제 기능 추가
JJ503 Apr 25, 2023
63f21dd
feat: ItemService 삭제 기능 추가
JJ503 Apr 25, 2023
35381f6
feat: ItemController DELTE /items/{id} 요청 매핑 추가
JJ503 Apr 25, 2023
6024f73
feat: ItemController DELTE /items/{id} 요청 매핑 추가
JJ503 Apr 25, 2023
3e22cc9
Merge remote-tracking branch 'origin/step1' into step1
JJ503 Apr 25, 2023
04d003d
docs: 완료한 요구사항 목록 체크
JJ503 Apr 26, 2023
a0a4b6a
feat: GET /items/{id} 요청 매핑
JJ503 Apr 26, 2023
40ebbd6
feat: item 등록, 수정, 삭제 시 메인 페이지로 이동하도록 수정
JJ503 Apr 26, 2023
90f146b
test: 모든 요청에 대한 통합 테스트
JJ503 Apr 26, 2023
8f90ec5
test: ItemDao 단위 테스트 추가
JJ503 Apr 26, 2023
5f12965
feat: Item의 필드를 랩핑 후 각 필드의 검증 로직 추가
JJ503 Apr 26, 2023
5ca48e9
test: ItemService 테스트 추가
JJ503 Apr 26, 2023
4278ebc
refactor: ItemDao findBy() optional 반환으로 변경
JJ503 Apr 26, 2023
ce07176
feat: ItemRequest의 검증과 예외처리 추가
JJ503 Apr 26, 2023
b55c49c
chore: 필요없는 파일 삭제
JJ503 Apr 27, 2023
4c103b5
feat: 도메인 검증 로직 추가
JJ503 Apr 27, 2023
66eb010
test: 도메인 생성 및 예외 테스트 추가
JJ503 Apr 27, 2023
46c2a3e
test: Dao 생성 및 예외 테스트 추가
JJ503 Apr 27, 2023
64b247f
test: 서비스 생성 및 예외 테스트 추가
JJ503 Apr 27, 2023
2008347
test: 아이템 컨트롤러 테스트 추가
JJ503 Apr 27, 2023
da2e490
test: ExceptionHandler 응답 테스트 추가
JJ503 Apr 27, 2023
b95452c
refactor: ItemController 반환타입 수정
JJ503 May 1, 2023
37effce
refactor: 반환 상태를 status코드 대신 메서드로 변경
JJ503 May 1, 2023
c5881dd
refactor: 로그 레벨 변경
JJ503 May 1, 2023
abc97e1
refactor: view를 반환하는 api를 한 컨트롤러로 통합
JJ503 May 1, 2023
1743041
refactor: 완료한 todo 제거
JJ503 May 1, 2023
040cebf
refactor: imageUrl의 타입으로 text로 변경
JJ503 May 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: ItemController DELTE /items/{id} 요청 매핑 추가
- {id} 정보를 삭제하는 기능을 한다.
- admin.js axios 요청 설정 추가

Co-authored-by: dooboocookie <[email protected]>
  • Loading branch information
JJ503 and dooboocookie committed Apr 25, 2023
commit 6024f73a4580e215dae071e0cbad2a75791414e1
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- 상품 이름
- 상품 이미지
- 상품 가격
- [ ] 상품 관리 CRUD API 작성
- [x] 상품 관리 CRUD API 작성
- [x] 상품 생성
- [x] POST /item 요청과 매핑
- [x] db에 저장한다
Expand All @@ -19,9 +19,9 @@
- [x] 상품 수정
- [x] PUT /item 요청과 매핑
- [x] 특정 item의 정보를 수정한다
- [ ] 상품 삭제
- [ ] DELETE /item 요청과 매핑
- [ ] 특정 item을 삭제한다
- [x] 상품 삭제
- [x] DELETE /item 요청과 매핑
- [x] 특정 item을 삭제한다
- [ ] 관리자 도구 페이지 연동
- [x] /admin 요청
- [x] 모든 상품 목록을 담고 있는 html을 응답한다
Expand All @@ -31,5 +31,5 @@
- [x] 수정 버튼 클릭
- [x] 수정할 상품 정보를 입력한다
- [x] submit 버튼을 클릭해 해당 행의 상품 정보를 수정한다
- [ ] 삭제 버튼 클릭
- [ ] 해당 행의 정보를 삭제한다
- [x] 삭제 버튼 클릭
- [x] 해당 행의 정보를 삭제한다
5 changes: 5 additions & 0 deletions src/main/java/cart/controller/ItemController.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ public ResponseEntity updateItem(@PathVariable final Long itemId,
return ResponseEntity.status(HttpStatus.CREATED).build();
}

@DeleteMapping("/{itemId}")
public ResponseEntity deleteItem(@PathVariable final Long itemId) {
itemService.deleteItem(itemId);
return ResponseEntity.status(HttpStatus.OK).build();
}
}
4 changes: 2 additions & 2 deletions src/main/resources/static/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ const updateProduct = (product) => {
});
};

// TODO: [1단계] 상품 관리 CRUD API에 맞게 변경
const deleteProduct = (id) => {
axios.request({
url: '',
url: '/items/' + id,
method: 'delete'
}).then((response) => {
window.location.reload();
}).catch((error) => {
Expand Down