chanjin23 / teamSpringboots

0 stars 0 forks source link

Develop - [merged] #173

Closed chanjin23 closed 2 weeks ago

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 4, 2024, 17:31

Merges develop -> main

1주차 코드리뷰 MR요청입니다!

chanjin23 commented 1 month ago

added 4 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 4, 2024, 21:12

added 1 commit

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @GobumE on Oct 4, 2024, 21:25

added 5 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @HyeonSeung on Oct 4, 2024, 22:47

added 4 commits

Compare with previous version

chanjin23 commented 1 month ago

added 2 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 5, 2024, 11:14

added 2 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 5, 2024, 13:33

added 2 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 5, 2024, 14:39

added 2 commits

Compare with previous version

chanjin23 commented 1 month ago

added 4 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 5, 2024, 19:19

added 2 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @dbsghwns1209 on Oct 5, 2024, 20:49

added 13 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/orders/controller/OrdersApiController.java line 28

유지보수를 위해 로깅을 도입해보세요. 더 빨리 도입할 수록 나중에 많은 코드를 고쳐야하는 수고가 줄어듭니다.

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/item/controller/ItemRestController.java line 24

다른 모듈과 다르게 클래스명이 네이밍 되어있습니다. 통일해주세요~

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/user/domain/Users.java line 45

nullable = true 가 기본값이므로 써주지 않아도 됩니다~

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/user/domain/Users.java line 94

super method 와 동일하건 아닌지 확인해보세요~

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/category/controller/CategoryApiController.java line 26

admin 엔드포인트 분리(controller 분리)를 고려해보세요. 가독성이 좋아지고,유지 관리가 나아집니다. 단일 책임 원칙(SRP)와도 연관이 있습니다.

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/category/dto/event/EventDetailDto.java line 1

Event관련 dto만 따로 폴더를 생성한 이유가 있을까요? category 관련 dto 는 폴더가 없는 이유가 있을까요?

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/category/service/CategoryService.java line 48

ifPresentOrElse 를 사용할 수도 있습니다. 고려해보세요~

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/common/config/error/ResourceNotFoundException.java line 12

클래스에 errorCode 필드를 추가하여, 각 예외가 발생했을 때 특정한 에러 코드를 반환하도록 할 수 있습니다. 각 예외가 발생했을 때 특정한 에러 코드를 반환하면 클라이언트에게 명확한 에러 정보를 제공할 수 있고, 서버 로그를 분석하는 데 도움이 됩니다

예시

package com.spring_boots.spring_boots.common.config.error;

public class ResourceNotFoundException extends RuntimeException {
  private final String errorCode;

  public ResourceNotFoundException(String message) {
    super(message);
    this.errorCode = "RESOURCE_NOT_FOUND";
  }

  public String getErrorCode() {
    return errorCode;
  }
}
chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/item/service/ItemRestService.java line 36

각 메소드에서 발생할 수 있는 특정한 예외를 정의해서 커스터마이징된 예외를 사용하는 것이 디버깅이 용이합니다.

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/orders/dto/PlaceOrderRequest.java line 8

dto 네이밍 규칙 통일해주세요~ (다른 모듈 참고)

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/orders/service/OrdersService.java line 33

ordersRepository.findByUserId(userId); 를 사용하면 뒤에 id 로 필터링하는 부분이 사라집니다. 이 코드의 id 로 조회하는 다른 부분에도 이 로직을 적용해보세요.

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/user/controller/TokenApiController.java line 20

api 형식 다른 모듈과 논의해서 통일해주세요.

chanjin23 commented 1 month ago

In GitLab by @SiyoungOh on Oct 6, 2024, 01:30

Commented on src/main/java/com/spring_boots/spring_boots/SpringBootsApplication.java line 8

전체 피드백: 아래 내용을 고려해서 수정하면 더 좋은 코드가 될 것 같습니다.

chanjin23 commented 1 month ago

In GitLab by @yeomhyeseon on Oct 6, 2024, 15:37

Commented on src/main/resources/static/cart/cart.js line 55

cart는 값을 재할당하지 않기 때문에 const로 선언하시면 됩니다.

chanjin23 commented 1 month ago

In GitLab by @yeomhyeseon on Oct 6, 2024, 15:37

Commented on src/main/resources/static/cart/cart.js line 88

findIndex로 index를 찾아서 배열에서 index로 접근하는 방식도 좋지만 그 대신에 find라는 고차함수를 사용하면 원하는 객체를 바로 리턴받을 수 있어요~

const item = cart.find(item => item.item_id === item_id && item.item_size === item_size);
...생략
item.item_quantity = new_quantity;
...생략
item.item_size = new_size;
chanjin23 commented 1 month ago

In GitLab by @yeomhyeseon on Oct 6, 2024, 15:37

Commented on src/main/resources/static/cart/cart.js line 111

누적된 값을 리턴받고 싶다면 reduce라는 고차함수를 사용할 수 있습니다~

  const totalPrice = selectedItems.reduce((acc, item ) => {
    acc += item.item_price * item.item_quantity;
    return acc;
  }, 0);
chanjin23 commented 1 month ago

In GitLab by @yeomhyeseon on Oct 6, 2024, 15:37

Commented on src/main/resources/static/common/sidebar.js line 5

sidebar.html에서 sidebar.js를 호출하지 않고 이렇게 작성한 이유는 무엇인가요~?

chanjin23 commented 1 month ago

In GitLab by @yeomhyeseon on Oct 6, 2024, 15:37

Commented on src/main/resources/static/order-details/order-details.html line 69

js 파일로 따로 분리하는 것이 관리차원과 컨벤션에 맞아보여요~

chanjin23 commented 1 month ago

In GitLab by @yeomhyeseon on Oct 6, 2024, 15:37

Commented on src/main/resources/static/order-list/order-list.html line 43

async/await을 사용하면 .then()체인을 피하고 보다 간결한 코드를 작성할 수 있어요~ try catch도 전체를 감싸서 에러로 처리하고 싶은 경우에 throw 처리해주면 한번에 에러 처리가 가능합니다.

chanjin23 commented 1 month ago

In GitLab by @yeomhyeseon on Oct 6, 2024, 15:39

일주일동안 고생 많으셨습니다\~!
리뷰 작성하면서 공통되는 내용은 페이지별로 작성하지는 않고 한곳에만 작성해두었어요.
그렇기 때문에 각자 작업한 내용에 대한 피드백 외에도 다른 분들 내용도 함께 확인하시고 작업하실 때 적용해서 작업해 주세요\~ 🙌🏻

chanjin23 commented 1 month ago

added 4 commits

Compare with previous version

chanjin23 commented 1 month ago

added 5 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 7, 2024, 12:01

Commented on src/main/java/com/spring_boots/spring_boots/orders/controller/OrdersApiController.java line 28

changed this line in version 15 of the diff

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 7, 2024, 12:01

Commented on src/main/java/com/spring_boots/spring_boots/orders/dto/PlaceOrderRequest.java line 8

changed this line in version 15 of the diff

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 7, 2024, 12:01

Commented on src/main/resources/static/common/sidebar.js line 5

changed this line in version 15 of the diff

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 7, 2024, 12:01

Commented on src/main/resources/static/order-details/order-details.html line 69

changed this line in version 15 of the diff

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 7, 2024, 12:01

Commented on src/main/resources/static/order-list/order-list.html line 43

changed this line in version 15 of the diff

chanjin23 commented 1 month ago

In GitLab by @yul9910 on Oct 7, 2024, 12:01

added 2 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @GobumE on Oct 7, 2024, 12:21

Commented on src/main/java/com/spring_boots/spring_boots/category/controller/CategoryApiController.java line 26

changed this line in version 16 of the diff

chanjin23 commented 1 month ago

In GitLab by @GobumE on Oct 7, 2024, 12:21

Commented on src/main/java/com/spring_boots/spring_boots/category/service/CategoryService.java line 48

changed this line in version 16 of the diff

chanjin23 commented 1 month ago

In GitLab by @GobumE on Oct 7, 2024, 12:21

added 16 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @HyeonSeung on Oct 7, 2024, 12:50

Commented on src/main/java/com/spring_boots/spring_boots/item/service/ItemRestService.java line 36

changed this line in version 17 of the diff

chanjin23 commented 1 month ago

In GitLab by @HyeonSeung on Oct 7, 2024, 12:50

added 2 commits

Compare with previous version

chanjin23 commented 1 month ago

added 4 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @dbsghwns1209 on Oct 7, 2024, 16:03

Commented on src/main/resources/static/cart/cart.js line 55

changed this line in version 19 of the diff

chanjin23 commented 1 month ago

In GitLab by @dbsghwns1209 on Oct 7, 2024, 16:03

Commented on src/main/resources/static/cart/cart.js line 88

changed this line in version 19 of the diff

chanjin23 commented 1 month ago

In GitLab by @dbsghwns1209 on Oct 7, 2024, 16:03

Commented on src/main/resources/static/cart/cart.js line 111

changed this line in version 19 of the diff

chanjin23 commented 1 month ago

In GitLab by @dbsghwns1209 on Oct 7, 2024, 16:03

added 5 commits

Compare with previous version

chanjin23 commented 1 month ago

In GitLab by @GobumE on Oct 7, 2024, 17:41

added 5 commits

Compare with previous version